RoboidControl-cpp/Messages/NetworkIdMsg.h
2025-02-21 15:49:14 +01:00

30 lines
889 B
C++

#include "Messages.h"
namespace Passer {
namespace RoboidControl {
/// @brief A message communicating the network ID for that participant
class NetworkIdMsg : public IMessage {
public:
/// @brief The message ID
static const unsigned char id = 0xA1;
/// @brief The length of the message
static const unsigned char length = 2;
/// @brief The network ID for the participant
unsigned char networkId;
/// @brief Create a new message for sending
/// @param networkId The network ID for the participant
NetworkIdMsg(unsigned char networkId);
/// @copydoc Passer::RoboidControl::IMessage::IMessage(char*)
NetworkIdMsg(const char *buffer);
/// @brief Destructor for the message
virtual ~NetworkIdMsg();
/// @copydoc Passer::RoboidControl::IMessage::Serialize
virtual unsigned char Serialize(char *buffer) override;
};
} // namespace Control
} // namespace Passer