Documentation ¶
Index ¶
- Constants
- Variables
- func CloseConnections() (err error)
- func GetConnection(connType BusType) (*dbus.Conn, error)
- func UnwatchProperties(wprop WatchableClient, ch chan *PropertyChanged) error
- func WatchProperties(wprop WatchableClient) (chan *PropertyChanged, 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) Emit(path dbus.ObjectPath, name string, values ...interface{}) error
- func (c *Client) GetConnection() *dbus.Conn
- func (c *Client) GetDbusObject() dbus.BusObject
- func (c *Client) GetProperties(props interface{}) error
- func (c *Client) GetProperty(p string) (dbus.Variant, error)
- func (c *Client) Register(path dbus.ObjectPath, iface string) (chan *dbus.Signal, error)
- func (c *Client) SetProperty(p string, v interface{}) error
- func (c *Client) Unregister(path dbus.ObjectPath, iface string, signal chan *dbus.Signal) error
- type Config
- type ObjectManager
- func (o *ObjectManager) Close()
- func (o *ObjectManager) GetManagedObject(objpath dbus.ObjectPath) (map[string]map[string]dbus.Variant, error)
- func (o *ObjectManager) GetManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, error)
- func (o *ObjectManager) Register() (chan *dbus.Signal, error)
- func (o *ObjectManager) Unregister(signal chan *dbus.Signal) error
- type Properties
- type PropertyChanged
- type WatchableClient
Constants ¶
const ( OrgBluezPath = "/org/bluez" OrgBluezInterface = "org.bluez" //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" // Introspectable introspectable interface Introspectable = "org.freedesktop.DBus.Introspectable" )
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 ¶
func CloseConnections ¶
func CloseConnections() (err error)
CloseConnections close all open connection to DBus
func GetConnection ¶
GetConnection get a DBus connection
func UnwatchProperties ¶
func UnwatchProperties(wprop WatchableClient, ch chan *PropertyChanged) error
func WatchProperties ¶
func WatchProperties(wprop WatchableClient) (chan *PropertyChanged, error)
WatchProperties updates on property changes
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client implement a DBus client
func (*Client) GetConnection ¶
func (c *Client) GetConnection() *dbus.Conn
GetConnection returns the Dbus connection
func (*Client) GetDbusObject ¶
func (c *Client) GetDbusObject() dbus.BusObject
GetDbusObject returns the Dbus object
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
func (*Client) Unregister ¶
Unregister for signals
type ObjectManager ¶
type ObjectManager struct {
// contains filtered or unexported fields
}
ObjectManager manges the list of all available objects
func GetObjectManager ¶
func GetObjectManager() (*ObjectManager, error)
GetObjectManager return a client instance of the Bluez object manager
func NewObjectManager ¶
func NewObjectManager(name string, path string) (*ObjectManager, error)
NewObjectManager create a new ObjectManager client
func (*ObjectManager) GetManagedObject ¶
func (o *ObjectManager) GetManagedObject(objpath dbus.ObjectPath) (map[string]map[string]dbus.Variant, error)
GetManagedObject return an up to date view of a single object state. object is nil if the object path is not found
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 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/v5/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
type PropertyChanged ¶
PropertyChanged indicates that a change is notified
type WatchableClient ¶
type WatchableClient interface { Client() *Client Path() dbus.ObjectPath ToProps() Properties GetWatchPropertiesChannel() chan *dbus.Signal SetWatchPropertiesChannel(chan *dbus.Signal) }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
BlueZ D-Bus Profile API description [profile-api.txt]
|
BlueZ D-Bus Profile API description [profile-api.txt] |
adapter
BlueZ D-Bus Adapter API description [adapter-api.txt]
|
BlueZ D-Bus Adapter API description [adapter-api.txt] |
admin_policy
BlueZ D-Bus Admin Policy API description [admin-policy-api.txt] This API provides methods to control the behavior of bluez as an administrator.
|
BlueZ D-Bus Admin Policy API description [admin-policy-api.txt] This API provides methods to control the behavior of bluez as an administrator. |
advertisement_monitor
BlueZ D-Bus Advertisement Monitor API Description [advertisement-monitor-api.txt] This API allows an client to specify a job of monitoring advertisements by registering the root of hierarchy and then exposing advertisement monitors under the root with filtering conditions, thresholds of RSSI and timers of RSSI thresholds.
|
BlueZ D-Bus Advertisement Monitor API Description [advertisement-monitor-api.txt] This API allows an client to specify a job of monitoring advertisements by registering the root of hierarchy and then exposing advertisement monitors under the root with filtering conditions, thresholds of RSSI and timers of RSSI thresholds. |
advertising
BlueZ D-Bus LE Advertising API Description [advertising-api.txt] Advertising packets are structured data which is broadcast on the LE Advertising channels and available for all devices in range.
|
BlueZ D-Bus LE Advertising API Description [advertising-api.txt] Advertising packets are structured data which is broadcast on the LE Advertising channels and available for all devices in range. |
agent
BlueZ D-Bus Agent API description [agent-api.txt]
|
BlueZ D-Bus Agent API description [agent-api.txt] |
battery
BlueZ D-Bus Battery API description [battery-api.txt]
|
BlueZ D-Bus Battery API description [battery-api.txt] |
device
BlueZ D-Bus Device API description [device-api.txt]
|
BlueZ D-Bus Device API description [device-api.txt] |
gatt
BlueZ D-Bus GATT API description [gatt-api.txt] GATT local and remote services share the same high-level D-Bus API.
|
BlueZ D-Bus GATT API description [gatt-api.txt] GATT local and remote services share the same high-level D-Bus API. |
health
BlueZ D-Bus Health API description [health-api.txt]
|
BlueZ D-Bus Health API description [health-api.txt] |
input
BlueZ D-Bus Input API description [input-api.txt]
|
BlueZ D-Bus Input API description [input-api.txt] |
media
BlueZ D-Bus Media API description [media-api.txt]
|
BlueZ D-Bus Media API description [media-api.txt] |
mesh
BlueZ D-Bus Mesh API description [mesh-api.txt]
|
BlueZ D-Bus Mesh API description [mesh-api.txt] |
network
BlueZ D-Bus Network API description [network-api.txt]
|
BlueZ D-Bus Network API description [network-api.txt] |
obex
OBEX D-Bus API description [obex-api.txt]
|
OBEX D-Bus API description [obex-api.txt] |
obex_agent
OBEX D-Bus Agent API description [obex-agent-api.txt]
|
OBEX D-Bus Agent API description [obex-agent-api.txt] |
sap
BlueZ D-Bus Sim Access API description [sap-api.txt]
|
BlueZ D-Bus Sim Access API description [sap-api.txt] |
thermometer
BlueZ D-Bus Thermometer API description [thermometer-api.txt]
|
BlueZ D-Bus Thermometer API description [thermometer-api.txt] |