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