From 55bf8c25fcd8e1abc6ee41d0813984645d9df236 Mon Sep 17 00:00:00 2001 From: nightjoker7 <47129685+nightjoker7@users.noreply.github.com> Date: Thu, 23 Apr 2026 06:42:05 -0500 Subject: [PATCH] PhoneAPI: add missing tak_tag case + skip reserved gap in module-config iteration (#10256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * PhoneAPI: add missing tak_tag case + skip reserved gap in module-config iteration The STATE_SEND_MODULECONFIG state machine iterates config_state through ModuleConfigType enum values (1..MAX+1 = 16) and switches on meshtastic_ModuleConfig_*_tag values. Two of the resulting tag values land in the default / LOG_ERROR path: 1. `tak_tag` (16) — the meshtastic_ModuleConfig_TAKConfig struct exists in the protobuf and has a `.tak` member in payload_variant, but no PhoneAPI case ever sends it to the phone. As a result, Android clients can't read the persisted TAK (Team Awareness Kit) module config at all. Added case that sends moduleConfig.tak, matching the pattern used for all other module-config tags (paxcounter, traffic_management, etc.). NodeDB already persists the struct via the moduleConfig protobuf save; this just wires the read path to the phone. 2. Tag 14 — reserved gap in the oneof numbering. No payload_variant member exists at tag 14. Without this patch, every phone reconnect walks through config_state=14 and hits `LOG_ERROR("Unknown module config type %d", config_state)`. On an active deployment that's ~1,400 LOG_ERROR lines per day per node — burying real errors. Added explicit `case 14: break;` so the gap is silently skipped. Also: lowered the `default:` log level from LOG_ERROR to LOG_DEBUG. A truly-new unknown type number would indicate firmware lagging the protobuf — annoying but not an error event worth LOG_ERROR, especially since this path runs on every phone handshake. If a new ModuleConfig tag appears, devs will notice via the phone UI missing it, not via log. Observed on a Station G2 fleet: 1403 "Unknown module config type 16" and 1427 "Unknown module config type 14" LOG_ERROR lines in 24 hours from routine phone reconnects. * Get rid of the placeholder --------- Co-authored-by: Ben Meadors --- src/mesh/PhoneAPI.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 714e61108..cb25efb77 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -470,8 +470,13 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_traffic_management_tag; fromRadioScratch.moduleConfig.payload_variant.traffic_management = moduleConfig.traffic_management; break; + case meshtastic_ModuleConfig_tak_tag: + LOG_DEBUG("Send module config: tak"); + fromRadioScratch.moduleConfig.which_payload_variant = meshtastic_ModuleConfig_tak_tag; + fromRadioScratch.moduleConfig.payload_variant.tak = moduleConfig.tak; + break; default: - LOG_ERROR("Unknown module config type %d", config_state); + LOG_DEBUG("Unhandled module config type %d", config_state); } config_state++;