Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BLE: always return privacy info from NRF.getSecurityStatus() #2584

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
: nRF5x: ensure TIMER1_IRQHandler doesn't always wake idle loop up (fix #1900)
Puck.js: On v2.1 ensure Puck.mag behaves like other variants - just returning the last reading (avoids glitches when used with Puck.magOn)
Fix escaping of `\r` in built-in modules, fixed regression that stopped Espruino WiFi 2v25 from connecting to Wifi
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)
6 changes: 3 additions & 3 deletions targets/nrf5x/bluetooth.c
Original file line number Diff line number Diff line change
@@ -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;
@@ -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));
Loading