Restructure communication protocol

This commit is contained in:
GHOSCHT 2022-09-20 18:58:26 +02:00
parent 3adb5c576f
commit 14846e5aa5
No known key found for this signature in database
GPG key ID: A35BD466B8871994

View file

@ -1,30 +1,42 @@
# Heliox communication protocol # 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 ## 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) | | 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | ... |
| :---------------: | :----------: | :---------------: | :-------------------: | :---------: | | --- | --- | -------- | ------ | --------- | --------------- |
| Magic Number (HX) | Message Type | Parity Bit (even) | Data Length (x Bytes) | Data | | H | X | _length_ | _mode_ | _submode_ | _optional data_ |
## Message Types ## Modes
| Code | Purpose | ### Mode selection
| ---- | -------------------- |
| 0x0 | Light Data |
| 0x1 | Control Signal |
| 0x2 | Status Messages |
| 0x3 | Confirmation Message |
| 0x4 | Debug Info |
### Light Data The columns represent modes and the rows represent submodes:
- 1-Byte-block per lamp: 0-255 | | 0x0 | 0x1 | 0x2 | 0x3 |
- Index of lamp determinded by order | :---: | :---------: | :---------------: | :---------------: | :-------------------------: |
| | **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> ] Every submode can take any number of Bytes except the below-mentioned ones:
- on
- off | **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.