Browse Source

feat: Require 0xFF for custom payloads

ref:
pull/1928/head
Janez T 3 months ago
parent
commit
0e98939987
  1. 4
      docs/companion_protocol.md

4
docs/companion_protocol.md

@ -298,7 +298,7 @@ Bytes 7+: Binary payload bytes (variable length)
```
**Data Type / Transport Mapping**:
- `0xFF` (`TXT_TYPE_CUSTOM_BINARY`) is the custom-app binary type.
- `0xFF` (`TXT_TYPE_CUSTOM_BINARY`) must be used for custom-protocol binary datagrams.
- `0x00` (`TXT_TYPE_PLAIN`) is invalid for this command.
- Values other than `0xFF` are reserved for official protocol extensions.
@ -489,7 +489,7 @@ Bytes 11+: Payload bytes
**Payload Meaning**:
- If `txt_type == 0x00`: payload is UTF-8 channel text.
- If `txt_type != 0x00`: payload is binary (for example image/voice fragments) and must be treated as raw bytes.
For custom app datagrams sent via `CMD_SEND_CHANNEL_DATA`, use `txt_type == 0xFF`.
For custom app datagrams sent via `CMD_SEND_CHANNEL_DATA`, `txt_type` must be `0xFF`.
**Parsing Pseudocode**:
```python

Loading…
Cancel
Save