Documentation ¶
Index ¶
- Constants
- type BaseResponse
- type DevCommandConfig
- type DevCommandRequest
- type DevCommandResponse
- type DevModBusRequest
- type DevModBusResponse
- type DevModBusRtuConfig
- type DevModBusTcpConfig
- type DevMqttConfig
- type DevMqttRequest
- type DevSmartBusConfig
- type DevSmartBusRequest
- type DevSmartBusResponse
Constants ¶
View Source
const ( DevTypeModbusRtu = DeviceType("modbus_rtu") DevTypeModbusTcp = DeviceType("modbus_tcp") // bit access ReadCoils = "ReadCoils" ReadDiscreteInputs = "ReadDiscreteInputs" WriteSingleCoil = "WriteSingleCoil" WriteMultipleCoils = "WriteMultipleCoils" // 16-bit access ReadInputRegisters = "ReadInputRegisters" ReadHoldingRegisters = "ReadHoldingRegisters" ReadWriteMultipleRegisters = "ReadWriteMultipleRegisters" WriteSingleRegister = "WriteSingleRegister" WriteMultipleRegisters = "WriteMultipleRegisters" )
View Source
const (
DevTypeCommand = DeviceType("command")
)
View Source
const (
DevTypeDefault = DeviceType("default")
)
View Source
const (
DevTypeMqtt = DeviceType("mqtt")
)
View Source
const (
DevTypeSmartBus = DeviceType("smartbus")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type DevCommandConfig ¶
type DevCommandConfig struct {
Validation
}
type DevCommandRequest ¶
type DevCommandResponse ¶
type DevCommandResponse struct { BaseResponse Result string `json:"result"` }
type DevModBusRequest ¶
type DevModBusResponse ¶
type DevModBusResponse struct { BaseResponse Result []uint16 `json:"result"` }
params: result error time
type DevModBusRtuConfig ¶ added in v0.0.19
type DevModBusRtuConfig struct { Validation SlaveId int `json:"slave_id" mapstructure:"slave_id"` // 1-32 Baud int `json:"baud"` // 9600, 19200, ... DataBits int `json:"data_bits" mapstructure:"data_bits"` // 5-9 StopBits int `json:"stop_bits" mapstructure:"stop_bits"` // 1, 2 Parity string `json:"parity"` // none, odd, even Timeout int `json:"timeout"` // milliseconds }
type DevModBusTcpConfig ¶ added in v0.0.19
type DevMqttConfig ¶ added in v0.0.19
type DevMqttRequest ¶ added in v0.0.19
type DevSmartBusConfig ¶
type DevSmartBusRequest ¶
type DevSmartBusRequest struct {
Command []byte `json:"command"`
}
type DevSmartBusResponse ¶
type DevSmartBusResponse struct { BaseResponse Result []byte `json:"result"` }
Click to show internal directories.
Click to hide internal directories.