From f2a43084973f7fd3e58029a654cf529ddf4d1ba9 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Thu, 17 Mar 2022 19:10:58 +0000 Subject: [PATCH] remove /prefs for nrf factory reset --- src/mesh/NodeDB.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 8c64c6f10..1d3367fd0 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -95,14 +95,16 @@ bool NodeDB::resetRadioConfig() nvs_flash_erase(); #endif #ifdef NRF52_SERIES - Bluefruit.begin(); + FS.rmdir_r("/prefs"); - DEBUG_MSG("Clearing bluetooth bonds!\n"); - bond_print_list(BLE_GAP_ROLE_PERIPH); - bond_print_list(BLE_GAP_ROLE_CENTRAL); + Bluefruit.begin(); - Bluefruit.Periph.clearBonds(); - Bluefruit.Central.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(); #endif didFactoryReset = true; }