Documentation ¶
Index ¶
- func GetSoundData(index int) []byte
- func GetcurrentSoundIndex() int
- func NewProtocolDriver() sdkModel.ProtocolDriver
- type Driver
- func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) DisconnectDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) ([]*sdkModel.CommandValue, error)
- func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *sdkModel.AsyncValues, ...) error
- func (d *Driver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (d *Driver) Stop(force bool) error
- func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSoundData ¶
GetSoundData - get the data for specific sound
func GetcurrentSoundIndex ¶
func GetcurrentSoundIndex() int
GetcurrentSoundIndex - returs the current index of the sound
func NewProtocolDriver ¶
func NewProtocolDriver() sdkModel.ProtocolDriver
NewProtocolDriver creates a new driver
Types ¶
type Driver ¶
type Driver struct { Logger logger.LoggingClient AsyncCh chan<- *sdkModel.AsyncValues CommandResponses sync.Map }
Driver the driver sructure
func (*Driver) AddDevice ¶
func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
AddDevice is a callback function that is invoked when a new Device associated with this Device Service is added
func (*Driver) DisconnectDevice ¶
func (d *Driver) DisconnectDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
DisconnectDevice disconnect
func (*Driver) HandleReadCommands ¶
func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest) ([]*sdkModel.CommandValue, error)
HandleReadCommands executes a oommand
func (*Driver) HandleWriteCommands ¶
func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest, params []*sdkModel.CommandValue) error
HandleWriteCommands write command
func (*Driver) Initialize ¶
func (d *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *sdkModel.AsyncValues, deviceCh chan<- []sdkModel.DiscoveredDevice) error
Initialize the device
func (*Driver) RemoveDevice ¶
func (d *Driver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
RemoveDevice is a callback function that is invoked when a Device associated with this Device Service is removed
func (*Driver) Stop ¶
Stop the protocol-specific DS code to shutdown gracefully, or if the force parameter is 'true', immediately. The driver is responsible for closing any in-use channels, including the channel used to send async readings (if supported).
func (*Driver) UpdateDevice ¶
func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
UpdateDevice is a callback function that is invoked when a Device associated with this Device Service is updated