2017-04-20 18:57:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-03-02 13:07:58 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
|
|
|
2017-03-01 21:44:31 +00:00
|
|
|
struct PixelMessage
|
|
|
|
{
|
|
|
|
public:
|
2017-03-02 19:05:06 +00:00
|
|
|
PixelMessage();
|
|
|
|
PixelMessage(byte* rawMessage);
|
|
|
|
~PixelMessage();
|
2017-03-01 21:44:31 +00:00
|
|
|
|
2017-03-02 19:05:06 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The length of the message header, in bytes.
|
|
|
|
/// The message header contains things like the protocol version, the payload length, and the message type.
|
|
|
|
/// </summary>
|
|
|
|
static const unsigned int MESSAGE_HEADER_LENGTH = 12;
|
2017-04-21 13:17:00 +00:00
|
|
|
|
|
|
|
static const unsigned int TYPE_RESET = 0;
|
|
|
|
static const unsigned int TYPE_ERROR = 1;
|
|
|
|
static const unsigned int TYPE_HANDSHAKEREQUEST = 5;
|
|
|
|
static const unsigned int TYPE_HANDSHAKERESPONSE = 6;
|
|
|
|
static const unsigned int TYPE_MOVE = 11;
|
|
|
|
static const unsigned int TYPE_COMMANDOK = 12;
|
|
|
|
static const unsigned int TYPE_COMMANDCOMPLETE = 13;
|
|
|
|
static const unsigned int TYPE_COMMANDFAILED = 14;
|
|
|
|
static const unsigned int TYPE_INFOREQUEST = 20;
|
|
|
|
static const unsigned int TYPE_INFORESPONSE = 21;
|
2017-05-18 18:58:13 +00:00
|
|
|
|
2017-03-02 19:05:06 +00:00
|
|
|
// The protocol version associated with this message.
|
|
|
|
unsigned short ProtocolVersion = 1;
|
|
|
|
unsigned short MessageType = 1;
|
|
|
|
unsigned int MessageId = 0;
|
|
|
|
unsigned int MessageLength = 0;
|
2017-03-02 18:49:20 +00:00
|
|
|
|
2017-03-02 19:05:06 +00:00
|
|
|
//const byte* Payload;
|
|
|
|
|
2017-03-01 21:44:31 +00:00
|
|
|
private:
|
2017-03-02 19:05:06 +00:00
|
|
|
|
2017-03-02 13:07:58 +00:00
|
|
|
};
|