My Project
|
Asynchronous Modbus library. More...
Classes | |
class | ExceptionStatusResponse |
Exception status response message. More... | |
class | RegisterDataResponse |
Register data response message. More... | |
class | RegisterRequest |
Request message for register functions. More... | |
class | RegisterWriteResponse |
Register write response message. More... | |
class | Request |
Request message. More... | |
class | Response |
Response message. More... | |
class | SerialClient |
Serial client used to process requests. More... | |
Typedefs | |
using | frame_buffer_t = std::array< uint8_t, MAX_MESSAGE_SIZE+1 > |
Enumerations | |
enum | DeviceAddressType : uint8_t { BROADCAST = 0, MIN_UNICAST = 1, MAX_UNICAST = 247 } |
Device address types. More... | |
enum | FunctionCode : uint8_t { READ_HOLDING_REGISTERS = 0x03, READ_INPUT_REGISTERS = 0x04, WRITE_SINGLE_REGISTER = 0x06, READ_EXCEPTION_STATUS = 0x07 } |
Function codes. More... | |
enum | ResponseStatus : uint8_t { QUEUED, TRANSMIT, WAITING, SUCCESS, EXCEPTION, FAILURE_INVALID, FAILURE_CRC, FAILURE_TIMEOUT, FAILURE_TOO_SHORT, FAILURE_TOO_LONG, FAILURE_ADDRESS, FAILURE_FUNCTION, FAILURE_LENGTH, FAILURE_UNEXPECTED } |
Status of response messages. More... | |
Variables | |
const uuid::log::Logger | logger {reinterpret_cast<const __FlashStringHelper *>(__pstr__loggername), uuid::log::Facility::DAEMON} |
constexpr uint16_t | MAX_MESSAGE_SIZE = 256 |
constexpr uint16_t | MESSAGE_HEADER_SIZE = 2 |
constexpr uint16_t | MESSAGE_CRC_SIZE = 2 |
constexpr uint32_t | INTER_FRAME_TIMEOUT_MS = 5 |
Timeout between frames (in milliseconds). More... | |
constexpr uint16_t | DEFAULT_UNICAST_TIMEOUT_MS = 10000 |
constexpr uint16_t | DEFAULT_BROADCAST_TIMEOUT_MS = 1000 |
Asynchronous Modbus library.
Provides a client for communication using the Modbus protocol. This library is for single threaded applications and cannot be used from an interrupt context.
using uuid::modbus::frame_buffer_t = typedef std::array<uint8_t, MAX_MESSAGE_SIZE + 1> |
enum uuid::modbus::DeviceAddressType : uint8_t |
enum uuid::modbus::FunctionCode : uint8_t |
enum uuid::modbus::ResponseStatus : uint8_t |
Status of response messages.
Enumerator | |
---|---|
QUEUED | Waiting in queue.
|
TRANSMIT | Request being transmitted.
|
WAITING | Waiting for response.
|
SUCCESS | Response received.
|
EXCEPTION | Exception response received.
|
FAILURE_INVALID | Invalid request parameters.
|
FAILURE_CRC | Invalid CRC in response.
|
FAILURE_TIMEOUT | Request timed out.
|
FAILURE_TOO_SHORT | Response too short.
|
FAILURE_TOO_LONG | Response too long.
|
FAILURE_ADDRESS | Response from another device.
|
FAILURE_FUNCTION | Unexpected function code in response.
|
FAILURE_LENGTH | Incorrect response length.
|
FAILURE_UNEXPECTED | Received a response to broadcast request.
|
|
constexpr |
|
constexpr |
|
constexpr |
const uuid::log::Logger uuid::modbus::logger {reinterpret_cast<const __FlashStringHelper *>(__pstr__loggername), uuid::log::Facility::DAEMON} |
|
constexpr |
|
constexpr |