client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientSettings added in v0.0.4

type ClientSettings interface {
	Endpoint() string
	ResponseTimeout() time.Duration
}

type ModbusClient

type ModbusClient interface {
	io.Closer
	// ReadCoils reads the status of coils in a remote device.
	ReadCoils(address, offset, quantity uint16) ([]bool, error)
	// ReadDiscreteInputs reads the status of discrete inputs in a remote device.
	ReadDiscreteInputs(address, offset, quantity uint16) ([]bool, error)
	// ReadHoldingRegisters reads the contents of holding registers in a remote device.
	ReadHoldingRegisters(address, offset, quantity uint16) ([]uint16, error)
	// ReadInputRegisters reads the contents of input registers in a remote device.
	ReadInputRegisters(address, offset, quantity uint16) ([]uint16, error)
	// WriteSingleCoil writes a single coil in a remote device.
	WriteSingleCoil(address, offset uint16, value bool) error
	// WriteSingleRegister writes a single holding register in a remote device.
	WriteSingleRegister(address, offset, value uint16) error
	// WriteMultipleCoils writes multiple coils in a remote device.
	WriteMultipleCoils(address, offset uint16, values []bool) error
	// WriteMultipleRegisters writes multiple holding registers in a remote device.
	WriteMultipleRegisters(address, offset uint16, values []uint16) error
}

ModbusClient defines the interface for a Modbus client.

func NewModbusClient

func NewModbusClient(ctx context.Context, logger *zap.Logger, transport transport.Transport) ModbusClient

NewModbusClient creates a new Modbus client.

Directories

Path Synopsis
rtu

Jump to

Keyboard shortcuts

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