Roboid Control for C++
Loading...
Searching...
No Matches
TextMsg.h
1#include "Messages.h"
2
3namespace Passer {
4namespace RoboidControl {
5
7class TextMsg : public IMessage {
8 public:
10 static const unsigned char id = 0xB0;
12 static const unsigned char length = 2;
14 unsigned char networkId;
16 unsigned char thingId;
18 const char* text;
20 unsigned char textLength;
21
24 TextMsg(const char* text, unsigned char textLength);
26 TextMsg(char* buffer);
28 virtual ~TextMsg();
29
31 virtual unsigned char Serialize(char* buffer) override;
32};
33
34} // namespace RoboidControl
35} // namespace Passer
Root structure for all communcation messages.
Definition Messages.h:12
Message for sending generic text.
Definition TextMsg.h:7
static const unsigned char length
The length of the message without the text itself.
Definition TextMsg.h:12
const char * text
The text without the null terminator.
Definition TextMsg.h:18
unsigned char textLength
The length of the text.
Definition TextMsg.h:20
unsigned char networkId
The network ID of the thing.
Definition TextMsg.h:14
unsigned char thingId
the ID of the thing
Definition TextMsg.h:16
virtual ~TextMsg()
Destructor for the message.
Definition TextMsg.cpp:22
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition TextMsg.cpp:24