mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-22 05:00:55 +01:00
feat(NimBLEDevice): deleteAllBonds() Add return value (#158)
Add return value to `deleteAllBonds`.
This commit is contained in:
parent
32c213a8a3
commit
6ca61bbd9c
2 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue