Roboid Control for C++
Loading...
Searching...
No Matches
TextMsg.h
1#include "IMessage.h"
2
3namespace RoboidControl {
4
6class TextMsg : public IMessage {
7 public:
9 static const unsigned char id = 0xB0;
11 static const unsigned char length = 2;
13 const char* text;
15 unsigned char textLength;
16
19 TextMsg(const char* text, unsigned char textLength);
21 TextMsg(char* buffer);
23 virtual ~TextMsg();
24
26 virtual unsigned char Serialize(char* buffer) override;
27};
28
29} // namespace RoboidControl
Root structure for all communcation messages.
Definition IMessage.h:6
Message for sending generic text.
Definition TextMsg.h:6
const char * text
The text without the null terminator.
Definition TextMsg.h:13
static const unsigned char length
The length of the message without the text itself.
Definition TextMsg.h:11
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition TextMsg.cpp:23
virtual ~TextMsg()
Destructor for the message.
Definition TextMsg.cpp:21
unsigned char textLength
The length of the text.
Definition TextMsg.h:15