connector

package
v0.1.77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 FrameToBytes(frm can.Frame) []byte

func RegistersToBytes

func RegistersToBytes(rgc config.RegisterGroupConfig, values []uint16) []byte

func StartBytes

func StartBytes(slave uint8, functionCode uint16, address uint16, numberOfCoilsOrRegisters 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 (*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 (*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

func (UdpListenerConnection) Read

func (u UdpListenerConnection) Read(p []byte) (n int, err error)

func (UdpListenerConnection) Write

func (u UdpListenerConnection) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL