modbus

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simulator

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

Simulator is a minimal Modbus TCP server for protocol-level integration tests.

func StartSimulator

func StartSimulator(t *testing.T) *Simulator

StartSimulator listens on an ephemeral port and serves holding registers per unit ID.

func (*Simulator) BlockSlave

func (s *Simulator) BlockSlave(unitID uint8, blocked bool)

func (*Simulator) SeedHolding

func (s *Simulator) SeedHolding(unitID uint8, values ...uint16)

func (*Simulator) SetLatency

func (s *Simulator) SetLatency(unitID uint8, d time.Duration)

func (*Simulator) URL

func (s *Simulator) URL() string

Jump to

Keyboard shortcuts

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