Skip to content

Commit

Permalink
Remove address from whitelist if the procedure fails.
Browse files Browse the repository at this point in the history
This prevents a situation where the whitelist contains the address but the procedure errors and the address cannot be added again.
  • Loading branch information
h2zero committed Jun 13, 2024
1 parent 479af4a commit 7defa12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/NimBLEDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ bool NimBLEDevice::whiteListAdd(const NimBLEAddress & address) {
int rc = ble_gap_wl_set(&wlVec[0], wlVec.size());
if (rc != 0) {
NIMBLE_LOGE(LOG_TAG, "Failed adding to whitelist rc=%d", rc);
m_whiteList.pop_back();
return false;
}

Expand Down

0 comments on commit 7defa12

Please sign in to comment.