39 lines
1.3 KiB
Markdown
39 lines
1.3 KiB
Markdown
|
# 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 |
|
||
|
+--------+
|
||
|
```
|
||
|
|
||
|
|