Skip to content

Commit 9db92fb

Browse files
authored
Merge pull request #586 from ogatatsu/cccd
fixed a bug that saved cccd data to a different offset after the second time.
2 parents 944d7d3 + 771b7cf commit 9db92fb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/Bluefruit52Lib/src/utility/bonding.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ static void bond_save_cccd_dfr (uint8_t role, uint16_t conn_hdl, ble_gap_addr_t
238238
do_write = false;
239239
BOND_LOG("CCCD matches file %s contents, no need to write", filename);
240240
}
241+
else
242+
{
243+
// restore the position to the state before reading old_data for writing
244+
file.seek(file.size() - (len + 1));
245+
}
241246
}
242247

243248
if (do_write)

0 commit comments

Comments
 (0)