Documentation ¶
Index ¶
- Constants
- func CreateDriverConfig(configMap map[string]string) (*configuration, error)
- func NewProtocolDriver() sdkModel.ProtocolDriver
- type Config
- type ConnectionInfo
- 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 ¶
View Source
const ( Protocol = "mqtt" Schema = "Schema" Host = "Host" Port = "Port" User = "User" Password = "Password" ClientId = "ClientId" Topic = "Topic" // Driver config IncomingSchema = "IncomingSchema" IncomingHost = "IncomingHost" IncomingPort = "IncomingPort" IncomingUser = "IncomingUser" IncomingPassword = "IncomingPassword" IncomingQos = "IncomingQos" IncomingKeepAlive = "IncomingKeepAlive" IncomingClientId = "IncomingClientId" IncomingTopic = "IncomingTopic" ResponseSchema = "ResponseSchema" ResponseHost = "ResponseHost" ResponsePort = "ResponsePort" ResponseUser = "ResponseUser" ResponsePassword = "ResponsePassword" ResponseQos = "ResponseQos" ResponseKeepAlive = "ResponseKeepAlive" ResponseClientId = "ResponseClientId" ResponseTopic = "ResponseTopic" ConnEstablishingRetry = "ConnEstablishingRetry" ConnRetryWaitTime = "ConnRetryWaitTime" )
Variables ¶
This section is empty.
Functions ¶
func CreateDriverConfig ¶
CreateDriverConfig use to load driver config for incoming listener and response listener
func NewProtocolDriver ¶
func NewProtocolDriver() sdkModel.ProtocolDriver
Types ¶
type ConnectionInfo ¶
type ConnectionInfo struct { Schema string Host string Port string User string Password string ClientId string Topic string }
func CreateConnectionInfo ¶
func CreateConnectionInfo(protocols map[string]models.ProtocolProperties) (*ConnectionInfo, error)
CreateConnectionInfo use to load MQTT connectionInfo for read and write command
type Driver ¶
type Driver struct { Logger logger.LoggingClient AsyncCh chan<- *sdkModel.AsyncValues CommandResponses sync.Map Config *configuration }
func (*Driver) AddDevice ¶ added in v1.1.0
func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
func (*Driver) DisconnectDevice ¶
func (*Driver) HandleReadCommands ¶
func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest) ([]*sdkModel.CommandValue, error)
func (*Driver) HandleWriteCommands ¶
func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest, params []*sdkModel.CommandValue) error
func (*Driver) Initialize ¶
func (d *Driver) Initialize(lc logger.LoggingClient, asyncCh chan<- *sdkModel.AsyncValues, deviceCh chan<- []sdkModel.DiscoveredDevice) error
func (*Driver) RemoveDevice ¶ added in v1.1.0
func (*Driver) UpdateDevice ¶ added in v1.1.0
func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, adminState models.AdminState) error
Click to show internal directories.
Click to hide internal directories.