Expand description
Request frame encoders — one free function per Modbus function code.
Each function accepts user-supplied parameters plus the transaction id
assigned by the task, builds the corresponding PDU via mbus_core helpers,
and wraps it into a complete ADU frame ready to hand to AsyncTransport::send.
§Conventions
- All functions return
Result<Vec<u8, MAX_ADU_FRAME_LEN>, MbusError>. txn_idis always the task-assigned identifier; callers never pick it.unitis theUnitIdOrSlaveAddralready validated before this point.- Broadcast reads are rejected at the
client_corelayer; no guards here.
Functions§
- encode_
request - Encodes a
ClientRequestinto a complete ADU frame using the giventxn_id.