30 lines
858 B
C++

#include "IMessage.h"
namespace RoboidControl {
/// @brief Message for sending generic text
class TextMsg : public IMessage {
public:
/// @brief The message ID
static const unsigned char id = 0xB0;
/// @brief The length of the message without the text itself
static const unsigned char length = 2;
/// @brief The text without the null terminator
const char* text;
/// @brief The length of the text
unsigned char textLength;
/// @brief Create a new message for sending
/// @param text The text
TextMsg(const char* text, unsigned char textLength);
/// @copydoc RoboidControl::IMessage::IMessage(char*)
TextMsg(char* buffer);
/// @brief Destructor for the message
virtual ~TextMsg();
/// @copydoc RoboidControl::IMessage::Serialize
virtual unsigned char Serialize(char* buffer) override;
};
} // namespace RoboidControl