17 #ifndef MODBUS_MSG_OPERATION_MODE_WRAPPER_H 18 #define MODBUS_MSG_OPERATION_MODE_WRAPPER_H 20 #include <pilz_msgs/OperationModes.h> 22 #include <prbt_hardware_support/ModbusMsgInStamped.h> 30 using namespace modbus_api::v3;
49 virtual void checkStructuralIntegrity()
const override;
56 int8_t getOperationMode()
const;
61 pilz_msgs::OperationModes getTimeStampedOperationMode()
const;
69 bool hasOperationMode()
const;
88 return pilz_msgs::OperationModes::UNKNOWN;
90 return pilz_msgs::OperationModes::T1;
92 return pilz_msgs::OperationModes::T2;
94 return pilz_msgs::OperationModes::AUTO;
96 return pilz_msgs::OperationModes::UNKNOWN;
102 pilz_msgs::OperationModes op_mode;
121 #endif // MODBUS_MSG_OPERATION_MODE_WRAPPER_H virtual void checkStructuralIntegrity() const override
Calls ModbusMsgWrapper::checkStructuralIntegrity().
bool hasRegister(uint32_t reg) const
Check if a certain holding register is define in the Modbus message.
int8_t getOperationMode() const
Get the operation mode field from the Modbus message.
static constexpr uint16_t MODBUS_OPERATION_MODE_T1
static constexpr uint16_t MODBUS_OPERATION_MODE_AUTO
static const std::string OPERATION_MODE
uint16_t getRegister(uint32_t reg) const
static constexpr uint16_t MODBUS_OPERATION_MODE_T2
Expection thrown upon construction of ModbusMsgOperationModeWrapper of the message does not contain t...
bool hasOperationMode() const
Check if the message contains a operation mode definition.
virtual void checkStructuralIntegrity() const
Checks that the Modbus messages consists of all registers needed.
const ModbusApiSpec & getApiSpec() const
pilz_msgs::OperationModes getTimeStampedOperationMode() const
Wrapper class to add semantic to a raw ModbusMsgInStamped.
static constexpr uint16_t MODBUS_OPERATION_MODE_NONE
ModbusMsgOperationModeWrapper(const ModbusMsgInStampedConstPtr &modbus_msg_raw, const ModbusApiSpec &api_spec)
Wrapper class to add semantic to a raw ModbusMsgInStamped.
const ros::Time & getTimeStamp() const
Specifies the meaning of the holding registers.