Skip to content

Commit

Permalink
NRF: getAddress(1) falls back to default if setAddress() uncalled
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Jun 16, 2024
1 parent 8c3a58e commit 521ca36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/bluetooth/jswrap_bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ device's advertised Bluetooth name.
*/
JsVar *jswrap_ble_getAddress(JsVar *current) {
if (jsvGetBool(current)) {
return jsvObjectGetChildIfExists(execInfo.hiddenRoot, BLE_NAME_MAC_ADDRESS);
JsVar *addr = jsvObjectGetChildIfExists(execInfo.hiddenRoot, BLE_NAME_MAC_ADDRESS);
if (addr) return addr;
}
#ifdef NRF5X
uint32_t addr0 = NRF_FICR->DEVICEADDR[0];
Expand Down

0 comments on commit 521ca36

Please sign in to comment.