StaticfromCreates a Layer providing WasmSerialTransportService backed by an ASCII transport.
StaticfromCreates a Layer providing WasmSerialTransportService backed by an RTU transport.
StaticmakeCreates a mock Layer that provides WasmSerialTransportService 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 browser (WASM) serial Modbus transport service tag.
Represents a Web Serial-based Modbus transport backed by either ASCII or RTU framing. Use this tag when you need a browser serial transport but don't care about the specific framing protocol.
Consumers
yield* WasmSerialTransportServiceto obtain a TransportServiceApi and satisfy the tag via one of the static provider methods:See
requestSerialPort — Obtains the
porthandle both providers need (must be called from a user gesture).