Roboid Control for C++
Loading...
Searching...
No Matches
ModelUrlMsg.h
1#pragma once
2
3#include "IMessage.h"
4#include "Thing.h"
5
6namespace RoboidControl {
7
9class ModelUrlMsg : public IMessage {
10 public:
12 static const unsigned char id = 0x90;
14 static const unsigned char length = 4;
15
17 unsigned char networkId;
19 unsigned char thingId;
20
22 unsigned char urlLength;
24 const char* url;
25
29 ModelUrlMsg(unsigned char networkId, Thing* thing);
31 ModelUrlMsg(const char* buffer);
32
34 virtual ~ModelUrlMsg();
35
37 virtual unsigned char Serialize(char* buffer) override;
38};
39
40} // namespace RoboidControl
Root structure for all communcation messages.
Definition IMessage.h:6
Message for communicating the URL for a model of the thing.
Definition ModelUrlMsg.h:9
virtual ~ModelUrlMsg()
Destructor for the message.
Definition ModelUrlMsg.cpp:40
static const unsigned char length
The length of the message without the URL string itself.
Definition ModelUrlMsg.h:14
const char * url
The url of the model, not terminated by a null character.
Definition ModelUrlMsg.h:24
unsigned char urlLength
The length of the url string, excluding the null terminator.
Definition ModelUrlMsg.h:22
unsigned char networkId
The network ID of the thing.
Definition ModelUrlMsg.h:17
unsigned char thingId
The ID of the thing.
Definition ModelUrlMsg.h:19
virtual unsigned char Serialize(char *buffer) override
Serialize the message into a byte array for sending.
Definition ModelUrlMsg.cpp:44
A thing is the primitive building block.
Definition Thing.h:20