Skip to content

Stop sending APP_START from the single-setting calls - #130

Merged
fdlamotte merged 1 commit into
meshcore-dev:mainfrom
hamsolodev:settings-without-appstart
Nov 22, 2026
Merged

fdlamotte merged 1 commit into
meshcore-dev:mainfrom
hamsolodev:settings-without-appstart

Conversation

@hamsolodev

Copy link
Copy Markdown
Contributor

What was wrong (#119, B3)

  • set_telemetry_mode_base/_loc/_env, set_manual_add_contacts, set_advert_loc_policy and set_multi_acks each sent APP_START to read the current settings before writing them back.
  • The firmware's APP_START also stops the contact iterator (MyMesh.cpp:1083, _iter_started = false). A get_contacts in progress, this client's or another app's on the same radio, then never gets its END_OF_CONTACTS.

What changed

  • These calls take the other settings from the SELF_INFO that MeshCore already holds from connecting. It's passed to the command handler with a new set_self_info_getter, alongside set_contact_getter_by_prefix.
  • They fall back to one APP_START only when no self info is held, e.g. a CommandHandler used on its own, or before the first SELF_INFO.
  • A successful set_other_params or set_other_params_from_infos updates the held values, so the next single-setting call doesn't put an old value back.
  • The trade-off: a change another client makes to these settings since our last APP_START isn't seen. The firmware has no other command that reads them, and the old way cost a contact list. Let me know if you'd prefer a different approach.

Verified

  • Unit tests in tests/unit/test_settings_without_appstart.py. They fail on current main.
  • The whole suite passes on 3.11 and 3.14.
  • Against companion v1.18.0 under MeshBench, with 81 contacts held: a raw GET_CONTACTS, then set_manual_add_contacts(False) straight after. On current main:
sent     04
sent     01 03 2020202020206d63636c69    (APP_START)
answered 02 29000000                     (CONTACTS_START)
answered 05 …                            (SELF_INFO)
sent     26 00000000
answered 00

No CONTACT frame and no END_OF_CONTACTS followed. On this branch:

sent     04
sent     26 00000000
answered 02 51000000
answered 03 …   (81 CONTACT frames)
answered 04 f9c85569                     (END_OF_CONTACTS)
answered 00

Part of #119.

set_telemetry_mode_base/_loc/_env, set_manual_add_contacts,
set_advert_loc_policy and set_multi_acks each sent APP_START to read the
current settings before writing them back. The firmware's APP_START also
stops a contact list being sent (_iter_started = false), so a get_contacts
in progress, this client's or another app's, never got its
END_OF_CONTACTS.

They now take the other settings from the SELF_INFO MeshCore already
holds from connecting (passed to the command handler with
set_self_info_getter), and send APP_START only when none is held. A
successful set_other_params(_from_infos) updates the held values, so the
next call doesn't put an old one back.

Part of meshcore-dev#119 (B3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants