Roboid Control for C++
Loading...
Searching...
No Matches
NameMsg.h
1#pragma once
2
3#include "IMessage.h"
4#include "Thing.h"
5
6namespace RoboidControl {
7
9class NameMsg : public IMessage {
10 public:
12 static const unsigned char id = 0x91;
14 static const unsigned char length = 4;
16 unsigned char networkId;
18 unsigned char thingId;
20 unsigned char nameLength;
22 const char* name;
23
27 NameMsg(unsigned char networkId, Thing* thing);
29 NameMsg(const char* buffer);
31 virtual ~NameMsg();
32
34 virtual unsigned char Serialize(char* buffer) override;
35};
36
37} // namespace RoboidControl
Root structure for all communcation messages.
Definition IMessage.h:6
Message for communicating the name of a thing.
Definition NameMsg.h:9
unsigned char thingId
The ID of the thing.
Definition NameMsg.h:18
virtual ~NameMsg()
Destructor for the message.
Definition NameMsg.cpp:38
unsigned char nameLength
The length of the name, excluding the null terminator.
Definition NameMsg.h:20
static const unsigned char length
The length of the message.
Definition NameMsg.h:14
const char * name
The name of the thing, not terminated with a null character.
Definition NameMsg.h:22
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition NameMsg.cpp:42
unsigned char networkId
The network ID of the thing.
Definition NameMsg.h:16
A thing is the primitive building block.
Definition Thing.h:20