modbus_codec 0.1.2 copy "modbus_codec: ^0.1.2" to clipboard
modbus_codec: ^0.1.2 copied to clipboard

Transport-agnostic Modbus RTU codec for Dart. Encode request frames and decode raw response bytes into typed values over BLE, serial, or TCP.

0.1.2 #

  • Rewrote README and library doc for BLE/mobile audience — send/receive examples, plain-language tables, no protocol jargon.
  • Added address-range overflow check: encoder throws when startAddress + quantity - 1 > 0xFFFF.
  • ModbusConvert.combine32 now uses multiplication instead of bit-shift for correct behaviour on dart2js.
  • Decoder enforces minimum write-response frame length (8 bytes) before decoding FC 05/06/15/16.

0.1.1 #

  • Input validation for slaveId, address, and quantity limits on all function codes.
  • ReadBitsResponse now returns all byteCount * 8 bits; caller slices to request quantity.
  • Decoder throws ModbusFrameException on malformed frames instead of crashing.
  • ModbusConvert guards for non-ASCII input, negative scale factor, and padToRegisters overflow.

0.1.0 #

Initial release.

  • ModbusEncoder for building RTU request frames: read coils / discrete inputs / holding registers / input registers (FC 01–04), and write single & multiple coils / registers (FC 05, 06, 15, 16).
  • ModbusDecoder for parsing RTU response bytes into typed responses (ReadRegistersResponse, ReadBitsResponse, WriteSingleResponse, WriteMultipleResponse), with optional CRC validation.
  • Crc16Modbus — CRC-16/MODBUS compute, byte generation, and validation.
  • ModbusConvert helpers: signed 16/32-bit, 32-bit register pairing with selectable word order, fixed-point scaling, and packed-ASCII encode/decode.
  • ModbusDeviceException / ModbusFrameException for device-reported errors and malformed frames.
  • Zero runtime dependencies; pure Dart.
3
likes
0
points
209
downloads

Publisher

verified publisheranwinkp.online

Weekly Downloads

Transport-agnostic Modbus RTU codec for Dart. Encode request frames and decode raw response bytes into typed values over BLE, serial, or TCP.

Repository (GitHub)
View/report issues

Topics

#modbus #rtu #protocol #serial #ble

License

unknown (license)

More

Packages that depend on modbus_codec