Struct sawp_modbus::Message [−][src]
pub struct Message { pub transaction_id: u16, pub protocol_id: u16, pub unit_id: u8, pub function: Function, pub access_type: Flags<AccessType>, pub category: Flags<CodeCategory>, pub data: Data, pub error_flags: Flags<ErrorFlags>, // some fields omitted }
Expand description
Breakdown of the parsed modbus bytes
Fields
transaction_id: u16
protocol_id: u16
unit_id: u8
function: Function
access_type: Flags<AccessType>
category: Flags<CodeCategory>
data: Data
error_flags: Flags<ErrorFlags>
Implementations
Matches this message with another. Used to validate requests with responses.
Gets the register/coil/input value at the given address, if it has been modified in the transaction. Returns the value as Some(u16) if it is found, otherwise returns None. The address passed in must be offset by 1 to reflect the actual coil/register and not the address found in the PDU. See the protocol reference for more information on addresses.
Gets the address and quantity in the read/write data. If the data does not match and they can’t be found, None is returned. The range returned is offset by 1 to account to reflect the coils/registers that start at 1 instead of in the PDU numbers where they start at 0. More details can be found in the protocol reference
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Message
impl UnwindSafe for Message