collector

package
v0.1.46 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 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 added in v0.1.9

func CoilsToBytes(rgc config.RegisterGroupConfig, values []bool) []byte

func FrameToBytes added in v0.1.26

func FrameToBytes(frm can.Frame) []byte

func RegistersToBytes added in v0.1.9

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

func StartBytes added in v0.1.9

func StartBytes(slave uint8, functionCode uint16, address uint16, numberOfCoilsOrRegisters uint16) []byte

Types

type CanBusCollector added in v0.1.26

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

func NewCanBusCollector added in v0.1.26

func NewCanBusCollector(c *config.CollectorConfig) (*CanBusCollector, error)

func (*CanBusCollector) Collect added in v0.1.26

func (r *CanBusCollector) Collect(publisher mangos.Socket)

type Collector

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

Collector interface

type HttpCollector added in v0.1.43

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

func NewHttpCollector added in v0.1.43

func NewHttpCollector(c *config.CollectorConfig, ugc []config.UrlGroupConfig) (*HttpCollector, error)

func (*HttpCollector) Collect added in v0.1.43

func (r *HttpCollector) Collect(publisher mangos.Socket)

type LineCollector added in v0.1.24

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

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

func NewLineCollector added in v0.1.24

func NewLineCollector(c *config.CollectorConfig) (*LineCollector, error)

func (*LineCollector) Collect added in v0.1.24

func (r *LineCollector) 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(rgc config.RegisterGroupConfig) ([]byte, error)

type ModbusCollector added in v0.1.24

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

func NewModbusCollector added in v0.1.24

func NewModbusCollector(c *config.CollectorConfig, rgcs []config.RegisterGroupConfig) (*ModbusCollector, error)

func (*ModbusCollector) Collect added in v0.1.24

func (r *ModbusCollector) 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