Skip to main content

parse_request

Function parse_request 

Source
pub fn parse_request(pdu: &[u8]) -> Result<ModbusRequest, u8>
Expand description

Decode a PDU.

The error carries the exception code the specification prescribes, which the caller answers with directly — no model round-trip, because none of these is a decision: an unknown function code is always 0x01, a quantity of 0 is always 0x03.