26 using namespace modbus_api::v3;
30 : api_spec_(api_spec), update_run_permitted_(
std::move(update_run_permitted_func))
40 ROS_ERROR(
"A disconnect from the modbus server happend.");
58 std::ostringstream os;
59 os <<
"Received Modbus message of unsupported API Version: " << msg.
getVersion()
const ModbusApiSpec api_spec_
void modbusMsgCallback(const ModbusMsgInStampedConstPtr &msg_raw)
Called whenever a new modbus messages arrives.
Wrapper class to add semantic to a raw ModbusMsgInStamped.
static constexpr uint16_t MODBUS_API_VERSION_REQUIRED
virtual void checkStructuralIntegrity() const override
Calls ModbusMsgWrapper::checkStructuralIntegrity().
bool getRunPermitted() const
Get the RUN_PERMITTED from the Modbus message.
bool isDisconnect() const
Check if the Modbus message informs about a disconnect from the server.
ModbusAdapterRunPermitted(UpdateRunPermittedFunc &&update_run_permitted_func, const ModbusApiSpec &api_spec)
std::function< void(const bool)> UpdateRunPermittedFunc
UpdateRunPermittedFunc update_run_permitted_
unsigned int getVersion() const
Expection thrown upon construction of ModbusMsgWrapperBase of the message does not contain the requir...
#define ROS_ERROR_STREAM(args)
Specifies the meaning of the holding registers.