Roboid Control for C++
Loading...
Searching...
No Matches
NameMsg.h
1#include "Messages.h"
2
3namespace Passer {
4namespace RoboidControl {
5
7class NameMsg : public IMessage {
8 public:
10 static const unsigned char id = 0x91;
12 static const unsigned char length = 4;
14 unsigned char networkId;
16 unsigned char thingId;
18 unsigned char nameLength;
20 const char* name;
21
25 NameMsg(unsigned char networkId, Thing* thing);
26 // NameMsg(unsigned char networkId, unsigned char thingId, const char *name,
27 // unsigned char nameLength);
28
30 NameMsg(const char* buffer);
32 virtual ~NameMsg();
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
Message for communicating the name of a thing.
Definition NameMsg.h:7
static const unsigned char length
The length of the message.
Definition NameMsg.h:12
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition NameMsg.cpp:35
unsigned char nameLength
The length of the name, excluding the null terminator.
Definition NameMsg.h:18
virtual ~NameMsg()
Destructor for the message.
Definition NameMsg.cpp:31
unsigned char thingId
The ID of the thing.
Definition NameMsg.h:16
const char * name
The name of the thing, not terminated with a null character.
Definition NameMsg.h:20
unsigned char networkId
The network ID of the thing.
Definition NameMsg.h:14
A thing is the primitive building block.
Definition Thing.h:17