Documentation ¶
Overview ¶
package api wraps an high level API to simplify interaction
Index ¶
- func Discover(a *adapter.Adapter1, filter *adapter.DiscoveryFilter) (chan *adapter.DeviceDiscovered, func(), error)
- func Exit() error
- func ExposeAdvertisement(adapterID string, props *advertising.LEAdvertisement1Properties, ...) (func(), error)
- func ExposeDBusService(s ExposedDBusService) (err error)
- func GetAdapter(adapterID string) (*adapter.Adapter1, error)
- func GetDefaultAdapter() (*adapter.Adapter1, error)
- func GetDefaultAdapterID() string
- func RemoveDBusService(s ExposedDBusService) error
- type Advertisement
- func (a *Advertisement) DBusConn() *dbus.Conn
- func (a *Advertisement) DBusObjectManager() *DBusObjectManager
- func (a *Advertisement) DBusProperties() *DBusProperties
- func (a *Advertisement) GetProperties() bluez.Properties
- func (a *Advertisement) Interface() string
- func (a *Advertisement) Path() dbus.ObjectPath
- type DBusObjectManager
- func (o *DBusObjectManager) AddObject(path dbus.ObjectPath, val map[string]bluez.Properties) error
- func (o *DBusObjectManager) GetManagedObject(objpath dbus.ObjectPath) (map[string]map[string]dbus.Variant, error)
- func (o *DBusObjectManager) GetManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, *dbus.Error)
- func (o *DBusObjectManager) RemoveObject(path dbus.ObjectPath) error
- func (o *DBusObjectManager) SignalAdded(path dbus.ObjectPath) error
- func (o *DBusObjectManager) SignalRemoved(path dbus.ObjectPath, ifaces []string) error
- type DBusProperties
- func (p *DBusProperties) AddProperties(iface string, props bluez.Properties) error
- func (p *DBusProperties) Expose(path dbus.ObjectPath)
- func (p *DBusProperties) Instance() *prop.Properties
- func (p *DBusProperties) Introspection(iface string) []introspect.Property
- func (p *DBusProperties) RemoveProperties(iface string)
- type ExposedDBusService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
func Discover(a *adapter.Adapter1, filter *adapter.DiscoveryFilter) (chan *adapter.DeviceDiscovered, func(), error)
Discover start device discovery
func ExposeAdvertisement ¶
func ExposeAdvertisement(adapterID string, props *advertising.LEAdvertisement1Properties, discoverableTimeout uint32) (func(), error)
Expose to bluez an advertisment instance via the adapter advertisement manager
func ExposeDBusService ¶
func ExposeDBusService(s ExposedDBusService) (err error)
Expose - Interface() (Service, Char or Descr) - Properties interface
func GetDefaultAdapter ¶
func GetDefaultAdapterID ¶
func GetDefaultAdapterID() string
func RemoveDBusService ¶
func RemoveDBusService(s ExposedDBusService) error
Types ¶
type Advertisement ¶
type Advertisement struct {
// contains filtered or unexported fields
}
func NewAdvertisement ¶
func NewAdvertisement(adapterID string, props *advertising.LEAdvertisement1Properties) (*Advertisement, error)
func (*Advertisement) DBusConn ¶
func (a *Advertisement) DBusConn() *dbus.Conn
func (*Advertisement) DBusObjectManager ¶
func (a *Advertisement) DBusObjectManager() *DBusObjectManager
func (*Advertisement) DBusProperties ¶
func (a *Advertisement) DBusProperties() *DBusProperties
func (*Advertisement) GetProperties ¶
func (a *Advertisement) GetProperties() bluez.Properties
func (*Advertisement) Interface ¶
func (a *Advertisement) Interface() string
func (*Advertisement) Path ¶
func (a *Advertisement) Path() dbus.ObjectPath
type DBusObjectManager ¶
type DBusObjectManager struct {
// contains filtered or unexported fields
}
DBusObjectManager interface implementation
func NewDBusObjectManager ¶
func NewDBusObjectManager(conn *dbus.Conn) (*DBusObjectManager, error)
NewDBusObjectManager create a new instance
func (*DBusObjectManager) AddObject ¶
func (o *DBusObjectManager) AddObject(path dbus.ObjectPath, val map[string]bluez.Properties) error
AddObject add an object to the list
func (*DBusObjectManager) GetManagedObject ¶
func (o *DBusObjectManager) GetManagedObject(objpath dbus.ObjectPath) (map[string]map[string]dbus.Variant, error)
GetManagedObject return an up to date view of a single object state
func (*DBusObjectManager) GetManagedObjects ¶
func (o *DBusObjectManager) GetManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, *dbus.Error)
GetManagedObjects return an up to date view of the object state
func (*DBusObjectManager) RemoveObject ¶
func (o *DBusObjectManager) RemoveObject(path dbus.ObjectPath) error
RemoveObject remove an object from the list
func (*DBusObjectManager) SignalAdded ¶
func (o *DBusObjectManager) SignalAdded(path dbus.ObjectPath) error
SignalAdded notify of interfaces being added
func (*DBusObjectManager) SignalRemoved ¶
func (o *DBusObjectManager) SignalRemoved(path dbus.ObjectPath, ifaces []string) error
SignalRemoved notify of interfaces being removed
type DBusProperties ¶
type DBusProperties struct {
// contains filtered or unexported fields
}
DBus Properties interface implementation
func NewDBusProperties ¶
func NewDBusProperties(conn *dbus.Conn) (*DBusProperties, error)
NewDBusProperties create a new instance
func (*DBusProperties) AddProperties ¶
func (p *DBusProperties) AddProperties(iface string, props bluez.Properties) error
AddProperties add a property set
func (*DBusProperties) Expose ¶
func (p *DBusProperties) Expose(path dbus.ObjectPath)
Expose expose the properties interface
func (*DBusProperties) Instance ¶
func (p *DBusProperties) Instance() *prop.Properties
Instance return the props instance
func (*DBusProperties) Introspection ¶
func (p *DBusProperties) Introspection(iface string) []introspect.Property
Introspection return the props instance
func (*DBusProperties) RemoveProperties ¶
func (p *DBusProperties) RemoveProperties(iface string)
RemoveProperties remove a property set
type ExposedDBusService ¶
type ExposedDBusService interface { Path() dbus.ObjectPath Interface() string GetProperties() bluez.Properties // App() *App DBusProperties() *DBusProperties DBusObjectManager() *DBusObjectManager DBusConn() *dbus.Conn }