docs/communication.md

51 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2022-04-11 19:16:49 +02:00
# Heliox communication protocol
> **Note:**
>
> look into state-of-the-art protocols -> https://www.reddit.com/r/embedded/comments/11bxeux/whats_everyone_is_using_for_framing_and/
>- CBOR
>- MessagePack
>- Protobufs
2022-09-20 18:58:26 +02:00
The following structure can be used to communicate with the Heliox control over several carrier protocols (UART, BL LE,...)
2022-04-11 19:16:49 +02:00
## Basic data structure
2022-09-20 18:58:26 +02:00
The following table describes the bit pattern for a successful communication with and between Heliox devices.
| 0x0 | 0x1 | 0x2 | 0x3 | 0x4 | ... |
| --- | --- | -------- | ------ | --------- | --------------- |
| H | X | _length_ | _mode_ | _submode_ | _optional data_ |
## Modes
### Mode selection
2022-04-11 19:16:49 +02:00
2022-09-20 18:58:26 +02:00
The columns represent modes and the rows represent submodes:
2022-04-11 19:16:49 +02:00
2022-09-20 18:58:26 +02:00
| | 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 |
2023-03-30 19:40:14 +02:00
| 0x6 | | | | reset |
2022-04-11 19:16:49 +02:00
2023-03-30 19:40:14 +02:00
### Optional data (out of date)
2022-04-11 21:08:16 +02:00
2022-09-20 18:58:26 +02:00
Every submode can take any number of Bytes except the below-mentioned ones:
2022-04-11 21:08:16 +02:00
2022-09-20 18:58:26 +02:00
| **0 Bytes** | **1 Byte** |
| :------------: | :--------: |
| on | increase |
| off | decrease |
| flash console | toggle |
| pair Bluetooth | |
2022-04-11 21:08:16 +02:00
2022-09-20 18:58:26 +02:00
### Additional information
2022-04-11 21:08:16 +02:00
2023-03-30 19:40:14 +02:00
The maximum length of a message ist 255 Bytes excluding the magic number "HX" and the length slot itself.