mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #1928 from dz0ny/feat/grp-data-upstream
feat: Add support for PAYLOAD_TYPE_GRP_DATA
This commit is contained in:
commit
91aed048e9
9 changed files with 161 additions and 10 deletions
|
|
@ -281,6 +281,33 @@ Bytes 7+: Message Text (UTF-8, variable length)
|
|||
|
||||
---
|
||||
|
||||
### 6. Send Channel Data Datagram
|
||||
|
||||
**Purpose**: Send binary datagram data to a channel.
|
||||
|
||||
**Command Format**:
|
||||
```
|
||||
Byte 0: 0x3E
|
||||
Bytes 1-2: Data Type (`data_type`, 16-bit little-endian)
|
||||
Byte 3: Channel Index (0-7)
|
||||
Bytes 4+: Binary payload bytes (variable length)
|
||||
```
|
||||
|
||||
**Data Type / Transport Mapping**:
|
||||
- `0x0000` is invalid for this command.
|
||||
- `0xFFFF` (`DATA_TYPE_DEV`) is the developer namespace for experimenting and developing apps.
|
||||
- Other non-zero values can be used as assigned application/community namespaces.
|
||||
|
||||
**Note**: Applications that need a timestamp should encode it inside the binary payload.
|
||||
|
||||
**Limits**:
|
||||
- Maximum payload length is `163` bytes.
|
||||
- Larger payloads are rejected with `PACKET_ERROR`.
|
||||
|
||||
**Response**: `PACKET_OK` (0x00) on success
|
||||
|
||||
---
|
||||
|
||||
### 6. Get Message
|
||||
|
||||
**Purpose**: Request the next queued message from the device.
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ https://github.com/meshcore-dev/MeshCore/blob/main/src/Packet.h#L19
|
|||
#define PAYLOAD_TYPE_TXT_MSG 0x02 // a plain text message (prefixed with dest/src hashes, MAC) (enc data: timestamp, text)
|
||||
#define PAYLOAD_TYPE_ACK 0x03 // a simple ack #define PAYLOAD_TYPE_ADVERT 0x04 // a node advertising its Identity
|
||||
#define PAYLOAD_TYPE_GRP_TXT 0x05 // an (unverified) group text message (prefixed with channel hash, MAC) (enc data: timestamp, "name: msg")
|
||||
#define PAYLOAD_TYPE_GRP_DATA 0x06 // an (unverified) group datagram (prefixed with channel hash, MAC) (enc data: timestamp, blob)
|
||||
#define PAYLOAD_TYPE_GRP_DATA 0x06 // an (unverified) group datagram (prefixed with channel hash, MAC) (enc data: data_type, data_len, blob)
|
||||
#define PAYLOAD_TYPE_ANON_REQ 0x07 // generic request (prefixed with dest_hash, ephemeral pub_key, MAC) (enc data: ...)
|
||||
#define PAYLOAD_TYPE_PATH 0x08 // returned path (prefixed with dest/src hashes, MAC) (enc data: path, extra)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue