Clear bluetooth bonds on multi-press and factory_reset (#1176)

* Clear bluetooth bonds on multi-press and factory_reset
This commit is contained in:
Ben Meadors
2022-02-01 18:32:26 -06:00
committed by GitHub
parent dd31a829fb
commit b21b7de04b
6 changed files with 40 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
#include "mesh/PhoneAPI.h"
#include "mesh/mesh-pb-constants.h"
#include <bluefruit.h>
#include <utility/bonding.h>
static BLEService meshBleService = BLEService(BLEUuid(MESH_SERVICE_UUID_16));
static BLECharacteristic fromNum = BLECharacteristic(BLEUuid(FROMNUM_UUID_16));
@@ -266,3 +267,13 @@ void updateBatteryLevel(uint8_t level)
{
blebas.write(level);
}
void NRF52Bluetooth::clearBonds()
{
DEBUG_MSG("Clearing bluetooth bonds!\n");
bond_print_list(BLE_GAP_ROLE_PERIPH);
bond_print_list(BLE_GAP_ROLE_CENTRAL);
Bluefruit.Periph.clearBonds();
Bluefruit.Central.clearBonds();
}