No description
|
Jonas Jelonek
a9ede8be10
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>
|
||
|---|---|---|
| src | Wire up end-to-end ASCII read path | |
| .gitignore | initial commit with current state | |
| Cargo.lock | Wire up end-to-end ASCII read path | |
| Cargo.toml | initial commit with current state | |