Documentation ¶
Index ¶
- Constants
- Variables
- func GetConnection(connType BusType) (*dbus.Conn, error)
- type BusType
- type Client
- func (c *Client) Call(method string, flags dbus.Flags, args ...interface{}) *dbus.Call
- func (c *Client) Connect() error
- func (c *Client) Disconnect()
- func (c *Client) GetProperties(props interface{}) error
- func (c *Client) GetProperty(p string) (dbus.Variant, error)
- func (c *Client) Register(path string, iface string) (chan *dbus.Signal, error)
- func (c *Client) SetProperty(p string, v interface{}) error
- func (c *Client) Unregister(path string, iface string, signal chan *dbus.Signal) error
- type Config
- type Properties
Constants ¶
const ( OrgBluezInterface = "org.bluez" //Device1Interface the bluez interface for Device1 Device1Interface = "org.bluez.Device1" //Adapter1Interface the bluez interface for Adapter1 Adapter1Interface = "org.bluez.Adapter1" //GattService1Interface the bluez interface for GattService1 GattService1Interface = "org.bluez.GattService1" //GattCharacteristic1Interface the bluez interface for GattCharacteristic1 GattCharacteristic1Interface = "org.bluez.GattCharacteristic1" //GattDescriptor1Interface the bluez interface for GattDescriptor1 GattDescriptor1Interface = "org.bluez.GattDescriptor1" //LEAdvertisement1Interface the bluez interface for LEAdvertisement1 LEAdvertisement1Interface = "org.bluez.LEAdvertisement1" // Agent1Interface the bluez interface for Agent1 Agent1Interface = "org.bluez.Agent1" //ObjectManagerInterface the dbus object manager interface ObjectManagerInterface = "org.freedesktop.DBus.ObjectManager" //InterfacesRemoved the DBus signal member for InterfacesRemoved InterfacesRemoved = "org.freedesktop.DBus.ObjectManager.InterfacesRemoved" //InterfacesAdded the DBus signal member for InterfacesAdded InterfacesAdded = "org.freedesktop.DBus.ObjectManager.InterfacesAdded" //PropertiesInterface the DBus properties interface PropertiesInterface = "org.freedesktop.DBus.Properties" //PropertiesChanged the DBus properties interface and member PropertiesChanged = "org.freedesktop.DBus.Properties.PropertiesChanged" )
const ( FlagCharacteristicBroadcast = "broadcast" FlagCharacteristicRead = "read" FlagCharacteristicWriteWithoutResponse = "write-without-response" FlagCharacteristicWrite = "write" FlagCharacteristicNotify = "notify" FlagCharacteristicIndicate = "indicate" FlagCharacteristicAuthenticatedSignedWrites = "authenticated-signed-writes" FlagCharacteristicReliableWrite = "reliable-write" FlagCharacteristicWritableAuxiliaries = "writable-auxiliaries" FlagCharacteristicEncryptRead = "encrypt-read" FlagCharacteristicEncryptWrite = "encrypt-write" FlagCharacteristicEncryptAuthenticatedRead = "encrypt-authenticated-read" FlagCharacteristicEncryptAuthenticatedWrite = "encrypt-authenticated-write" FlagCharacteristicSecureRead = "secure-read" FlagCharacteristicSecureWrite = "secure-write" )
Defines how the characteristic value can be used. See Core spec "Table 3.5: Characteristic Properties bit field", and "Table 3.8: Characteristic Extended Properties bit field"
const ( FlagDescriptorRead = "read" FlagDescriptorWrite = "write" FlagDescriptorEncryptRead = "encrypt-read" FlagDescriptorEncryptWrite = "encrypt-write" FlagDescriptorEncryptAuthenticatedRead = "encrypt-authenticated-read" FlagDescriptorEncryptAuthenticatedWrite = "encrypt-authenticated-write" FlagDescriptorSecureRead = "secure-read" FlagDescriptorSecureWrite = "secure-write" )
Descriptor specific flags
const Device1IntrospectDataString = `` /* 1601-byte string literal not displayed */
Device1IntrospectDataString interface definition
const GattCharacteristic1IntrospectDataString = `` /* 694-byte string literal not displayed */
GattCharacteristic1IntrospectDataString interface definition
const GattDescriptor1IntrospectDataString = `` /* 428-byte string literal not displayed */
GattDescriptor1IntrospectDataString interface definition
const GattService1IntrospectDataString = `` /* 309-byte string literal not displayed */
GattService1IntrospectDataString interface definition
const ObjectManagerIntrospectDataString = `` /* 410-byte string literal not displayed */
ObjectManagerIntrospectDataString introspect ObjectManager description
Variables ¶
var GattService1IntrospectData = introspect.Interface{ Name: "org.bluez.GattService1", Properties: []introspect.Property{ { Name: "UUID", Access: "read", Type: "s", }, { Name: "Device", Access: "read", Type: "o", }, { Name: "Primary", Access: "read", Type: "b", }, { Name: "Characteristics", Access: "read", Type: "ao", }, }, }
GattService1IntrospectData interface definition
var ObjectManagerIntrospectData = introspect.Interface{ Name: "org.freedesktop.DBus.ObjectManager", Methods: []introspect.Method{ { Name: "GetManagedObjects", Args: []introspect.Arg{ { Name: "objects", Type: "a{oa{sa{sv}}}", Direction: "out", }, }, }, }, Signals: []introspect.Signal{ { Name: "InterfacesAdded", Args: []introspect.Arg{ { Name: "object", Type: "o", }, { Name: "interfaces", Type: "a{sa{sv}}", }, }, }, { Name: "InterfacesRemoved", Args: []introspect.Arg{ { Name: "object", Type: "o", }, { Name: "interfaces", Type: "as", }, }, }, }, }
ObjectManagerIntrospectData introspect ObjectManager description
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client implement a DBus client
func (*Client) GetProperties ¶
GetProperties load all the properties for an interface
func (*Client) GetProperty ¶
GetProperty return a property value
func (*Client) SetProperty ¶
SetProperty set a property value
type Properties ¶
Properties dbus serializable struct Use struct tags to control how the field is handled by Properties interface Example: field `dbus:writable,emit,myCallback` See Prop in github.com/godbus/dbus/prop for configuration details Options: - writable: set the property as writable (Set will updated it). Omit for read-only - emit|invalidates: emit PropertyChanged, invalidates emit without disclosing the value. Omit for read-only - callback: a callable function in the struct compatible with the signature of Prop.Callback. Omit for no callback