Introduces a fourth ACL role (value 4) that can manage the region map
without full admin privileges. The role is intended for trusted users
who curate regions on a repeater but should not have access to general
admin commands.
ClientACL:
- Widen PERM_ACL_ROLE_MASK from 2 to 3 bits so the new value fits.
- Add PERM_ACL_REGION_MGR and ClientInfo::isRegionMgr().
- Exempt region_mgr entries from least-recently-active eviction in
putClient(), same as admins.
simple_repeater:
- Phones may still gate UI on the legacy is_admin byte (reply_data[6]),
so report region_mgr as admin there. Without this, the phone CLI
falls back to guest view.
- Allow region_mgr to send TXT_MSG CLI commands. handleCommand()
gates non-whitelisted commands with "Err - not permitted". The
whitelist covers region.* (read+write) plus a small set of
read-only queries (get, ver, board, neighbors, clock, sensor
get/list).
- Pass the ClientInfo* through to handleCommand and drop the
redundant sender_timestamp parameter (derived from
sender->last_timestamp; NULL means Serial CLI).
- Use ~PERM_ACL_ROLE_MASK instead of ~0x03 when clearing role bits
on login, so the wider mask is honored.
* room server: added RegionMap, and new CommonCLI wiring, default_scope handling
* sensor: only minimal RegionMap wiring. Still needs work to handle default-scope
The companion_radio example was not restoring the GPS enabled/disabled
preference from flash after reboot. The preference was being saved
correctly when toggled via the mobile app, but on boot,
sensors.begin() -> initBasicGPS() unconditionally sets gps_active=false
and nothing subsequently restored the persisted state.
Added applyGpsPrefs() (matching the pattern in simple_repeater,
simple_sensor, and simple_room_server) and call it from main.cpp
after sensors.begin() to ensure the GPS hardware is initialized
before the saved preference is applied.
- Change > to >= so stored value 1 means direct/0-hop only (liamcottle)
- Clamp max_hops to 63 on write since getPathHashCount() caps at 63 (robekl)
- Update comments to reflect encoding: 0=no limit, 1=direct only, N=up to N-1 hops
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Filter auto-add of new contacts by hop count (issues #1533, #1546).
Setting is configurable from the companion app via extended
CMD_SET/GET_AUTOADD_CONFIG protocol (0 = no limit, 1-63 = max hops).
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Instead of overloading getOutboundCount() with a magic sentinel value,
add a dedicated getOutboundTotal() method to the PacketManager interface
that returns the total queue size without time filtering.
This eliminates the fragile convention that caused the regression and
makes the two operations — time-filtered count vs total count —
explicitly separate in the API.
* companion: new field in CMD_SET_OTHER_PARAMS, path_hash_mode
* companion: CMD_SEND_SELF_ADVERT, cmd_frame[1] now holds the path hash size (0 = zero hop, 1..3 = flood path hash size)