Documentation ¶
Index ¶
- Constants
- func CoilsToBytes(rgc config.RegisterGroupConfig, values []bool) []byte
- func FrameToBytes(frm can.Frame) []byte
- func RegistersToBytes(rgc config.RegisterGroupConfig, values []uint16) []byte
- func StartBytes(slave uint8, functionCode uint16, address uint16, ...) []byte
- type CanBusConnector
- type Connector
- type HttpConnector
- type LineConnector
- type ModbusClient
- type ModbusConnector
- type UdpListenerConnection
Constants ¶
View Source
const MaximumNumberOfCoils = 2000
View Source
const MaximumNumberOfRegisters = 125
MaximumNumberOfRegisters is maximum number of registers that can be read in one request, a modbus message is limit to 256 bytes TODO: this should be checked when register groups are created
Variables ¶
This section is empty.
Functions ¶
func CoilsToBytes ¶
func CoilsToBytes(rgc config.RegisterGroupConfig, values []bool) []byte
func FrameToBytes ¶
func RegistersToBytes ¶
func RegistersToBytes(rgc config.RegisterGroupConfig, values []uint16) []byte
Types ¶
type CanBusConnector ¶
type CanBusConnector struct {
// contains filtered or unexported fields
}
func NewCanBusConnector ¶
func NewCanBusConnector(c *config.ConnectorConfig) (*CanBusConnector, error)
func (*CanBusConnector) Publish ¶
func (r *CanBusConnector) Publish(publisher mangos.Socket)
func (*CanBusConnector) Subscribe ¶
func (*CanBusConnector) Subscribe(subscriber mangos.Socket)
type Connector ¶
type Connector interface { Publish(publisher mangos.Socket) Subscribe(subscriber mangos.Socket) }
Connector interface
type HttpConnector ¶
type HttpConnector struct {
// contains filtered or unexported fields
}
func NewHttpConnector ¶
func NewHttpConnector(c *config.ConnectorConfig, ugc []config.UrlGroupConfig) (*HttpConnector, error)
func (*HttpConnector) Publish ¶
func (r *HttpConnector) Publish(publisher mangos.Socket)
func (*HttpConnector) Subscribe ¶
func (*HttpConnector) Subscribe(subscriber mangos.Socket)
type LineConnector ¶
type LineConnector struct {
// contains filtered or unexported fields
}
LineConnector reads lines from the connection and sends it on the mangos socket
func NewLineConnector ¶
func NewLineConnector(c *config.ConnectorConfig) (*LineConnector, error)
func (*LineConnector) Publish ¶
func (r *LineConnector) Publish(publisher mangos.Socket)
func (*LineConnector) Subscribe ¶
func (r *LineConnector) Subscribe(subscriber mangos.Socket)
type ModbusClient ¶
type ModbusClient struct {
// contains filtered or unexported fields
}
func (*ModbusClient) Poll ¶
func (m *ModbusClient) Poll(stream chan<- []byte, rgc config.RegisterGroupConfig) error
func (*ModbusClient) Read ¶
func (m *ModbusClient) Read(rgc config.RegisterGroupConfig) ([]byte, error)
type ModbusConnector ¶
type ModbusConnector struct {
// contains filtered or unexported fields
}
func NewModbusConnector ¶
func NewModbusConnector(c *config.ConnectorConfig, rgcs []config.RegisterGroupConfig) (*ModbusConnector, error)
func (*ModbusConnector) Publish ¶
func (m *ModbusConnector) Publish(publisher mangos.Socket)
func (*ModbusConnector) Subscribe ¶
func (c *ModbusConnector) Subscribe(subscriber mangos.Socket)
type UdpListenerConnection ¶
type UdpListenerConnection struct {
// contains filtered or unexported fields
}
UdpListenerConnection implements the io.ReadWriter interface
Click to show internal directories.
Click to hide internal directories.