feat(NimBLEDevice): deleteAllBonds() Add return value (#158)

Add return value to `deleteAllBonds`.
This commit is contained in:
William Emfinger 2024-06-04 17:52:55 -05:00 committed by GitHub
parent 32c213a8a3
commit 6ca61bbd9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -567,10 +567,16 @@ int NimBLEDevice::getNumBonds() {
/** /**
* @brief Deletes all bonding information. * @brief Deletes all bonding information.
* @returns true on success, false on failure.
*/ */
/*STATIC*/ /*STATIC*/
void NimBLEDevice::deleteAllBonds() { bool NimBLEDevice::deleteAllBonds() {
ble_store_clear(); int rc = ble_store_clear();
if (rc != 0) {
NIMBLE_LOGE(LOG_TAG, "Failed to delete all bonds; rc=%d", rc);
return false;
}
return true;
} }

View file

@ -172,7 +172,7 @@ public:
static bool deleteBond(const NimBLEAddress &address); static bool deleteBond(const NimBLEAddress &address);
static int getNumBonds(); static int getNumBonds();
static bool isBonded(const NimBLEAddress &address); static bool isBonded(const NimBLEAddress &address);
static void deleteAllBonds(); static bool deleteAllBonds();
static NimBLEAddress getBondedAddress(int index); static NimBLEAddress getBondedAddress(int index);
#endif #endif