diff --git a/libraries/Bluefruit52Lib/src/utility/bonding.cpp b/libraries/Bluefruit52Lib/src/utility/bonding.cpp index c4bf8c22..5bef0bec 100644 --- a/libraries/Bluefruit52Lib/src/utility/bonding.cpp +++ b/libraries/Bluefruit52Lib/src/utility/bonding.cpp @@ -238,6 +238,11 @@ static void bond_save_cccd_dfr (uint8_t role, uint16_t conn_hdl, ble_gap_addr_t do_write = false; BOND_LOG("CCCD matches file %s contents, no need to write", filename); } + else + { + // restore the position to the state before reading old_data for writing + file.seek(file.size() - (len + 1)); + } } if (do_write)