StaticfromCreates a Layer providing SerialTransportService backed by an ASCII transport.
StaticfromCreates a Layer providing SerialTransportService backed by an RTU transport.
StaticmakeCreates a mock Layer that provides SerialTransportService for tests or development.
The devices parameter is an array of SlaveDeviceDefinition. Each
definition gives the coil map and the register map of one simulated slave.
The option set is the same as the option set of the concrete tags. Thus a
test that keeps the framing abstract can also set retry, reconnect,
fault, and reconnectFault.
The slave device definitions for the mock.
A function that takes the mock options and gives a scoped Layer that provides the mock service.
Abstract serial Modbus transport service tag.
Represents a serial (RS-232/485) Modbus transport backed by either ASCII or RTU framing. Use this tag when you need a serial transport but don't care about the specific framing protocol.
Consumers
yield* SerialTransportServiceto obtain a TransportServiceApi and satisfy the tag via one of the static provider methods: