#pragma once #include "Messages.h" namespace RoboidControl { /// @brief Message to send thing-specific data class BinaryMsg : public IMessage { public: /// @brief The message ID static const unsigned char id = 0xB1; /// @brief The length of the message without the binary data itslef static const unsigned length = 4; /// @brief The network ID of the thing unsigned char networkId; /// @brief The ID of the thing unsigned char thingId; /// @brief The thing for which the binary data is communicated Thing* thing; unsigned char dataLength; /// @brief The binary data which is communicated char* data = nullptr; /// @brief Create a new message for sending /// @param networkId The network ID of the thing /// @param thing The thing for which binary data is sent BinaryMsg(unsigned char networkId, Thing* thing); /// @copydoc RoboidControl::IMessage::IMessage(char*) BinaryMsg(char* buffer); /// @brief Destructor for the message virtual ~BinaryMsg(); /// @copydoc RoboidControl::IMessage::Serialize virtual unsigned char Serialize(char* buffer) override; }; } // namespace RoboidControl