feat: let a companion app opt into the full RX log over BLE (#256)

Since beta_23 the per-packet RX log (PUSH_CODE_LOG_RX_DATA, 0x88) is kept off
BLE, because it floods a ~16 frame/sec link and starves chat and admin traffic
(#46, #54). That is still the right default and is unchanged here.

But it is also the ONLY frame carrying the transport codes and the full relay
path — RESP_CODE_CHANNEL_MSG_RECV_V3 has neither — so coverage and region
mapping apps have had no way to reconstruct either over BLE. @marcelverdult,
who writes KiekR, traced this through our source and asked for an opt-in rather
than a revert.

A companion can now request it per session:

    CMD_SET_CUSTOM_VAR   "ble.rxlog:1"     (and "ble.rxlog:0" to stop)

Chosen over a user-facing setting because the tradeoff belongs to the app, not
the user: an app that wants the firehose knows it wants it, and nobody else
should have to understand the question.

Deliberately NOT persisted. A stored flag would silently reinstate the #46/#54
flood for someone who tried a coverage app once and moved on — on the one link
that cannot absorb it. Asking again after each connect is cheap for an app and
is the safe default for everyone else.

The existing #94 one-shot (echoes of our own sends, so "Repeats heard" keeps
working) is untouched and still applies when the firehose is off.

Builds on T-Deck, V4 and Pager.

Requested by @marcelverdult.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kaj Schittecat
2026-08-13 09:30:19 +02:00
co-authored by Claude Opus 5
parent 0fe3357dcb
commit e1db4f50f2
3 changed files with 28 additions and 1 deletions
+14
View File
@@ -4559,6 +4559,20 @@ void MyMesh::handleCmdFrame(size_t len) {
char *np = strchr(sp, ':'); // look for separator char
if (np) {
*np++ = 0; // modify 'cmd_frame', replace ':' with null
// #256: "ble.rxlog:1" opts THIS session's BLE companion into the full
// per-packet RX log (0x88). It is not a sensor setting, so intercept it
// before the sensor dispatch below. Coverage/region apps need it because
// the transport codes and the full relay path exist only in that frame —
// RESP_CODE_CHANNEL_MSG_RECV_V3 carries neither. Off by default and never
// persisted, so the #46/#54 fix stands for everyone who does not ask.
// Requested by the KiekR author (marcelverdult), who traced it for us.
#if defined(ESP32) && defined(MULTI_TRANSPORT_COMPANION)
if (strcmp(sp, "ble.rxlog") == 0) {
MultiTransportCompanionInterface::bleSetRxLogFirehose(np[0] == '1');
writeOKFrame();
return;
}
#endif
bool success = sensors.setSettingValue(sp, np);
if (success) {
#if ENV_INCLUDE_GPS == 1