Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func (*Connector) AddDevice ¶
func (c *Connector) AddDevice(sn, ip string, port int, slaveID uint8, quantity uint16, option RegisterOption) error
AddDevice 添加设备 sn 设备唯一编号 ip 气体传感器ip port 其它传感器port quantity 读取的寄存器数量
func (*Connector) GetValChan ¶
func (*Connector) Initialize ¶
func (*Connector) RemoveDevice ¶
RemoveDevice 移除气体检测设备
type ModbusReader ¶ added in v1.2.1
type ModbusReader interface {
Read(client *modbus.ModbusClient, d *modbusDevice) ([]float64, error)
Type() SensorType
}
type RegisterOption ¶ added in v1.2.0
type RegisterOption struct {
ValueAddress uint16
AccuracyAddress uint16
Type SensorType
}
type SensorType ¶
type SensorType = uint8
const ( GasType SensorType = 0x00 TempType SensorType = 0x10 )
Click to show internal directories.
Click to hide internal directories.