#pragma once #include "Messages.h" namespace RoboidControl { /// @brief A participant messages notifies other participants of its presence /// When received by another participant, it can be followed by a NetworkIdMsg /// to announce that participant to this client such that it can join privately class ParticipantMsg : public IMessage { public: /// @brief The message ID static const unsigned char id = 0xA0; /// @brief The length of the message static const unsigned char length = 2; /// @brief The network ID known by the participant unsigned char networkId; /// @brief Create a new message for sending /// @param networkId The network ID known by the participant ParticipantMsg(char networkId); /// @copydoc RoboidControl::IMessage::IMessage(char*) ParticipantMsg(const char* buffer); /// @brief Destructor for the message virtual ~ParticipantMsg(); /// @brief Serialize the message into a byte array /// @param buffer The buffer to serialize into /// @return The length of the message in the buffer virtual unsigned char Serialize(char* buffer) override; }; } // namespace RoboidControl