Documentation ¶
Overview ¶
Package driver this package provides an GPIO implementation of ProtocolDriver interface.
Package driver this package provides an GPIO implementation of ProtocolDriver interface.
Package driver this package provides an GPIO implementation of ProtocolDriver interface.
Package driver this package provides an GPIO implementation of ProtocolDriver interface.
Index ¶
- Constants
- type Driver
- func (s *Driver) AddDevice(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
- func (s *Driver) HandleReadCommands(deviceName string, protocols map[string]contract.ProtocolProperties, ...) (res []*dsModels.CommandValue, err error)
- func (s *Driver) HandleWriteCommands(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
- func (s *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues, ...) error
- func (s *Driver) RemoveDevice(deviceName string, protocols map[string]contract.ProtocolProperties) error
- func (s *Driver) Stop(force bool) error
- func (s *Driver) UpdateDevice(deviceName string, protocols map[string]contract.ProtocolProperties, ...) error
Constants ¶
const ( ABI_DRIVER = "Interface" CHIP_SELECTED = "ChipSelected" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) AddDevice ¶
func (s *Driver) AddDevice(deviceName string, protocols map[string]contract.ProtocolProperties, adminState contract.AdminState) error
AddDevice is a callback function that is invoked when a new Device associated with this Device Service is added
func (*Driver) HandleReadCommands ¶
func (s *Driver) HandleReadCommands(deviceName string, protocols map[string]contract.ProtocolProperties, reqs []dsModels.CommandRequest) (res []*dsModels.CommandValue, err error)
HandleReadCommands triggers a protocol Read operation for the specified device.
func (*Driver) HandleWriteCommands ¶
func (s *Driver) HandleWriteCommands(deviceName string, protocols map[string]contract.ProtocolProperties, reqs []dsModels.CommandRequest, params []*dsModels.CommandValue) error
HandleWriteCommands passes a slice of CommandRequest struct each representing a ResourceOperation for a specific device resource. Since the commands are actuation commands, params provide parameters for the individual command.
func (*Driver) Initialize ¶
func (s *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues, deviceCh chan<- []dsModels.DiscoveredDevice) error
Initialize performs protocol-specific initialization for the device service.
func (*Driver) RemoveDevice ¶
func (s *Driver) RemoveDevice(deviceName string, protocols map[string]contract.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 (s *Driver) UpdateDevice(deviceName string, protocols map[string]contract.ProtocolProperties, adminState contract.AdminState) error
UpdateDevice is a callback function that is invoked when a Device associated with this Device Service is updated