Files
Meck/examples
pelgraine e9ec6e4648 Channel data (PAYLOAD_TYPE_GRP_DATA) send and receive for the companion app (issue #19)
Ports upstream MeshCore's channel datagram support (dz0ny, 9b842786, 5 Mar 2026, with follow-ups a21b83b1, ed326255 and 1d61df72). Upstream added it at protocol version 10, so apps may already send it to Meck, which reports 11.

Before: Meck decrypted incoming channel datagrams and silently dropped them, and the app's send command (62) was answered "unsupported".

Changes:
- BaseChatMesh::onGroupDataRecv() handles PAYLOAD_TYPE_GRP_DATA (2-byte little-endian data type, 1-byte length, payload), drops short or malformed packets, and passes the data to a new onChannelDataRecv() hook. Group text now checks the packet length before reading the text type byte.
- New BaseChatMesh::sendGroupData(): flood (using the channel's region scope) when no path is given, otherwise direct. Maximum payload MAX_GROUP_DATA_LENGTH (165 bytes).
- Companion: received datagrams go to the app as RESP_CODE_CHANNEL_DATA_RECV (27) and count as channel messages in the offline queue. CMD_SEND_CHANNEL_DATA (62) is handled with upstream's error codes.
- DATA_TYPE_RESERVED (0x0000) and DATA_TYPE_DEV (0xFFFF) defined.
Channel data is passed to the app only, not shown on the device. Upstream's MyMesh listener hook is not ported (Meck has no listener interface).

Tested on a PC against Meck's real Mesh and BaseChatMesh code with real encryption (AddressSanitizer on): flood and direct datagrams arrive intact; 165 bytes accepted, 166 refused; a malformed length is dropped; another channel's data is ignored; channel text is unaffected. The app frame and command 62 (flood, direct, 2-byte path hashes, every error case) were tested separately.

Issue #20 (rolling-window duty cycle) was already done in 444631e0 (30 Jun 2026) and shipped in v1.12.4: Dispatcher uses upstream's token bucket (upstream PR #1297) over a one-hour window instead of the old per-transmission silent period. Re-checked against upstream's current Dispatcher: same logic, and companion builds take the airtime factor from saved settings (default 1.0), as upstream does.
2026-10-10 11:04:26 +11:00
..