17#ifndef STAUBLI_ROBOT_DRIVER__COMMUNICATION__PROTOCOL_HPP_
18#define STAUBLI_ROBOT_DRIVER__COMMUNICATION__PROTOCOL_HPP_
26#include "rclcpp/time.hpp"
73 bool serialize(uint8_t* buffer,
size_t buffer_size)
const;
113 virtual bool serialize(uint8_t* buffer,
size_t buffer_size)
const = 0;
116 virtual bool deserialize(uint8_t* buffer,
size_t buffer_size) = 0;
Generic message structure.
Definition protocol.hpp:104
virtual bool serialize(uint8_t *buffer, size_t buffer_size) const =0
Serialize message to bytes.
FrameHeader header
Message header.
Definition protocol.hpp:143
virtual ~Message()=default
bool serialize(std::vector< uint8_t > &data) const
Serialize message to vector.
virtual bool deserialize(uint8_t *buffer, size_t buffer_size)=0
Deserialize bytes to message.
bool deserialize(std::vector< uint8_t > &data)
Deserialize message from vector.
virtual size_t get_serialized_size() const =0
Size of the entire message in bytes.
rclcpp::Time reception_timestamp
Timestamp of the message reception (local clock)
Definition protocol.hpp:146
Definition messages.hpp:23
constexpr size_t MAX_FRAME_SEQUENCE_NUMBER
Maximal sequence number before wrap-around.
Definition protocol.hpp:55
constexpr uint16_t DEFAULT_CONTROL_PORT
Default port for the control socket.
Definition protocol.hpp:45
constexpr uint8_t PROTOCOL_VERSION
Protocol version.
Definition protocol.hpp:40
constexpr uint16_t MAGIC_NUMBER
Magic number to identify the protocol.
Definition protocol.hpp:35
constexpr uint16_t DEFAULT_DIAGNOSTICS_PORT
Default port for the diagnostics socket.
Definition protocol.hpp:50