Refine data type definitions and update registration process in documentation

This commit is contained in:
zjs81
2026-04-27 10:22:17 -07:00
parent b705d5489f
commit b6d0b7a5dd
3 changed files with 10 additions and 14 deletions
+9 -11
View File
@@ -318,19 +318,17 @@ Remaining bytes: Binary payload (variable length)
#### Registered `data_type` values
Declared in `src/helpers/TxtDataHelpers.h`. These values have agreed-upon payload schemas so different client apps on the same channel can interoperate.
`data_type` is an **application identifier**, not a payload-format identifier. Each registered value identifies an application that owns its own internal payload schemas. The firmware does not inspect payload contents — `data_type` is transported opaquely.
| Value | Constant | Purpose | Payload schema |
|--------|----------------------|---------------------------------------------|--------------------------------------------------------------------------------------------------------|
| 0x0000 | `DATA_TYPE_RESERVED` | Reserved; invalid on send | — |
| 0x0001 | `DATA_TYPE_SMAZ_TEXT`| Raw SMAZ-compressed UTF-8 text | `[sender_name_len: u8][sender_name: UTF-8 × sender_name_len][smaz_bytes: remaining]` |
| 0x0002 | `DATA_TYPE_GIPHY_GIF`| Giphy GIF id (avoids base64 tax) | `[sender_name_len: u8][sender_name: UTF-8 × sender_name_len][giphy_id: ASCII, remaining]` |
| 0x0003 | `DATA_TYPE_REACTION` | Emoji reaction targeting a prior message | `[target_hash: 2 bytes LE][emoji_index: u8][sender_name_len: u8][sender_name: UTF-8 × sender_name_len]` |
| 0xFFFF | `DATA_TYPE_DEV` | Developer/experimental namespace | Application-defined |
| Value | Constant | Purpose |
|-----------------|----------------------|--------------------------------------------------------------------------|
| 0x0000 | `DATA_TYPE_RESERVED` | Reserved; invalid on send |
| 0x0001 0x00FF | — | Reserved for internal use |
| 0x0100 0xFEFF | — | Registered application namespaces (see [number_allocations.md](number_allocations.md)) |
| 0xFF00 0xFFFE | — | Testing/development; no registration required |
| 0xFFFF | `DATA_TYPE_DEV` | Developer/experimental namespace |
The firmware does not inspect the payload contents — `data_type` is transported opaquely, and the schemas above are a client-side contract between cooperating apps.
To request a new registered value, submit a PR adding a `#define` to `TxtDataHelpers.h` and a row to this table.
To register a new application, submit a PR adding a row to the table in [docs/number_allocations.md](number_allocations.md). Internal sub-formats within an allocated application ID are owned by that application and are not tracked in MeshCore firmware or this document.
---
+1
View File
@@ -15,6 +15,7 @@ Once you have a working app/project, you need to be able to demonstrate it exist
| Data-Type range | App name | Contact |
|-----------------|-----------------------------|------------------------------------------------------|
| 0000 - 00FF | -reserved for internal use- | |
| 0100 | MeshCore Open | zsylvester@monitormx.com — https://github.com/zjs81/meshcore-open |
| FF00 - FFFF | -reserved for testing/dev- | |
(add rows, inside the range 0100 - FEFF for custom apps)
-3
View File
@@ -7,9 +7,6 @@
#define TXT_TYPE_CLI_DATA 1 // a CLI command
#define TXT_TYPE_SIGNED_PLAIN 2 // plain text, signed by sender
#define DATA_TYPE_RESERVED 0x0000 // reserved for future use
#define DATA_TYPE_SMAZ_TEXT 0x0001 // raw SMAZ-compressed UTF-8 text meshcore-open Flutter client.
#define DATA_TYPE_GIPHY_GIF 0x0002 // ASCII Giphy GIF id meshcore-open Flutter client.
#define DATA_TYPE_REACTION 0x0003 // 2-byte target message hash + 1-byte emoji index meshcore-open Flutter client.
#define DATA_TYPE_DEV 0xFFFF // developer namespace for experimenting with group/channel datagrams and building apps
class StrHelper {