Documentation ¶
Index ¶
- Constants
- func FetchEndpoint(protocols map[string]models.ProtocolProperties) (string, errors.EdgeX)
- func NewProtocolDriver() interfaces.ProtocolDriver
- type Driver
- func (d *Driver) AddDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) Discover() 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(sdk interfaces.DeviceServiceSDK) error
- func (d *Driver) RemoveDevice(deviceName string, protocols map[string]models.ProtocolProperties) error
- func (d *Driver) Start() error
- func (d *Driver) Stop(force bool) error
- func (d *Driver) UpdateDevice(deviceName string, protocols map[string]models.ProtocolProperties, ...) error
- func (d *Driver) ValidateDevice(device models.Device) error
- type OPCUAServerConfig
- type ServiceConfig
- type WritableInfo
Constants ¶
const ( // CustomConfigSectionName is the name of the configuration options // section in /cmd/res/configuration.toml CustomConfigSectionName = "OPCUAServer" // WritableInfoSectionName is the Writable section key WritableInfoSectionName = CustomConfigSectionName + "/Writable" )
const ( // NODE id attribute NODE = "nodeId" // OBJECT node id attribute OBJECT = "objectId" // METHOD node id attribute METHOD = "methodId" // INPUTMAP attribute INPUTMAP = "inputMap" )
const ( // Protocol is the supported device protocol Protocol = "opcua" // Endpoint is a constant string Endpoint = "Endpoint" )
Variables ¶
This section is empty.
Functions ¶
func FetchEndpoint ¶
FetchEndpoint returns the OPCUA endpoint defined in the configuration
func NewProtocolDriver ¶
func NewProtocolDriver() interfaces.ProtocolDriver
NewProtocolDriver returns a new protocol driver object
Types ¶
type Driver ¶
type Driver struct { Logger logger.LoggingClient AsyncCh chan<- *sdkModel.AsyncValues // contains filtered or unexported fields }
Driver struct
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) HandleReadCommands ¶
func (d *Driver) HandleReadCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest) ([]*sdkModel.CommandValue, error)
HandleReadCommands triggers a protocol Read operation for the specified device.
func (*Driver) HandleWriteCommands ¶
func (d *Driver) HandleWriteCommands(deviceName string, protocols map[string]models.ProtocolProperties, reqs []sdkModel.CommandRequest, params []*sdkModel.CommandValue) error
HandleWriteCommands passes a slice of CommandRequest struct each representing a ResourceOperation for a specific device resource (aka DeviceObject). Since the commands are actuation commands, params provide parameters for the individual command.
func (*Driver) Initialize ¶
func (d *Driver) Initialize(sdk interfaces.DeviceServiceSDK) error
Initialize performs protocol-specific initialization for the device service
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 OPCUAServerConfig ¶
type OPCUAServerConfig struct { DeviceName string Policy string Mode string CertFile string KeyFile string Writable WritableInfo }
OPCUAServerConfig server information defined by the device profile
func (*OPCUAServerConfig) Validate ¶
func (info *OPCUAServerConfig) Validate() errors.EdgeX
Validate ensures your custom configuration has proper values.
type ServiceConfig ¶
type ServiceConfig struct {
OPCUAServer OPCUAServerConfig
}
ServiceConfig configuration struct
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 {
Resources string
}
WritableInfo configuration data that can be written without restarting the service