Restructure communication protocol

This commit is contained in:
GHOSCHT 2022-09-20 18:58:26 +02:00
parent e5ae5b3a3e
commit c291249dc6

View file

@ -1,30 +1,42 @@
# Heliox communication protocol
The following structure can be used to communicate with the Heliox control over several carrier protocols (UART, BL LE,...)
## Basic data structure
The following table describes the bit pattern for a successful communication with heliox devices.
The following table describes the bit pattern for a successful communication with and between Heliox devices.
| 0-15 | 16-22 | 23 | 24-31 | 32-(32+8*x) |
| :---------------: | :----------: | :---------------: | :-------------------: | :---------: |
| Magic Number (HX) | Message Type | Parity Bit (even) | Data Length (x Bytes) | Data |
| 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | ... |
| --- | --- | -------- | ------ | --------- | --------------- |
| H | X | _length_ | _mode_ | _submode_ | _optional data_ |
## Message Types
## Modes
| Code | Purpose |
| ---- | -------------------- |
| 0x0 | Light Data |
| 0x1 | Control Signal |
| 0x2 | Status Messages |
| 0x3 | Confirmation Message |
| 0x4 | Debug Info |
### Mode selection
### Light Data
The columns represent modes and the rows represent submodes:
- 1-Byte-block per lamp: 0-255
- Index of lamp determinded by order
| | 0x0 | 0x1 | 0x2 | 0x3 |
| :---: | :---------: | :---------------: | :---------------: | :-------------------------: |
| | **Message** | **Settings** | **Light control** | **Basic commands** |
| 0x0 | light data | set baud rate | on | request light data |
| 0x1 | info | set WIFI password | off | enter console flashing mode |
| 0x2 | warning | set WIFI SSID | toggle | exit console flashing mode |
| 0x3 | error | | increase | pair Bluetooth |
| 0x4 | success | | decrease | help |
| 0x5 | | | | version |
### Control Signal
### Optional data
- Index Byte + [ **t** <sub>oggle</sub> | **i** <sub>ncrease</sub> | **d** <sub>decrease</sub> ]
- on
- off
Every submode can take any number of Bytes except the below-mentioned ones:
| **0 Bytes** | **1 Byte** |
| :------------: | :--------: |
| on | increase |
| off | decrease |
| flash console | toggle |
| pair Bluetooth | |
### Additional information
The maximum length of a message ist 255 Bytes excluding the magic number "BM" and the length slot itself.