Documentation ¶
Index ¶
- Constants
- type BridgeJson
- type BridgeProto
- type Dbus
- type Device
- func (d *Device) AddItem(itemID string, typeID string, typeVersion string, options []byte) (bool, *dbus.Error)
- func (d *Device) EmitDbusSignal(sigName string, args ...interface{})
- func (d *Device) RemoveItem(itemID string) *dbus.Error
- func (d *Device) SetCallbacks(cbs interface{})
- func (d *Device) SetDbusMethods(externalMethods map[string]interface{}) bool
- func (d *Device) SetDbusProperties(externalProperties map[string]*prop.Prop) bool
- func (d *Device) SetOperabilityState(state OperabilityState)
- func (d *Device) SetOption(options []byte)
- func (d *Device) SetPairingState(state PairingState)
- func (d *Device) SetVersion(newVersion string)
- func (d *Device) UpdateFirmware(data string) (string, *dbus.Error)
- type DeviceJson
- type Item
- func (i *Item) EmitDbusSignal(sigName string, args ...interface{})
- func (i *Item) SetCallbacks(cbs interface{})
- func (i *Item) SetDbusMethods(externalMethods map[string]interface{}) bool
- func (i *Item) SetDbusProperties(externalProperties map[string]*prop.Prop) bool
- func (i *Item) SetOption(options []byte)
- func (i *Item) SetValue(value []byte)
- type ItemJson
- type OperabilityState
- type PairingState
- type Protocol
- func (p *Protocol) AddDevice(devID string, comID string, typeID string, typeVersion string, options []byte) (bool, *dbus.Error)
- func (p *Protocol) EmitDbusSignal(sigName string, args ...interface{})
- func (p *Protocol) IsReady() (bool, *dbus.Error)
- func (p *Protocol) Ready()
- func (p *Protocol) RemoveDevice(devID string) *dbus.Error
- func (p *Protocol) SetDbusMethods(externalMethods map[string]interface{}) bool
- func (p *Protocol) SetDbusProperties(externalProperties map[string]*prop.Prop) bool
- func (p *Protocol) SetProtocolCBs(cbs interface{})
- func (p *Protocol) SetReachabilityState(state ReachabilityState)
- type ProtocolJson
- type ReachabilityState
- type RootProto
Constants ¶
const ( // OperabilityOk state 'ok' for OperabilityState OperabilityOk OperabilityState = "OK" // OperabilityPartial state 'partial' for OperabilityState OperabilityPartial OperabilityState = "PARTIAL" // OperabilityKo state 'Ko' for OperabilityState OperabilityKo OperabilityState = "KO" // OperabilityUnknown state 'unknown' for OperabilityState OperabilityUnknown OperabilityState = "UNKNOWN" // PairingOk state 'ok' for PairingState PairingOk PairingState = "OK" // PairingInProgres state 'in progress' for PairingState PairingInProgress PairingState = "IN_PROGRESS" // PairingKo state 'ko' for PairingState PairingKo PairingState = "KO" // PairingUnknown state 'unknown' for PairingState PairingUnknown PairingState = "UNKNOWN" // PairingNotNeeded state 'not needed' for PairingState PairingNotNeeded PairingState = "NOT_NEEDED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BridgeJson ¶
type BridgeProto ¶
type BridgeProto struct { Protocol *Protocol // contains filtered or unexported fields }
Protocol is a dbus object which represents the states of a bridge protocol
type Dbus ¶
type Dbus struct { RootProtocol RootProto Bridges map[string]*BridgeProto ProtocolName string Log *logging.Logger // contains filtered or unexported fields }
Dbus exported structure
type Device ¶
type Device struct { sync.Mutex Protocol *Protocol DevID string Address string TypeID string TypeVersion string Options []byte FirmwareVersion string Operability OperabilityState PairingState PairingState OperabilityTimeout time.Duration Items map[string]*Item // contains filtered or unexported fields }
Device object structure
func (*Device) AddItem ¶
func (d *Device) AddItem(itemID string, typeID string, typeVersion string, options []byte) (bool, *dbus.Error)
AddItem adds a new item to device
func (*Device) EmitDbusSignal ¶
EmitDbusSignal emit a dbus signal from device object
func (*Device) RemoveItem ¶
RemoveItem remove item from device
func (*Device) SetCallbacks ¶
func (d *Device) SetCallbacks(cbs interface{})
SetCallbacks set new callbacks for this device
func (*Device) SetDbusMethods ¶
SetDbusMethods set new dbusMethods for this device
func (*Device) SetDbusProperties ¶
SetDbusProperties set new DBus properties for this device
func (*Device) SetOperabilityState ¶
func (d *Device) SetOperabilityState(state OperabilityState)
SetOperabilityState set the value of the property OperabilityState
func (*Device) SetPairingState ¶
func (d *Device) SetPairingState(state PairingState)
SetPairingState set the value of the property PairingState
func (*Device) SetVersion ¶
SetVersion set the value of the property Version
func (*Device) UpdateFirmware ¶
UpdateFirmware is the dbus method to update the firmware of the device
type DeviceJson ¶
type Item ¶
type Item struct { Device *Device ItemID string Mac string TypeID string TypeVersion string Options []byte Target []byte Value []byte // contains filtered or unexported fields }
Item object structure
func (*Item) EmitDbusSignal ¶
EmitDbusSignal emit a dbus signal from item object
func (*Item) SetCallbacks ¶
func (i *Item) SetCallbacks(cbs interface{})
SetCallbacks set new callbacks for this item
func (*Item) SetDbusMethods ¶
SetDbusMethods set new dbusMethods for this Item
func (*Item) SetDbusProperties ¶
SetDbusProperties set new DBus properties for this item
type ItemJson ¶
type ItemJson struct { ItemID string `json:"itemID"` ItemTypeID string `json:"itemTypeID"` ItemTypeVersion string `json:"itemTypeVersion"` ItemOptions json.RawMessage `json:"itemOptions"` }
type Protocol ¶
type Protocol struct { BridgeID string Devices map[string]*Device Reachability ReachabilityState sync.Mutex // contains filtered or unexported fields }
Protocol is a dbus object which represents the states of a protocol
func (*Protocol) AddDevice ¶
func (p *Protocol) AddDevice(devID string, comID string, typeID string, typeVersion string, options []byte) (bool, *dbus.Error)
AddDevice is the dbus method to add a new device
func (*Protocol) EmitDbusSignal ¶
EmitDbusSignal emit a dbus signal from protocol object
func (*Protocol) Ready ¶
func (p *Protocol) Ready()
Ready set the Protocol object parameter "ready" to true
func (*Protocol) RemoveDevice ¶
RemoveDevice is the dbus method to remove a device
func (*Protocol) SetDbusMethods ¶
SetDbusMethods set new dbusMethods for this protocol
func (*Protocol) SetDbusProperties ¶
SetDbusProperties set new DBus properties for this protocol
func (*Protocol) SetProtocolCBs ¶
func (p *Protocol) SetProtocolCBs(cbs interface{})
SetProtocolCBs set new callbacks for this protocol
func (*Protocol) SetReachabilityState ¶
func (p *Protocol) SetReachabilityState(state ReachabilityState)
SetReachabilityState set the value of the property ReachabilityState
type ProtocolJson ¶
type ProtocolJson struct {
Protocols map[string][]DeviceJson `json:"Protocols"`
}
type ReachabilityState ¶
type ReachabilityState string
ReachabilityState informs if the device is reachable
const ( // ReachabilityOk state 'ok' for ReachabilityState ReachabilityOk ReachabilityState = "OK" // ReachabilityKo state 'ko' for ReachabilityState ReachabilityKo ReachabilityState = "KO" // ReachabilityUnknown state 'unknown' for ReachabilityState ReachabilityUnknown ReachabilityState = "UNKNOWN" )
type RootProto ¶
type RootProto struct { Protocol *Protocol // contains filtered or unexported fields }
RootProtocol is a dbus object which represents the states of the root protocol
func (*RootProto) RemoveBridge ¶
RemoveBridge is the dbus method to remove a bridge
func (*RootProto) SetRootProtocolCBs ¶
func (r *RootProto) SetRootProtocolCBs(cbs interface{})
SetRootProtocolCBs set new callbacks for this Root protocol