1
0
Fork
You've already forked modio
0
No description
  • Rust 100%
Jonas Jelonek a9ede8be10
Wire up end-to-end ASCII read path
The transport layer already framed Modbus ASCII correctly, but nothing
above it was hooked up: ModbusRequest::as_bytes was a todo!(), the
client had no real round-trip method, and main.rs was scratch code that
didn't compile. This fills in the missing pieces so a basic FC1-FC4
read can actually go out on the wire and come back parsed.
- Give all four read variants {start, count} and implement as_bytes
 as the standard 5-byte FC1-FC4 PDU.
- Replace the broken send_request/receive_response pair with a single
 ModbusClient::request that sends, validates the echoed unit id,
 detects exception responses (fc | 0x80), and decodes register
 payloads as big-endian u16 pairs.
- Rewrite main.rs to open the port exactly once via
 connect_ascii_with_config (8E1, 1s timeout) and issue a real
 ReadHoldings request instead of the duplicate-open scratch code.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026年04月10日 20:01:23 +02:00
src Wire up end-to-end ASCII read path 2026年04月10日 20:01:23 +02:00
.gitignore initial commit with current state 2025年08月14日 11:24:33 +02:00
Cargo.lock Wire up end-to-end ASCII read path 2026年04月10日 20:01:23 +02:00
Cargo.toml initial commit with current state 2025年08月14日 11:24:33 +02:00