h2zero / NimBLE-Arduino

A fork of the NimBLE library structured for compilation with Arduino, for use with ESP32, nRF5x.
https://h2zero.github.io/NimBLE-Arduino/
Apache License 2.0
670 stars 138 forks source link

Issue with deleting bonded peer address #579

Open EduardGub opened 11 months ago

EduardGub commented 11 months ago

Hi,

Background: Im using a custom board with ESP32-WROOM-32D and Arduino framework (using platformio), operating as a BLE central device.

Issue: When trying to delete a specific bonded peer (by its address) using NimBLEDevice::deleteBond([peerAddress]), the function returns true meaning success. BUT upon requesting the number of bonds available using NimBLEDevice::getNumBonds() the returned value remains unchanged as been prior to deleteBond function. Checking for NimBLEDevice::IsBonded([peerAddress]) AFTER deleting bond also returns true meaning the address is still bonded.

Note: I'm not having any other issues with connecting or communicating with peripherals.

Specific versions: framework-arduinoespressif32 @ 3.20009.0 (2.0.9) NimBLE-Arduino @ 1.4.1

h2zero commented 10 months ago

Thanks, I'll try to reproduce this.

EduardGub commented 10 months ago

Some additional information: It seems like the NimBLEDevice::deleteAllBonds() functions does the job but deletes all bonds even the ones I'm still interested in keeping. I've glanced through both "deleteAllBonds" and "deleteBond" functions and it looks like both functions perform different operation for deleting a bond. I guess the issue is related to that?

h2zero commented 10 months ago

This may be an issue with the underlying nimble core. I'll have a look into it when I can.