Browse Source

Add message type ids to PixelBot client code

master
Starbeamrainbowlabs 4 years ago
parent
commit
caf1a11677
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      PixelHub-Client/PixelBot.h

+ 26
- 0
PixelHub-Client/PixelBot.h View File

@ -3,6 +3,32 @@
#include <ESP8266WiFi.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>
/// Connects to a PixelHub server, receives commands, and acts upon them.
/// </summmary>