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: u16protocol_id: u16unit_id: u8function: Functionaccess_type: Flags<AccessType>category: Flags<CodeCategory>data: Dataerror_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

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.