fix(bluetooth): auto-reconnect to paired devices after reboot

- Auto-set enableOnBoot=true when BT is enabled or device is paired,
  so board restarts with BT on and can reconnect
- Make RADIO_STATE_ON handler non-exclusive: scan for HID Host,
  start HID Device, SPP and MIDI all independently (was else-if)
- Improve HID Host auto-connect for RPA: direct addr match, name-match
  fallback, and direct connect to stored identity using resolving list
- Persist addrType in PairedDevice file for more reliable reconnection
- Add verbose logging for loadAll/save to debug missing files

Fixes issue where board restart did not reconnect to previously
connected BT devices. Also preserves f94cc160 fullscreen flag feature.
This commit is contained in:
Adolfo Reyna
2026-07-19 19:31:57 -04:00
parent f94cc160cf
commit 80bd1c9f20
4 changed files with 149 additions and 34 deletions
@@ -13,6 +13,8 @@ struct PairedDevice {
bool autoConnect = false;
/** Profile used to pair (BtProfileId value). Defaults to BT_PROFILE_SPP=2. */
int profileId = 2;
/** BLE address type (0=PUBLIC, 1=RANDOM, etc). Defaults to PUBLIC for backward compat. */
uint8_t addrType = 0;
};
std::string addrToHex(const std::array<uint8_t, 6>& addr);