Browse Source

Begin documenting PixelHub Procotol

master
Starbeamrainbowlabs 4 years ago
parent
commit
0b95857a60
1 changed files with 38 additions and 0 deletions
  1. +38
    -0
      PixelHub Protocol.md

+ 38
- 0
PixelHub Protocol.md View File

@ -0,0 +1,38 @@
# PixelHub Protocol Documentation
> Version 0.1
The _PixelHub Protocol_ is a communication protocol for WiFi-capable [Hull PixelBots](http://hullpixelbot.com/hullpixelbot/2017/02/01/welcome-to-hullpixelbot.html) to communicate with and be controlled by a remote server. While the protocol is binary, it is designed to be fairly easy to parse and implement.
## Basic Information
The PixelHub Protocol is conducted over a single TCP connection. Obtaining these details can be done automatically by listening to the UDP multicast beacon set up by the server.
In this specification document, when referring to bytes, The C++ notation will be used. Examples: `0b00000000`, `0b01010101`.
Each PixelHub message is terminated by a null byte (`0b00000000`).
## Conversation Flow
- [ Hub -> Bot ]: Send instruction
- [ Bot -> Hub ]: Acknowledge instruction
- [ Bot ]: Execute command
- [ Bot -> Hub ]: Notify about instruction completion
## Message Struture
### Basic Message
```
+--------+--------+--------+--------+
| Byte 1 | Byte 2 | Byte 3 | Byte 4 |
+--------+--------+--------+--------+
| Message Type |
+--------+--------+--------+--------+
| Message Id |
+--------+--------+--------+--------+
| Message Contents |
+--------+--------+--------+--------+
| Null |
| Byte |
+--------+
```