modbus_rtu/common/
exception.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2#[repr(u8)]
3pub enum Exception {
4    /// An undefined exception code not covered by this crate.
5    Undefined(u8),
6
7    /// The function code received is not supported by the device or is invalid in the current state.
8    IllegalFunction = 0x01,
9
10    /// The requested address range is invalid for the device.
11    IllegalDataAddress = 0x02,
12
13    /// A value in the request is not valid or does not match the expected structure.
14    IllegalDataValue = 0x03,
15
16    /// An unrecoverable device error occurred during processing.
17    DeviceFailure = 0x04,
18
19    /// The request was accepted but requires a long time to complete. Prevents master timeout.
20    Acknowledge = 0x05,
21
22    /// The device is busy processing a long-duration command. Try again later.
23    DeviceBusy = 0x06,
24
25    /// The gateway could not establish a communication path. Check configuration or load.
26    GatewayPathUnavailable = 0x0A,
27
28    /// The gateway received no response from the target device.
29    GatewayTargetDeviceFailedToRespond = 0x0B,
30}