Documentation ¶
Index ¶
- Constants
- type Adapter1
- func (a *Adapter1) Close()
- func (a *Adapter1) GetDiscoveryFilters() ([]string, error)
- func (a *Adapter1) GetProperties() (*Adapter1Properties, error)
- func (a *Adapter1) RemoveDevice(device string) error
- func (a *Adapter1) SetDiscoveryFilter(f map[string]interface{}) error
- func (a *Adapter1) SetProperty(name string, value interface{}) error
- func (a *Adapter1) StartDiscovery() error
- func (a *Adapter1) StopDiscovery() error
- type Adapter1Properties
- type Agent1Interface
- type AgentManager1
- func (a *AgentManager1) Close()
- func (a *AgentManager1) ExportGoAgentToDBus(agentInstance Agent1Interface) error
- func (a *AgentManager1) RegisterAgent(agent string, capability string) error
- func (a *AgentManager1) RequestDefaultAgent(agent string) error
- func (a *AgentManager1) UnregisterAgent(agent string) error
- type Device1
- func (d *Device1) CancelPairing() error
- func (d *Device1) Close()
- func (d *Device1) Connect() error
- func (d *Device1) ConnectProfile(uuid string) error
- func (d *Device1) Disconnect() error
- func (d *Device1) DisconnectProfile(uuid string) error
- func (d *Device1) GetProperties() (*Device1Properties, error)
- func (d *Device1) GetProperty(name string) (dbus.Variant, error)
- func (d *Device1) Pair() error
- func (d *Device1) Register() (chan *dbus.Signal, error)
- func (d *Device1) SetProperty(name string, v interface{}) error
- func (d *Device1) Unregister(signal chan *dbus.Signal) error
- type Device1Properties
- type GattCharacteristic1
- func (d *GattCharacteristic1) AcquireNotify() (dbus.UnixFD, uint16, error)
- func (d *GattCharacteristic1) AcquireWrite() (dbus.UnixFD, uint16, error)
- func (d *GattCharacteristic1) Close()
- func (d *GattCharacteristic1) GetProperties() (*GattCharacteristic1Properties, error)
- func (d *GattCharacteristic1) GetProperty(name string) (interface{}, error)
- func (d *GattCharacteristic1) ReadValue(options map[string]dbus.Variant) ([]byte, error)
- func (d *GattCharacteristic1) Register() (chan *dbus.Signal, error)
- func (d *GattCharacteristic1) StartNotify() error
- func (d *GattCharacteristic1) StopNotify() error
- func (d *GattCharacteristic1) Unregister(signal chan *dbus.Signal) error
- func (d *GattCharacteristic1) WriteValue(b []byte, options map[string]dbus.Variant) error
- type GattCharacteristic1Properties
- type GattDescriptor1
- func (d *GattDescriptor1) Close()
- func (d *GattDescriptor1) GetProperties() (*GattDescriptor1Properties, error)
- func (d *GattDescriptor1) ReadValue(options map[string]dbus.Variant) ([]byte, error)
- func (d *GattDescriptor1) Register() (chan *dbus.Signal, error)
- func (d *GattDescriptor1) Unregister(signal chan *dbus.Signal) error
- func (d *GattDescriptor1) WriteValue(b []byte, options map[string]dbus.Variant) error
- type GattDescriptor1Properties
- type GattManager1
- type GattManager1Properties
- type GattService1
- type GattService1Properties
- type LEAdvertisement1Properties
- type LEAdvertisingManager1
- type LEAdvertisingManager1Properties
- type ObjectManager
- type ProfileManager1
- type SupportedIncludesType
Constants ¶
const ( AGENT_CAP_DISPLAY_ONLY = "DisplayOnly" AGENT_CAP_DISPLAY_YES_NO = "DisplayYesNo" AGENT_CAP_KEYBOARD_ONLY = "KeyboardOnly" AGENT_CAP_NO_INPUT_NO_OUTPUT = "NoInputNoOutput" AGENT_CAP_KEYBOARD_DISPLAY = "KeyboardDisplay" )
All agent capabilities
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter1 ¶
type Adapter1 struct { Properties *Adapter1Properties // contains filtered or unexported fields }
Adapter1 client
func NewAdapter1 ¶
NewAdapter1 create a new Adapter1 client
func (*Adapter1) GetDiscoveryFilters ¶
GetDiscoveryFilters - get supported discovery filters
func (*Adapter1) GetProperties ¶
func (a *Adapter1) GetProperties() (*Adapter1Properties, error)
GetProperties load all available properties
func (*Adapter1) RemoveDevice ¶
RemoveDevice from the list
func (*Adapter1) SetDiscoveryFilter ¶
SetDiscoveryFilters - set discovery filters.
Example:
filters := map[string]interface{} { "RSSI": int16(-127), "Transport": "le", "DuplicateData": true, "UUIDs": []string{"0x180a", "0x1400"}, } adapter.SetDiscoveryFilter(filter)
func (*Adapter1) SetProperty ¶
SetProperty set a property
func (*Adapter1) StartDiscovery ¶
StartDiscovery on the adapter
func (*Adapter1) StopDiscovery ¶
StopDiscovery on the adapter
type Adapter1Properties ¶
type Adapter1Properties struct { UUIDs []string Discoverable bool Discovering bool Pairable bool Powered bool Address string AddressType string Alias string Modalias string Name string Class uint32 DiscoverableTimeout uint32 PairableTimeout uint32 }
Adapter1Properties contains the exposed properties of an interface
type Agent1Interface ¶
type Agent1Interface interface { Release() *dbus.Error // Callback doesn't trigger on unregister RequestPinCode(device dbus.ObjectPath) (pincode string, err *dbus.Error) // Triggers for pairing when SSP is off and cap != CAP_NO_INPUT_NO_OUTPUT DisplayPinCode(device dbus.ObjectPath, pincode string) *dbus.Error RequestPasskey(device dbus.ObjectPath) (passkey uint32, err *dbus.Error) // SSP on, toolz.AGENT_CAP_KEYBOARD_ONLY DisplayPasskey(device dbus.ObjectPath, passkey uint32, entered uint16) *dbus.Error RequestConfirmation(device dbus.ObjectPath, passkey uint32) *dbus.Error RequestAuthorization(device dbus.ObjectPath) *dbus.Error AuthorizeService(device dbus.ObjectPath, uuid string) *dbus.Error Cancel() *dbus.Error RegistrationPath() string InterfacePath() string }
type AgentManager1 ¶
type AgentManager1 struct {
// contains filtered or unexported fields
}
AgentManager1 client
func NewAgentManager1 ¶
func NewAgentManager1(hostID string) *AgentManager1
NewAgentManager1 create a new AgentManager1 client
func (*AgentManager1) ExportGoAgentToDBus ¶
func (a *AgentManager1) ExportGoAgentToDBus(agentInstance Agent1Interface) error
ExportGoAgentToDBus exports the xml of go agent to dbus
func (*AgentManager1) RegisterAgent ¶
func (a *AgentManager1) RegisterAgent(agent string, capability string) error
RegisterAgent registers an agent handler
func (*AgentManager1) RequestDefaultAgent ¶
func (a *AgentManager1) RequestDefaultAgent(agent string) error
RequestDefaultAgent requests to make the application agent the default agent
func (*AgentManager1) UnregisterAgent ¶
func (a *AgentManager1) UnregisterAgent(agent string) error
UnregisterAgent unregisters the agent that has been previously registered
type Device1 ¶
type Device1 struct { Properties *Device1Properties // contains filtered or unexported fields }
Device1 client
func (*Device1) CancelPairing ¶
CancelParing stop the pairing process
func (*Device1) ConnectProfile ¶
ConnectProfile connect to the specific profile
func (*Device1) DisconnectProfile ¶
DisconnectProfile from the device
func (*Device1) GetProperties ¶
func (d *Device1) GetProperties() (*Device1Properties, error)
GetProperties load all available properties
func (*Device1) GetProperty ¶
GetProperty get a property
func (*Device1) SetProperty ¶
SetProperty set a property
type Device1Properties ¶
type Device1Properties struct { Lock sync.RWMutex AdvertisingFlags []byte UUIDs []string Blocked bool Connected bool LegacyPairing bool Paired bool ServicesResolved bool Trusted bool ServiceData map[string]dbus.Variant ManufacturerData map[uint16]dbus.Variant RSSI int16 TxPower int16 Adapter dbus.ObjectPath Address string AddressType string Alias string Icon string Modalias string Name string Appearance uint16 Class uint32 }
Device1Properties exposed properties for Device1
type GattCharacteristic1 ¶
type GattCharacteristic1 struct { Properties *GattCharacteristic1Properties Path string // contains filtered or unexported fields }
GattCharacteristic1 client
func NewGattCharacteristic1 ¶
func NewGattCharacteristic1(path string) (*GattCharacteristic1, error)
NewGattCharacteristic1 create a new GattCharacteristic1 client
func (*GattCharacteristic1) AcquireNotify ¶
func (d *GattCharacteristic1) AcquireNotify() (dbus.UnixFD, uint16, error)
AcquireNotify acquire file descriptor and MTU for notify [experimental]
func (*GattCharacteristic1) AcquireWrite ¶
func (d *GattCharacteristic1) AcquireWrite() (dbus.UnixFD, uint16, error)
AcquireWrite acquire file descriptor and MTU for writing [experimental]
func (*GattCharacteristic1) GetProperties ¶
func (d *GattCharacteristic1) GetProperties() (*GattCharacteristic1Properties, error)
GetProperties load all available properties
func (*GattCharacteristic1) GetProperty ¶
func (d *GattCharacteristic1) GetProperty(name string) (interface{}, error)
GetProperty load a single property
func (*GattCharacteristic1) Register ¶
func (d *GattCharacteristic1) Register() (chan *dbus.Signal, error)
Register for changes signalling
func (*GattCharacteristic1) StartNotify ¶
func (d *GattCharacteristic1) StartNotify() error
StartNotify start notifications
func (*GattCharacteristic1) StopNotify ¶
func (d *GattCharacteristic1) StopNotify() error
StopNotify stop notifications
func (*GattCharacteristic1) Unregister ¶
func (d *GattCharacteristic1) Unregister(signal chan *dbus.Signal) error
Unregister for changes signalling
func (*GattCharacteristic1) WriteValue ¶
WriteValue write a value to a characteristic
type GattCharacteristic1Properties ¶
type GattCharacteristic1Properties struct { Value []byte `dbus:"emit"` Notifying bool NotifyAcquired bool WriteAcquired bool Service dbus.ObjectPath UUID string Flags []string Descriptors []dbus.ObjectPath }
GattCharacteristic1Properties exposed properties for GattCharacteristic1
func (*GattCharacteristic1Properties) ToMap ¶
func (d *GattCharacteristic1Properties) ToMap() (map[string]interface{}, error)
ToMap serialize properties
type GattDescriptor1 ¶
type GattDescriptor1 struct { Properties *GattDescriptor1Properties // contains filtered or unexported fields }
GattDescriptor1 client
func NewGattDescriptor1 ¶
func NewGattDescriptor1(path string) (*GattDescriptor1, error)
NewGattDescriptor1 create a new GattDescriptor1 client
func (*GattDescriptor1) GetProperties ¶
func (d *GattDescriptor1) GetProperties() (*GattDescriptor1Properties, error)
GetProperties load all available properties
func (*GattDescriptor1) Register ¶
func (d *GattDescriptor1) Register() (chan *dbus.Signal, error)
Register for changes signalling
func (*GattDescriptor1) Unregister ¶
func (d *GattDescriptor1) Unregister(signal chan *dbus.Signal) error
Unregister for changes signalling
func (*GattDescriptor1) WriteValue ¶
WriteValue write a value to a characteristic
type GattDescriptor1Properties ¶
type GattDescriptor1Properties struct { Value []byte `dbus:"emit"` Characteristic dbus.ObjectPath UUID string Flags []string }
GattDescriptor1Properties exposed properties for GattDescriptor1
func (*GattDescriptor1Properties) ToMap ¶
func (d *GattDescriptor1Properties) ToMap() (map[string]interface{}, error)
ToMap serialize properties
type GattManager1 ¶
type GattManager1 struct { Properties *GattManager1Properties // contains filtered or unexported fields }
GattManager1 client
func NewGattManager1 ¶
func NewGattManager1(hostID string) *GattManager1
NewGattManager1 create a new GattManager1 client
func (*GattManager1) GetProperties ¶
func (a *GattManager1) GetProperties() (*GattManager1Properties, error)
GetProperties load all available properties
func (*GattManager1) RegisterApplication ¶
func (a *GattManager1) RegisterApplication(app dbus.ObjectPath, options map[string]interface{}) error
RegisterApplication add a new bluetooth Application
func (*GattManager1) UnregisterApplication ¶
func (a *GattManager1) UnregisterApplication(app dbus.ObjectPath) error
UnregisterApplication remove a bluetooth Application
type GattManager1Properties ¶
type GattManager1Properties struct { }
GattManager1Properties exposed properties for GattManager1
type GattService1 ¶
type GattService1 struct { Properties *GattService1Properties // contains filtered or unexported fields }
GattService1 client
func NewGattService1 ¶
func NewGattService1(path string, name string) *GattService1
NewGattService1 create a new GattService1 client
func (*GattService1) GetProperties ¶
func (d *GattService1) GetProperties() (*GattService1Properties, error)
GetProperties load all available properties
func (*GattService1) Register ¶
func (d *GattService1) Register() (chan *dbus.Signal, error)
Register for changes signalling
func (*GattService1) Unregister ¶
func (d *GattService1) Unregister(signal chan *dbus.Signal) error
Unregister for changes signalling
type GattService1Properties ¶
type GattService1Properties struct { Primary bool Device dbus.ObjectPath Characteristics []dbus.ObjectPath `dbus:"emit"` UUID string }
GattService1Properties exposed properties for GattService1
func (*GattService1Properties) ToMap ¶
func (p *GattService1Properties) ToMap() (map[string]interface{}, error)
ToMap serialize a properties struct to a map
type LEAdvertisement1Properties ¶
type LEAdvertisement1Properties struct { Type string ServiceUUIDs []string ManufacturerData map[string]interface{} SolicitUUIDs []string ServiceData map[string]interface{} Data map[string]interface{} // Advertise as general discoverable. When present this // will override adapter Discoverable property. // // Note: This property shall not be set when Type is set // to broadcast. Discoverable bool DiscoverableTimeout uint16 // List of features to be included in the advertising // packet. // // Possible values: as found on // LEAdvertisingManager.SupportedIncludes Includes []string LocalName string Appearance uint16 Duration uint16 Timeout uint16 }
LEAdvertisement1Properties exposed properties for LEAdvertisement1
func (*LEAdvertisement1Properties) ToMap ¶
func (d *LEAdvertisement1Properties) ToMap() (map[string]interface{}, error)
ToMap serialize properties
type LEAdvertisingManager1 ¶
type LEAdvertisingManager1 struct {
// contains filtered or unexported fields
}
LEAdvertisingManager1 client
func NewLEAdvertisingManager1 ¶
func NewLEAdvertisingManager1(hostID string) *LEAdvertisingManager1
NewLEAdvertisingManager1 create a new LEAdvertisingManager1 client
func (*LEAdvertisingManager1) RegisterAdvertisement ¶
func (a *LEAdvertisingManager1) RegisterAdvertisement(advertisement string, options map[string]interface{}) error
RegisterAdvertisement add a new advertisement service
func (*LEAdvertisingManager1) UnregisterAdvertisement ¶
func (a *LEAdvertisingManager1) UnregisterAdvertisement(advertisement string) error
UnregisterAdvertisement drop an advertisement service
type LEAdvertisingManager1Properties ¶
type LEAdvertisingManager1Properties struct { ActiveInstances byte SupportedInstances byte SupportedIncludes []SupportedIncludesType }
LEAdvertisingManager1Properties exposed properties for LEAdvertisingManager1
type ObjectManager ¶
type ObjectManager struct {
// contains filtered or unexported fields
}
ObjectManager manges the list of all available objects
func NewObjectManager ¶
func NewObjectManager(name string, path string) *ObjectManager
NewObjectManager create a new Device1 client
func (*ObjectManager) GetManagedObjects ¶
func (o *ObjectManager) GetManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, error)
GetManagedObjects return a list of all available objects registered
func (*ObjectManager) Register ¶
func (o *ObjectManager) Register() (chan *dbus.Signal, error)
Register watch for signal events
func (*ObjectManager) Unregister ¶
func (o *ObjectManager) Unregister(signal chan *dbus.Signal) error
Unregister watch for signal events
type ProfileManager1 ¶
type ProfileManager1 struct {
// contains filtered or unexported fields
}
ProfileManager1 client
func NewProfileManager1 ¶
func NewProfileManager1(hostID string) *ProfileManager1
NewProfileManager1 create a new ProfileManager1 client
func (*ProfileManager1) RegisterProfile ¶
func (a *ProfileManager1) RegisterProfile(profile string, UUID string, options map[string]interface{}) error
RegisterProfile add a new Profile for an UUID
func (*ProfileManager1) UnregisterProfile ¶
func (a *ProfileManager1) UnregisterProfile(profile string) error
UnregisterProfile add a new Profile for an UUID
type SupportedIncludesType ¶
type SupportedIncludesType string
const ( SupportedIncludesTypeTxPower SupportedIncludesType = "tx-power" SupportedIncludesTypeAppearance SupportedIncludesType = "appearance" SupportedIncludesTypeLocalName SupportedIncludesType = "local-name" )
Possible values: "tx-power" "appearance" "local-name"