Exception.h
Go to the documentation of this file.
1 
20 #pragma once
21 
22 #include <WString.h>
23 
24 namespace IO::Modbus
25 {
29 enum class Exception {
33  Success = 0x00,
34 
40  IllegalFunction = 0x01,
41 
55  IllegalDataAddress = 0x02,
56 
65  IllegalDataValue = 0x03,
66 
72  SlaveDeviceFailure = 0x04,
73 };
74 
75 inline bool operator!(Exception exception)
76 {
77  return exception == Exception::Success;
78 }
79 
80 } // namespace IO::Modbus
81 
String toString(IO::Modbus::Exception exception)
The String class.
Definition: WString.h:137
Definition: ADU.h:26
bool operator!(Exception exception)
Definition: Exception.h:75
Exception
Modbus exception codes returned in response packets.
Definition: Exception.h:29
@ IllegalDataValue
Data value not allowed.
@ Success
No exception, transaction completed normally.
@ IllegalFunction
Function not allowed/supported/implemented, or device in wrong state to process request.
@ SlaveDeviceFailure
Protocol slave device failure exception.
@ IllegalDataAddress
Data address not allowed.