Documentation ¶
Overview ¶
BlueZ D-Bus Battery API description [battery-api.txt]
Index ¶
- Variables
- type Battery1
- func (a *Battery1) Client() *bluez.Client
- func (a *Battery1) Close()
- func (a *Battery1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)
- func (a *Battery1) GetPercentage() (byte, error)
- func (a *Battery1) GetProperties() (*Battery1Properties, error)
- func (a *Battery1) GetPropertiesSignal() (chan *dbus.Signal, error)
- func (a *Battery1) GetProperty(name string) (dbus.Variant, error)
- func (a *Battery1) GetWatchPropertiesChannel() chan *dbus.Signal
- func (a *Battery1) Interface() string
- func (a *Battery1) Path() dbus.ObjectPath
- func (a *Battery1) SetProperty(name string, value interface{}) error
- func (a *Battery1) SetWatchPropertiesChannel(c chan *dbus.Signal)
- func (a *Battery1) ToProps() bluez.Properties
- func (a *Battery1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
- func (a *Battery1) WatchProperties() (chan *bluez.PropertyChanged, error)
- type Battery1Properties
- func (a *Battery1Properties) FromDBusMap(props map[string]dbus.Variant) (*Battery1Properties, error)
- func (a *Battery1Properties) FromMap(props map[string]interface{}) (*Battery1Properties, error)
- func (p *Battery1Properties) Lock()
- func (a *Battery1Properties) ToMap() (map[string]interface{}, error)
- func (p *Battery1Properties) Unlock()
Constants ¶
This section is empty.
Variables ¶
var Battery1Interface = "org.bluez.Battery1"
Functions ¶
This section is empty.
Types ¶
type Battery1 ¶
type Battery1 struct { Properties *Battery1Properties // contains filtered or unexported fields }
Battery1 Battery hierarchy
func NewBattery1 ¶
func NewBattery1(objectPath dbus.ObjectPath) (*Battery1, error)
NewBattery1 create a new instance of Battery1
Args: - objectPath: [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
func (*Battery1) GetObjectManagerSignal ¶
GetObjectManagerSignal return a channel for receiving updates from the ObjectManager
func (*Battery1) GetPercentage ¶
GetPercentage get Percentage value
func (*Battery1) GetProperties ¶
func (a *Battery1) GetProperties() (*Battery1Properties, error)
GetProperties load all available properties
func (*Battery1) GetPropertiesSignal ¶
GetPropertiesSignal return a channel for receiving udpdates on property changes
func (*Battery1) GetProperty ¶
GetProperty get a property
func (*Battery1) GetWatchPropertiesChannel ¶
GetWatchPropertiesChannel return the dbus channel to receive properties interface
func (*Battery1) SetProperty ¶
SetProperty set a property
func (*Battery1) SetWatchPropertiesChannel ¶
SetWatchPropertiesChannel set the dbus channel to receive properties interface
func (*Battery1) ToProps ¶
func (a *Battery1) ToProps() bluez.Properties
ToProps return the properties interface
func (*Battery1) UnwatchProperties ¶
func (a *Battery1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
func (*Battery1) WatchProperties ¶
func (a *Battery1) WatchProperties() (chan *bluez.PropertyChanged, error)
WatchProperties updates on property changes
type Battery1Properties ¶
type Battery1Properties struct { /* Percentage The percentage of battery left as an unsigned 8-bit integer. */ Percentage byte // contains filtered or unexported fields }
Battery1Properties contains the exposed properties of an interface
func (*Battery1Properties) FromDBusMap ¶
func (a *Battery1Properties) FromDBusMap(props map[string]dbus.Variant) (*Battery1Properties, error)
FromDBusMap convert a map to an Battery1Properties
func (*Battery1Properties) FromMap ¶
func (a *Battery1Properties) FromMap(props map[string]interface{}) (*Battery1Properties, error)
FromMap convert a map to an Battery1Properties
func (*Battery1Properties) ToMap ¶
func (a *Battery1Properties) ToMap() (map[string]interface{}, error)
ToMap convert a Battery1Properties to map
func (*Battery1Properties) Unlock ¶
func (p *Battery1Properties) Unlock()
Unlock access to properties