Skip to content

Commit

Permalink
BLE: always return privacy info from NRF.getSecurityStatus()
Browse files Browse the repository at this point in the history
regardless of connection state
  • Loading branch information
ssievert42 committed Jan 5, 2025
1 parent 1d58afe commit 522534e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
: nRF5x: ensure TIMER1_IRQHandler doesn't always wake idle loop up (fix #1900)
BLE: always return privacy info from NRF.getSecurityStatus(), regardless of connection state

2v25 : ESP32C3: Get analogRead working correctly
Graphics: Adjust image alignment when rotating images to avoid cropping (fix #2535)
Expand Down
6 changes: 3 additions & 3 deletions targets/nrf5x/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,9 @@ JsVar *jsble_get_security_status(uint16_t conn_handle) {
if (conn_handle == m_peripheral_conn_handle) {
jsvObjectSetChildAndUnLock(result, "connectionInterval", jsvNewFromInteger(blePeriphConnectionInterval));
}
#ifdef ESPR_BLE_PRIVATE_ADDRESS_SUPPORT
jsvObjectSetChildAndUnLock(result, "privacy", jsble_getPrivacy());
#endif // ESPR_BLE_PRIVATE_ADDRESS_SUPPORT
if (conn_handle == BLE_CONN_HANDLE_INVALID) {
jsvObjectSetChildAndUnLock(result, "connected", jsvNewFromBool(false));
return result;
Expand All @@ -3422,9 +3425,6 @@ JsVar *jsble_get_security_status(uint16_t conn_handle) {
jsvObjectSetChildAndUnLock(result, "encrypted", jsvNewFromBool(status.encrypted));
jsvObjectSetChildAndUnLock(result, "mitm_protected", jsvNewFromBool(status.mitm_protected));
jsvObjectSetChildAndUnLock(result, "bonded", jsvNewFromBool(status.bonded));
#ifdef ESPR_BLE_PRIVATE_ADDRESS_SUPPORT
jsvObjectSetChildAndUnLock(result, "privacy", jsble_getPrivacy());
#endif // ESPR_BLE_PRIVATE_ADDRESS_SUPPORT
#ifndef SAVE_ON_FLASH
if (status.connected && conn_handle==m_peripheral_conn_handle)
jsvObjectSetChildAndUnLock(result, "connected_addr", bleAddrToStr(m_peripheral_addr));
Expand Down

0 comments on commit 522534e

Please sign in to comment.