Documentation
¶
Index ¶
- type Adapter
- type Bluez
- func (b *Bluez) CallAdapter(adapter, method string, flags dbus.Flags, args ...interface{}) *dbus.Call
- func (b *Bluez) CallDevice(adapterName, deviceMac, method string, flags dbus.Flags, args ...interface{}) *dbus.Call
- func (b *Bluez) Connect(adapterName, deviceMac string) error
- func (b *Bluez) ConvertToDevices(path string, values map[string]map[string]dbus.Variant) []Device
- func (b *Bluez) Disconnect(adapterName, deviceMac string) error
- func (b *Bluez) GetDeviceProperties(adapterName, deviceMac string) (map[string]dbus.Variant, error)
- func (b *Bluez) ManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, error)
- func (b *Bluez) Pair(adapterName, deviceMac string) error
- func (b *Bluez) PopulateCache() error
- func (b *Bluez) RemoveDevice(adapterName, deviceMac string) error
- func (b *Bluez) SetAdapterProperty(adapterName, key string, value interface{}) error
- func (b *Bluez) SetDeviceProperty(adapterName, deviceMac string, key string, value interface{}) error
- func (b *Bluez) StartDiscovery(adapter string) error
- func (b *Bluez) WatchSignal() chan *dbus.Signal
- type Device
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct { Path string Name string Alias string Address string Discoverable bool Pairable bool Powered bool Discovering bool }
Adapter holds the bluetooth device adapter installed for a system. This can be retrieved by `hciconfig -a`.
type Bluez ¶
Bluez represents an overview of the bluetooth adapters and devices installed and configured on a system. A connection to `bluez` dbus is also used to interact with the bluetooth server on a system.
func (*Bluez) CallAdapter ¶
func (b *Bluez) CallAdapter(adapter, method string, flags dbus.Flags, args ...interface{}) *dbus.Call
CallAdapter is used to interact with the bluez Adapter dbus interface. https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt
func (*Bluez) CallDevice ¶
func (b *Bluez) CallDevice(adapterName, deviceMac, method string, flags dbus.Flags, args ...interface{}) *dbus.Call
CallDevice is used to interact with the bluez Device dbus interface. https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/device-api.txt
func (*Bluez) Connect ¶
Connect will attempt to connect an already paired bluetooth device to an adapter.
func (*Bluez) ConvertToDevices ¶
ConvertToDevices converts a map of dbus objects to a common Device structure.
func (*Bluez) Disconnect ¶
Disconnect will remove the bluetooth device from the adapter.
func (*Bluez) GetDeviceProperties ¶
GetDeviceProperties gathers all the properties for a bluetooth device.
func (*Bluez) ManagedObjects ¶
ManagedObjects gets all bluetooth devices and adpaters that are currently managed by bluez.
func (*Bluez) PopulateCache ¶
PopulateCache will query system for known bluetooth adapters and devices and will store them on the Bluez structure. TODO(vishen): Better name than 'PopulateCache'? This is gathering information about bluetooth devices and adapters...
func (*Bluez) RemoveDevice ¶
RemoveDevice will permantently remove the bluetooth device from the adapter. Once a device is removed, it can only be added again by being paired.
func (*Bluez) SetAdapterProperty ¶
SetAdapterProperty can be used to set certain properties for a bluetooth device.
func (*Bluez) SetDeviceProperty ¶
func (b *Bluez) SetDeviceProperty(adapterName, deviceMac string, key string, value interface{}) error
SetDeviceProperty can be used to set certain properties for a bluetooth device.
func (*Bluez) StartDiscovery ¶
StartDiscovery will put the adapter into "discovering" mode, which means the bluetooth device will be able to discover other bluetooth devices that are in pairing mode.
func (*Bluez) WatchSignal ¶
WatchSignal will register to receive events form the bluez dbus interface. Any events received are passed along to the returned channel for the caller to use.