driver

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

This package provides a implementation of a ProtocolDriver interface.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL