class
#include <modbuscpp/details/response.hpp>
response
Contents
Base classes
- class adu
- ADU base class.
Derived classes
-
template<constants::class modbus::response::base_read_bits
function_code function_code> -
template<constants::class modbus::response::base_read_registers
function_code function_code> - class modbus::response::error
- class modbus::response::mask_write_register
- class modbus::response::read_write_multiple_registers
- class modbus::response::write_multiple_coils
- class modbus::response::write_multiple_registers
- class modbus::response::write_single_coil
- class modbus::response::write_single_register
Public types
Constructors, destructors, conversion operators
Public functions
Protected static functions
-
static auto initial_check(const packet_
t& packet) -> bool
Protected functions
-
void decode_passed(const packet_
t& packet) pure virtual -
auto check_stage(const packet_
t& packet) -> stage - auto data_table() -> table*
- auto data_table() const -> const table*
Protected variables
Typedef documentation
Function documentation
modbus:: internal:: response:: ~response() virtual
Response destructor
modbus:: internal:: response:: response() explicit protected noexcept
Response constructor
modbus:: internal:: response:: response(constants:: function_code function,
const header_ t& req_header,
table* data_table = nullptr) explicit protected noexcept
Parameters | |
---|---|
function | modbus function |
req_header | request header |
data_table | data table pointer |
Response constructor
void modbus:: internal:: response:: decode(std::string_view packet)
Decode string_view
static bool modbus:: internal:: response:: initial_check(const packet_ t& packet) protected
Parameters | |
---|---|
packet | packet to check |
Returns | test passed or not |
Initial packet check
Check : Minimum size must be > header_length (7 bytes)
void modbus:: internal:: response:: decode_passed(const packet_ t& packet) pure virtual protected
Parameters | |
---|---|
packet | packet to parse |
Parse stage passed packet
BEWARE: only parse the right (no exception) packet
stage modbus:: internal:: response:: check_stage(const packet_ t& packet) protected
Parameters | |
---|---|
packet | packet to check |
Returns | exception stage |
Check stage
Will process these steps:
- Checking packet size
- Decode packet and write header metadata
- Check function
- Check function diff with 0x80
Will result in 3 phases as defined in stage enum
table* modbus:: internal:: response:: data_table() protected
Returns | data table pointer |
---|
Data table getter
const table* modbus:: internal:: response:: data_table() const protected
Returns | data table pointer |
---|
Data table getter
Variable documentation
header_ t modbus:: internal:: response:: req_header_ protected
Request header
table* modbus:: internal:: response:: data_table_ protected
Data table pointer