mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-28 16:23:31 +00:00
fix(nimble): Fixed incorrect handling of bonded devices
This commit is contained in:
@@ -5965,7 +5965,7 @@ ble_gap_unpair(const ble_addr_t *peer_addr)
|
||||
int
|
||||
ble_gap_unpair_oldest_peer(void)
|
||||
{
|
||||
ble_addr_t oldest_peer_id_addr;
|
||||
ble_addr_t oldest_peer_id_addr[MYNEWT_VAL(BLE_STORE_MAX_BONDS)];
|
||||
int num_peers;
|
||||
int rc;
|
||||
|
||||
@@ -5974,7 +5974,7 @@ ble_gap_unpair_oldest_peer(void)
|
||||
}
|
||||
|
||||
rc = ble_store_util_bonded_peers(
|
||||
&oldest_peer_id_addr, &num_peers, 1);
|
||||
&oldest_peer_id_addr[0], &num_peers, MYNEWT_VAL(BLE_STORE_MAX_BONDS));
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
@@ -5983,7 +5983,7 @@ ble_gap_unpair_oldest_peer(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = ble_gap_unpair(&oldest_peer_id_addr);
|
||||
rc = ble_gap_unpair(&oldest_peer_id_addr[0]);
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user