Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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,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
Loading