Documentation
¶
Index ¶
- Constants
- func GetCredentials(secretPath string) (config.Credentials, error)
- func NewProtocolDriver() sdkModel.ProtocolDriver
- func SetCredentials(uri *url.URL, category string, authMode string, secretPath string) error
- func SetCredentialsNonSecureTemp(uri *url.URL, category string, authMode string, username string, ...) error
- type BoolData
- 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
- type IntData
- type MQTTBrokerInfo
- type ServiceConfig
- type WritableInfo
Constants ¶
const ( Protocol = "mqtt" CommandTopic = "CommandTopic" )
Constants related to protocol properties
const ( AuthModeUsernamePassword = "usernamepassword" AuthModeNone = "none" )
Constants related to MQTT security
const ( CustomConfigSectionName = "MQTTBrokerInfo" WritableInfoSectionName = CustomConfigSectionName + "/Writable" )
Constants related to custom configuration
Variables ¶
This section is empty.
Functions ¶
func GetCredentials ¶
func GetCredentials(secretPath string) (config.Credentials, error)
func NewProtocolDriver ¶
func NewProtocolDriver() sdkModel.ProtocolDriver
func SetCredentials ¶
Types ¶
type Driver ¶
type Driver struct { Logger logger.LoggingClient AsyncCh chan<- *sdkModel.AsyncValues CommandResponses sync.Map // contains filtered or unexported fields }
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 (*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 ¶
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
type MQTTBrokerInfo ¶
type MQTTBrokerInfo struct { Schema string Host string Port int Qos int KeepAlive int ClientId string CredentialsRetryTime int CredentialsRetryWait int ConnEstablishingRetry int ConnRetryWaitTime int AuthMode string CredentialsPath string // Temp fields Username string Password string IncomingTopic string ResponseTopic string Writable WritableInfo }
func (*MQTTBrokerInfo) Validate ¶
func (info *MQTTBrokerInfo) Validate() errors.EdgeX
Validate ensures your custom configuration has proper values.
type ServiceConfig ¶
type ServiceConfig struct {
MQTTBrokerInfo MQTTBrokerInfo
}
func (*ServiceConfig) UpdateFromRaw ¶
func (sw *ServiceConfig) UpdateFromRaw(rawConfig interface{}) bool
UpdateFromRaw updates the service's full configuration from raw data received from the Service Provider.
type WritableInfo ¶
type WritableInfo struct { // ResponseFetchInterval specifies the retry interval(milliseconds) to fetch the command response from the MQTT broker ResponseFetchInterval int }