Response message.
More...
#include <uuid/modbus.h>
|
bool | check_length (frame_buffer_t &frame, uint16_t actual, uint16_t expected) |
| Check the length of the message frame is correct and log an error if it is not. More...
|
|
Response message.
This will be created when a request is submitted and then later updated with the outcome. Poll the status() of the response to know when to access data.
- Since
- 0.1.0
Definition at line 124 of file modbus.h.
◆ check_length()
bool uuid::modbus::Response::check_length |
( |
frame_buffer_t & |
frame, |
|
|
uint16_t |
actual, |
|
|
uint16_t |
expected |
|
) |
| |
|
protected |
Check the length of the message frame is correct and log an error if it is not.
- Parameters
-
[in] | frame | Message frame buffer. |
[in] | actual | Actual length of the message frame. |
[in] | expected | Expected length of the message frame. |
- Returns
- True if the message frame length matches, otherwise false.
- Since
- 0.1.0
Definition at line 44 of file generic_functions.cpp.
◆ done()
bool uuid::modbus::Response::done |
( |
| ) |
const |
|
inline |
Determine if the request is complete.
- Returns
- True if the request is finished, otherwise false.
- Since
- 0.1.0
Definition at line 134 of file modbus.h.
◆ exception()
bool uuid::modbus::Response::exception |
( |
| ) |
const |
|
inline |
Determine if the request returned an exception.
- Returns
- True if the request returned an exception, otherwise false.
- Since
- 0.1.0
Definition at line 158 of file modbus.h.
◆ exception_code() [1/2]
uint8_t uuid::modbus::Response::exception_code |
( |
| ) |
const |
|
inline |
Get the exception code from the device response.
Valid only if the status() is ResponseStatus::EXCEPTION or exception() returns true.
- Returns
- Exception code from the device response.
- Since
- 0.1.0
Definition at line 194 of file modbus.h.
◆ exception_code() [2/2]
void uuid::modbus::Response::exception_code |
( |
uint8_t |
exception_code | ) |
|
|
inline |
Set the exception code from the device response.
Valid only if the status() is ResponseStatus::EXCEPTION or exception() returns true.
- Parameters
-
[in] | exception_code | Exception code from the device response. |
- Since
- 0.1.0
Definition at line 205 of file modbus.h.
◆ failed()
bool uuid::modbus::Response::failed |
( |
| ) |
const |
|
inline |
Determine if the request failed for a reason other than an exception.
- Returns
- True if the request failed (without receiving an exception), otherwise false.
- Since
- 0.1.0
Definition at line 167 of file modbus.h.
◆ parse()
◆ pending()
bool uuid::modbus::Response::pending |
( |
| ) |
const |
|
inline |
Determine if the request is still pending.
- Returns
- True if the request is in progress, otherwise false.
- Since
- 0.1.0
Definition at line 142 of file modbus.h.
◆ status() [1/2]
Get the status of the response message.
- Returns
- Status of the response message.
- Since
- 0.1.0
Definition at line 175 of file modbus.h.
◆ status() [2/2]
Set the status of the response message.
- Parameters
-
[in] | status | Status of the response message. |
- Since
- 0.1.0
Definition at line 183 of file modbus.h.
◆ success()
bool uuid::modbus::Response::success |
( |
| ) |
const |
|
inline |
Determine if the request was successful.
- Returns
- True if the request was successful, otherwise false.
- Since
- 0.1.0
Definition at line 150 of file modbus.h.
◆ exception_code_
uint8_t uuid::modbus::Response::exception_code_ = 0 |
|
private |
Device exception response.
- Since
- 0.1.0
Definition at line 234 of file modbus.h.
◆ status_
ResponseStatus uuid::modbus::Response::status_ = ResponseStatus::QUEUED |
|
private |
Status of response message.
- Since
- 0.1.0
Definition at line 233 of file modbus.h.
The documentation for this class was generated from the following files: