The first version filtered only #coredrive. Reading every channel slot of
the companion (CMD_GET_CHANNEL, once per connection, only with the notice
on) lets the app recognise any channel message the way the firmware does:
channel hash, then MAC (Mesh.cpp:225-236), for GRP_TXT and GRP_DATA. What
still triggers a count is a direct message or a room-server post.
The slots cannot change during the connection: the MeshCore app cannot
reach the companion while CoreDrive RX holds the BLE link. A slot the
uplink ping writes is added to the list as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While CoreDrive RX holds the BLE link the MeshCore app cannot, so a user
asked whether they would miss messages. The companion already pushes a
one-byte PUSH_CODE_MSG_WAITING (0x83) per queued message; the app now
counts those on Home, behind a Settings toggle that is off by default,
with an optional two-tone sound. Nothing is fetched: CMD_SYNC_NEXT_MESSAGE
would remove the message from the companion's queue.
The push carries no type, so #coredrive traffic of other clients would be
counted too. src/msgwait.js matches each push against the 0x88 that came
just before it (logged before processing, Dispatcher.cpp:199): the first
copy of another client's ping-channel GRP_TXT expects one push, which is
swallowed; re-broadcasts expect none (wasSeen, Mesh.cpp:233); echoes of
our own ping expect none (markSeen on send, Mesh.cpp:651). A promise
chain keeps the async decrypt of the 0x88 ahead of the 0x83.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>