feat(settings): implement set_ham_mode HamParameters admin message#5780
Draft
jamesarich wants to merge 3 commits into
Draft
feat(settings): implement set_ham_mode HamParameters admin message#5780jamesarich wants to merge 3 commits into
jamesarich wants to merge 3 commits into
Conversation
ea06782 to
0a4c22b
Compare
b24bc89 to
6d4ea50
Compare
jamesarich
added a commit
that referenced
this pull request
Jun 13, 2026
configureCommon() applied setMultipleConnectionPool(maxNumOfReaders = 4) to every database, including the in-memory ones used by tests. A read on a pooled reader connection can observe a snapshot older than the latest write on the writer connection, so a read immediately after a write may return stale rows. DeviceLinkRepositoryImplTest.reconcilePrunesShortCodesNoLongerInCatalog read [a, b] (the pre-prune state) instead of [a] after a deleteNotIn — passing locally but flaking on CI depending on connection-assignment timing (failed shard-core on #5738; the identical code passed on #5780). In-memory builders now pass multiConnection = false so reads serialize behind writes on one connection. Production/file databases keep the multi-reader pool. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When the licensed amateur radio toggle is on for the locally connected node, the User config screen repurposes the long-name field as the callsign (max 8 chars, iOS parity) and saving sends AdminMessage(set_ham_mode) instead of set_owner. Current LoRa tx_power/override_frequency are echoed into the HamParameters so a re-send while already licensed never wipes the node's overrides (firmware applies them verbatim). The node entry is optimistically updated pending the device's authoritative NodeInfo. Closes #5759 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Align AdminController.setHamMode KDoc with the implementation: the impl echoes the local LoRa values itself; caller-supplied tx_power/frequency are ignored (F-2, F-15) - Fall back to the default LoRaConfig message instead of hand-coded proto defaults (F-9) - Cover the lora-absent/unknown-node fallback branches and the null-myNodeInfo routing guard with tests (F-10, F-11) - Hoist the clear-on-toggle condition into a named boolean (F-13) - Deduplicate MyNodeInfo test fixtures into one helper (F-8) - Concrete wording for the protobufs#941 extension note (F-16) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… guard, callsign guidance - Route to set_ham_mode only when the licensed toggle transitions OFF→ON; subsequent saves of an already-licensed node use set_owner so other owner edits still propagate and the node doesn't reboot on every save (F-1) - Enforce the local-node-only contract in AdminControllerImpl, not just the ViewModel: setHamMode ignores remote destinations (F-3) - Show 'Your amateur radio call sign, up to 8 characters' as the field's supporting text in ham mode, giving sighted and screen-reader users the constraint (F-4, F-6) - Document that saveUserConfig is the preferred entry point over setOwner (F-7) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6d4ea50 to
5a189a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5759
What
Implements the
set_ham_modeAdminMessage for licensed amateur radio (ham) onboarding, with iOS feature parity (Meshtastic-AppleUserConfig.swift):UserConfigItemList.kt): when the "Licensed amateur radio (Ham)" toggle is ON for the locally connected node, the Long Name field is repurposed as Call sign (max 8 chars, supporting text explains the constraint); toggling ON clears an over-long name so the user enters a callsign. Remote nodes are unaffected.RadioConfigViewModel.saveUserConfig): the licensed toggle's OFF→ON transition sendsAdminMessage(set_ham_mode = HamParameters(call_sign, short_name)); all other saves (including subsequent edits while licensed) use the existingset_ownerpath so other owner fields still propagate and the node doesn't reboot on every save.AdminController→AdminControllerImpl): newsetHamModevertical mirroringsetOwner. The impl echoes the node's current LoRatx_power/override_frequencyinto the message — firmware'shandleSetHamModeapplies those fields verbatim, so sending zeros would wipe a ham's custom overrides. It also enforces the local-node-only contract (ignores remote destinations) and optimistically updates the node DB pending the device's authoritative NodeInfo.long_nameinHamParametersis deliberately omitted: it doesn't exist at the pinned protobufs 2.7.25 (meshtastic/protobufs#941 is still open). The extension point is marked with a comment; Renovate will auto-bump the pin when a release containing #941 ships.Why
Ham mode enablement for the 2.8 release — feature parity with iOS, which already implements this. The firmware consumes
set_ham_modefor ham onboarding (sets owner from callsign, disables encryption, applies LoRa overrides, reboots).Test Plan
spotlessCheck detekt assembleDebug test allTests kmpSmokeCompileall green locally (one pre-existing network-flaky test incore:datanoted, unrelated).Note for reviewers: the response dialog can time out after a successful
set_ham_modebecause the firmware reboots the node before acking — same behavior as iOS.🤖 Generated with Claude Code