Commit Graph
23 Commits
Author SHA1 Message Date
JakubandClaude Opus 5 0d7ba5473f docs(companion): require hosts to keep polling on unknown packet types
CMD_SYNC_NEXT_MESSAGE drains a shared queue, so a host that only advances
its polling loop on packet types it recognizes stalls on the first unknown
one, and everything queued behind it stays undelivered until the next
PACKET_MESSAGES_WAITING. This already bit clients when
PACKET_CHANNEL_DATA_RECV (0x1B) was introduced; spelling it out so the
next added type doesn't repeat it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 01:18:43 +02:00
JakubandClaude Opus 5 919bf106b7 feat(companion): add device-originated message frames
Adds RESP_CODE_CONTACT_MSG_SENT_V3 (0x1E) and
RESP_CODE_CHANNEL_MSG_SENT_V3 (0x1F) so firmware that sends messages on
its own (bot auto-replies, on-device keyboard input) can mirror them into
the companion app's history, which today only ever sees inbound traffic
and messages the app itself sent. See #3225.

Both ride the existing offline-queue / MSG_WAITING / SYNC_NEXT_MESSAGE
pipe and reuse the RECV_V3 byte layout, with the pubkey field holding the
recipient instead of the sender and the SNR byte reserved. Requires
app_target_ver >= 3; there is no pre-V3 shape, so older apps are skipped.

Mainline never calls these -- nothing in companion_radio self-originates
messages -- so this is API surface for custom builds, and the linker
drops both functions when unused (identical flash usage before/after).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 01:18:43 +02:00
Robert Ekl f5b6ff4c14 docs: fix channel index range, secret semantics and payload limit
Three factual errors in companion_protocol.md:

- The channel-datagram payload cap was given as 163 (MAX_FRAME_SIZE - 9 when
  MAX_FRAME_SIZE was still 172). It went 172 -> 176 in 62f1b11d, but simply
  updating the arithmetic to 167 would be worse than the stale value: 167 is
  only the host-frame bound (MyMesh.cpp:1265). The radio-side bound is
  MAX_GROUP_DATA_LENGTH = 184 - 16 - 3 = 165 (MeshCore.h:21, enforced at
  BaseChatMesh.cpp:544). A 166- or 167-byte payload passes the frame check,
  fails the radio check, and comes back as ERR_CODE_TABLE_FULL -- which this
  same doc describes as "retry later", so a conforming client would retry a
  permanently failing send forever. Documents 165 as the limit to enforce and
  calls out the 166-167 band explicitly.

- Channel index was documented as 0-7 throughout. The bound is
  MAX_GROUP_CHANNELS (BaseChatMesh.cpp:927,936), which is 40 on most current
  variants, 8 on some and 1 on others. Clients should read max_channels from
  byte 3 of PACKET_DEVICE_INFO instead. Index 0 is pre-populated with the
  built-in Public channel but is not reserved.

- The secret field was documented as "all zeros" for public channels. The
  firmware always hashes a real 16-byte key; the public channel ships with
  izOH6cXN6mrJ5e26oRXNcg== (companion_radio/MyMesh.cpp:111,1040). An all-zero
  secret is not a private channel and not an inert one: SHA256 over 16 zero
  bytes is a fixed global constant, giving a well-known channel with an
  all-zero AES key. searchChannelsByHash skips unnamed slots for exactly this
  reason (BaseChatMesh.cpp:392-401), but a named slot with a zero secret is
  not skipped and will absorb null-key group traffic from any node. Now
  documented as something not to do.
2026-09-02 11:38:06 -05:00
DG1TAL 84ceabfd0d Clarify hashtag privacy and group sender identity 2026-07-27 20:07:08 +02:00
Liam CottleandGitHub 94063f6833 Merge pull request #2636 from sefinek/fix/cmd-device-query-typo
fix: rename CMD_DEVICE_QEURY to CMD_DEVICE_QUERY
2026-06-02 12:41:57 +12:00
Sefinek 2adea02e9c docs: fix broken and misaligned tables 2026-05-28 15:15:47 +02:00
Sefinek bbe41eb375 fix: rename CMD_DEVICE_QEURY to CMD_DEVICE_QUERY 2026-05-28 14:39:12 +02:00
Sefinek 888ad4589c docs: fix typos, grammar and Wi-Fi capitalisation across docs 2026-05-28 14:23:31 +02:00
zjs81 9c8eb301a4 Clarify path length semantics and data handling in inbound group datagrams 2026-04-27 10:49:55 -07:00
zjs81 b6d0b7a5dd Refine data type definitions and update registration process in documentation 2026-04-27 10:22:17 -07:00
zjs81 b705d5489f Update companion protocol documentation and enhance data type definitions for clarity 2026-04-24 04:24:20 -07:00
Janez T ae9fcb3c0b fix: Rename grp dev type
ref: #1928
2026-03-19 09:35:02 +01:00
Janez T 2f68769185 fix: Widen grp data type
ref: #1928
2026-03-19 09:25:42 +01:00
Janez T 1fb26e7623 fix: Drop grp data timestamp
ref: #1928
2026-03-19 09:22:12 +01:00
Janez T 2fe3c36b8f fix: Trim grp docs
ref: #1928
2026-03-18 20:34:15 +01:00
Janez T 896d60c026 fix: Keep data docs only
ref: #1928
2026-03-18 20:32:47 +01:00
Janez T 37b72ffc17 fix: Scope group data docs
ref: #1928
2026-03-18 20:29:49 +01:00
Janez T f25d7a882a fix: Align channel data framing
ref: #1928
2026-03-18 20:14:22 +01:00
Janez T a21b83b127 fix: address comments
ref:
2026-03-18 20:09:11 +01:00
Janez T 0e98939987 feat: Require 0xFF for custom payloads
ref:
2026-03-18 20:08:52 +01:00
Janez T 9b84278607 feat: Add support for PAYLOAD_TYPE_GRP_DATA
Docs changes are to reflect how it is currently in fw

This adds ability to send datagram data to everyone in channel
2026-03-18 20:08:52 +01:00
Robert Ekl 6677b40954 docs: sync companion and kiss protocol docs 2026-03-08 21:31:08 -06:00
liamcottle 4af31e552e refactor documentation 2026-02-04 00:59:13 +13:00