Roboid Control for C++
Loading...
Searching...
No Matches
ThingMsg.h
1#include "Messages.h"
2
3namespace Passer {
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 // ThingMsg(unsigned char networkId, unsigned char thingId,
27 // unsigned char thingType, unsigned char parentId);
28
30 ThingMsg(const char* buffer);
32 virtual ~ThingMsg();
33
35 virtual unsigned char Serialize(char* buffer) override;
36};
37
38} // namespace RoboidControl
39} // namespace Passer
Root structure for all communcation messages.
Definition Messages.h:12
A thing is the primitive building block.
Definition Thing.h:17
Message providing generic information about a Thing.
Definition ThingMsg.h:7
unsigned char thingType
The Thing.Type of the thing.
Definition ThingMsg.h:18
unsigned char thingId
The ID of the thing.
Definition ThingMsg.h:16
virtual ~ThingMsg()
Destructor for the message.
Definition ThingMsg.cpp:33
static const unsigned char length
The length of the message.
Definition ThingMsg.h:12
unsigned char parentId
The parent of the thing in the hierarachy. This is null for root Things.
Definition ThingMsg.h:20
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition ThingMsg.cpp:35
unsigned char networkId
The network ID of the thing.
Definition ThingMsg.h:14