Files
firmware/variants
James Rich c8060ced96 nRF52 dial: encrypt a dialled link with the phone-API bond, since a refused security request drops it
Declining the security request (86bddc0bd) was untested against a bonded phone.
Measured 2026-09-19 with a Pixel bonded to this radio's phone API and its
monitor peripheral-only: every dial went "declined the security request" ->
"characteristic not found" -> disconnected 0x05 within a second, 26 times in a
row. Android drops a link whose security request is refused; it does not carry
on unencrypted.

So honour the bond instead. The pairing that made it had this radio as the
peripheral, so the keys live in the peripheral bond store whatever role this
link has, and bond_load_keys resolves the phone's private address by IRK itself.
The key to start encryption with as the central is the one the phone
distributed (peer_enc); sd_ble_gap_encrypt with it gives "BLE connection
secured" one second after the dial, then the mesh peer, the HELLO and a link
that held through the liveness probes. A peer with no bond is still declined.

Also a bench-only env, rak4631_blemesh_uuid, which adds BLE_GATT_MESH_DIAL_UUID
on top of rak4631_blemesh so a dual-role phone can be dialled on purpose - the
way this was measured. PLATFORMIO_BUILD_FLAGS replaces an extended env's flags,
so it cannot be used for this.
2026-09-19 18:48:19 -05:00
..