Add message type ids to PixelBot client code

This commit is contained in:
Starbeamrainbowlabs 2017-03-01 21:15:47 +00:00
parent 2271f52d1e
commit caf1a11677

View file

@ -3,6 +3,32 @@
#include <ESP8266WiFi.h> #include <ESP8266WiFi.h>
#include <WiFiUdp.h> #include <WiFiUdp.h>
/// Message Types ///
// Hard-resets the PixelBot. Useful if something has gone wrong, or to reset it's internal state.
const int MESSAGE_RESET = 0;
// May be sent by either party. Indicates that one or the other doesn't like a message that was sent by the other party.
const int MESSAGE_ERROR = 1;
// Sent by a PixelBot upon connection.
const int MESSAGE_HANDSHAKEREQUEST = 5;
// Sent by the server in response to a `HandshakeRequest`.
const int MESSAGE_HANDSHAKERESPONSE = 6;
// Instructs a PixelBot to perform a movement.
const int MESSAGE_MOVE = 11;
// Sent by a pixelbot to indicate that the command sent by the server is ok, and that it will proceed to execute it.
const int MESSAGE_COMMANDOK = 12;
// Sent by a pixelbot to indicate that it has completed executing the command sent previously.
const int MESSAGE_COMMANDCOMPLETE = 13;
// Sent by a pixelbot to indicate that it has failed to complete the execution of a command it received previously.
const int MESSAGE_COMMANDFAILED = 14;
// Sent by the server to request information from a PixelBot. This could be from sensors, configuration, statistics, etc.
const int MESSAGE_INFOREQUEST = 20;
// Sent by a PixelBot in response to an `InfoRequest` message.
const int MESSAGE_INFORESPONSE = 21;
/////////////////////
/// <summary> /// <summary>
/// Connects to a PixelHub server, receives commands, and acts upon them. /// Connects to a PixelHub server, receives commands, and acts upon them.
/// </summmary> /// </summmary>