17 #ifndef MODBUS_MSG_WRAPPER_H 18 #define MODBUS_MSG_WRAPPER_H 22 #include <prbt_hardware_support/ModbusMsgInStamped.h> 98 const ModbusMsgInStampedConstPtr
msg_;
105 ,
msg_(modbus_msg_raw)
111 uint32_t relative_idx = reg -
msg_->holding_registers.layout.data_offset;
113 return msg_->holding_registers.data.size() > relative_idx;
118 return msg_->holding_registers.data.at(reg -
msg_->holding_registers.layout.data_offset);
133 return msg_->disconnect.data;
151 return msg_->header.stamp;
156 #endif // MODBUS_MSG_WRAPPER_H const ModbusApiSpec & getApiSpec() const
uint16_t getRegister(uint32_t reg) const
virtual void checkStructuralIntegrity() const
Checks that the Modbus messages consists of all registers needed.
bool hasRegister(uint32_t reg) const
Check if a certain holding register is define in the Modbus message.
const ModbusApiSpec api_spec_
virtual ~ModbusMsgWrapper()=default
const ModbusMsgInStampedConstPtr msg_
unsigned int getVersion() const
bool hasVersion() const
Check if the modbus_msg contains the API version.
ModbusMsgWrapper(const ModbusMsgInStampedConstPtr &modbus_msg_raw, const ModbusApiSpec &api_spec)
Construct a new Modbus Msg Wrapper object.
const ros::Time & getTimeStamp() const
unsigned short getRegisterDefinition(const std::string &key) const
bool isDisconnect() const
Check if the Modbus message informs about a disconnect from the server.
Expection thrown upon construction of ModbusMsgWrapperBase of the message does not contain the requir...
Wrapper class to add semantic to a raw ModbusMsgInStamped.
Specifies the meaning of the holding registers.
static const std::string VERSION