@@ -54,7 +54,7 @@ const uint16_t DB_VERSION = 1;
5454 )
5555
5656#define DB_SIZE_STORES \
57- (FileSecurityDb::MAX_ENTRIES * DB_SIZE_STORE)
57+ (BLE_SECURITY_DATABASE_MAX_ENTRIES * DB_SIZE_STORE)
5858
5959#define DB_OFFSET_VERSION (0 )
6060#define DB_OFFSET_RESTORE (DB_OFFSET_VERSION + sizeof (DB_VERSION))
@@ -265,6 +265,29 @@ void FileSecurityDb::set_entry_peer_sign_counter(
265265 }
266266}
267267
268+ void FileSecurityDb::set_local_csrk (
269+ const csrk_t &csrk
270+ ) {
271+ this ->SecurityDb ::set_local_csrk (csrk);
272+ db_write (&_local_csrk, DB_OFFSET_LOCAL_CSRK);
273+ }
274+
275+ void FileSecurityDb::set_local_sign_counter (
276+ sign_count_t sign_counter
277+ ) {
278+ this ->SecurityDb ::set_local_sign_counter (sign_counter);
279+ db_write (&_local_sign_counter, DB_OFFSET_LOCAL_SIGN_COUNT);
280+ }
281+
282+ void FileSecurityDb::set_local_identity (
283+ const irk_t &irk,
284+ const address_t &identity_address,
285+ bool public_address
286+ ) {
287+ this ->SecurityDb ::set_local_identity (irk, identity_address, public_address);
288+ db_write (&_local_identity, DB_OFFSET_LOCAL_IDENTITY);
289+ }
290+
268291/* saving and loading from nvm */
269292
270293void FileSecurityDb::restore () {
@@ -308,11 +331,11 @@ void FileSecurityDb::set_restore(bool reload) {
308331/* helper functions */
309332
310333uint8_t FileSecurityDb::get_entry_count () {
311- return MAX_ENTRIES ;
334+ return BLE_SECURITY_DATABASE_MAX_ENTRIES ;
312335}
313336
314337SecurityDistributionFlags_t* FileSecurityDb::get_entry_handle_by_index (uint8_t index) {
315- if (index < MAX_ENTRIES ) {
338+ if (index < BLE_SECURITY_DATABASE_MAX_ENTRIES ) {
316339 return &_entries[index].flags ;
317340 } else {
318341 return NULL ;
0 commit comments