collector

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Coils = iota + 1
	DiscreteInputs
	HoldingRegisters
	InputRegisters
)
View Source
const MaximumNumberOfRegisters = 120

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

This section is empty.

Types

type Collector

type Collector interface {
	Collect(publisher mangos.Socket)
}

Collector interface

type LineReader

type LineReader struct {
	// contains filtered or unexported fields
}

LineReader reads lines from the connection and sends it on the mangos socket

func NewLineReader

func NewLineReader(c *config.CollectorConfig) (*LineReader, error)

func (*LineReader) Collect

func (l *LineReader) Collect(publisher 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(slave uint8, functionCode uint16, address uint16, numberOfRegisters uint16) ([]byte, error)

type ModbusReader

type ModbusReader struct {
	// contains filtered or unexported fields
}

func (*ModbusReader) Collect

func (m *ModbusReader) Collect(publisher mangos.Socket)

type UdpListenerReader

type UdpListenerReader struct {
	// contains filtered or unexported fields
}

UdpListenerReader implements the io.Reader interface

func (UdpListenerReader) Read

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

Jump to

Keyboard shortcuts

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