Documentation ¶
Overview ¶
This package provides a implementation of a ProtocolDriver interface.
Index ¶
- Constants
- func NewVirtualDeviceDriver() dsModels.ProtocolDriver
- type VirtualDriver
- func (d *VirtualDriver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *VirtualDriver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) (res []*dsModels.CommandValue, err error)
- func (d *VirtualDriver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *VirtualDriver) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues, ...) error
- func (d *VirtualDriver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (d *VirtualDriver) Stop(force bool) error
- func (d *VirtualDriver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
Constants ¶
View Source
const ( SqlDropTable = "DROP TABLE IF EXISTS VIRTUAL_RESOURCE;" SqlCreateTable = "" /* 160-byte string literal not displayed */ SqlSelect = "" /* 168-byte string literal not displayed */ SqlInsert = "INSERT INTO VIRTUAL_RESOURCE VALUES ($1, $2, $3, $4, $5, $6);" SqlUpdateRandomization = "UPDATE VIRTUAL_RESOURCE SET ENABLE_RANDOMIZATION=$1 WHERE DEVICE_NAME==$2 AND DEVICE_RESOURCE_NAME==$3;" SqlUpdateValue = "UPDATE VIRTUAL_RESOURCE SET VALUE=$1 WHERE DEVICE_NAME==$2 AND DEVICE_RESOURCE_NAME==$3;" SqlUpdateValueAndDisableRandomization = "UPDATE VIRTUAL_RESOURCE SET VALUE=$1, ENABLE_RANDOMIZATION=false WHERE DEVICE_NAME==$2 AND DEVICE_RESOURCE_NAME==$3;" SqlDelete = "DELETE FROM VIRTUAL_RESOURCE WHERE DEVICE_NAME==$1" )
Variables ¶
This section is empty.
Functions ¶
func NewVirtualDeviceDriver ¶
func NewVirtualDeviceDriver() dsModels.ProtocolDriver
Types ¶
type VirtualDriver ¶
type VirtualDriver struct {
// contains filtered or unexported fields
}
func (*VirtualDriver) AddDevice ¶
func (d *VirtualDriver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
func (*VirtualDriver) HandleReadCommands ¶
func (d *VirtualDriver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []dsModels.CommandRequest) (res []*dsModels.CommandValue, err error)
func (*VirtualDriver) HandleWriteCommands ¶
func (d *VirtualDriver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []dsModels.CommandRequest, params []*dsModels.CommandValue) error
func (*VirtualDriver) Initialize ¶
func (d *VirtualDriver) Initialize(lc logger.LoggingClient, asyncCh chan<- *dsModels.AsyncValues, deviceCh chan<- []dsModels.DiscoveredDevice) error
func (*VirtualDriver) RemoveDevice ¶
func (d *VirtualDriver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
func (*VirtualDriver) Stop ¶
func (d *VirtualDriver) Stop(force bool) error
func (*VirtualDriver) UpdateDevice ¶
func (d *VirtualDriver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
Click to show internal directories.
Click to hide internal directories.