34 lines
984 B
C++
34 lines
984 B
C++
#include "Messages.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 network ID of the thing
|
|
unsigned char networkId;
|
|
/// @brief the ID of the thing
|
|
unsigned char thingId;
|
|
/// @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
|