Roboid Control for C++
Loading...
Searching...
No Matches
ThingMsg.h
1#include "IMessage.h"
2#include "Thing.h"
3
4namespace RoboidControl {
5
7class ThingMsg : public IMessage {
8 public:
10 static const unsigned char id = 0x80;
12 static const unsigned char length = 5;
14 unsigned char networkId;
16 unsigned char thingId;
18 unsigned char thingType;
20 unsigned char parentId;
21
25 ThingMsg(unsigned char networkId, Thing* thing);
26
28 ThingMsg(const char* buffer);
30 virtual ~ThingMsg();
31
33 virtual unsigned char Serialize(char* buffer) override;
34};
35
36} // namespace RoboidControl
Root structure for all communcation messages.
Definition IMessage.h:6
A thing is the primitive building block.
Definition Thing.h:20
Message providing generic details about a Thing.
Definition ThingMsg.h:7
unsigned char thingType
The type of thing.
Definition ThingMsg.h:18
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition ThingMsg.cpp:34
unsigned char networkId
The network ID of the thing.
Definition ThingMsg.h:14
virtual ~ThingMsg()
Destructor for the message.
Definition ThingMsg.cpp:32
unsigned char parentId
The ID of the parent thing in the hierarchy. This is zero for root things.
Definition ThingMsg.h:20
static const unsigned char length
The length of the message.
Definition ThingMsg.h:12
unsigned char thingId
The ID of the thing.
Definition ThingMsg.h:16