File tree Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Expand file tree Collapse file tree 4 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ class FileSecurityDb : public SecurityDb {
34
34
size_t file_offset;
35
35
};
36
36
37
- static const size_t MAX_ENTRIES = 5 ;
38
-
39
37
static entry_t * as_entry (entry_handle_t db_handle) {
40
38
return reinterpret_cast <entry_t *>(db_handle);
41
39
}
@@ -146,7 +144,7 @@ class FileSecurityDb : public SecurityDb {
146
144
static FILE* erase_db_file (FILE* db_file);
147
145
148
146
private:
149
- entry_t _entries[MAX_ENTRIES ];
147
+ entry_t _entries[BLE_SECURITY_DATABASE_MAX_ENTRIES ];
150
148
FILE *_db_file;
151
149
uint8_t _buffer[sizeof (SecurityEntryKeys_t)];
152
150
};
Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ class MemorySecurityDb : public SecurityDb {
34
34
SecurityEntrySigning_t peer_signing;
35
35
};
36
36
37
- static const size_t MAX_ENTRIES = 5 ;
38
-
39
37
static entry_t * as_entry (entry_handle_t db_handle)
40
38
{
41
39
return reinterpret_cast <entry_t *>(db_handle);
@@ -150,11 +148,11 @@ class MemorySecurityDb : public SecurityDb {
150
148
151
149
private:
152
150
virtual uint8_t get_entry_count () {
153
- return MAX_ENTRIES ;
151
+ return BLE_SECURITY_DATABASE_MAX_ENTRIES ;
154
152
}
155
153
156
154
virtual SecurityDistributionFlags_t* get_entry_handle_by_index (uint8_t index) {
157
- if (index < MAX_ENTRIES ) {
155
+ if (index < BLE_SECURITY_DATABASE_MAX_ENTRIES ) {
158
156
return &_entries[index].flags ;
159
157
} else {
160
158
return NULL ;
@@ -187,7 +185,7 @@ class MemorySecurityDb : public SecurityDb {
187
185
};
188
186
189
187
private:
190
- entry_t _entries[MAX_ENTRIES ];
188
+ entry_t _entries[BLE_SECURITY_DATABASE_MAX_ENTRIES ];
191
189
};
192
190
193
191
} /* namespace pal */
Original file line number Diff line number Diff line change 71
71
"help" : " Include periodic advertising support, depends on the extended advertising feature." ,
72
72
"value" : true ,
73
73
"macro_name" : " BLE_FEATURE_PERIODIC_ADVERTISING"
74
+ },
75
+ "ble-security-database-max-entries" : {
76
+ "help" : " How many entries can be stored in the db, depends on security manager." ,
77
+ "value" : 5 ,
78
+ "macro_name" : " BLE_SECURITY_DATABASE_MAX_ENTRIES"
74
79
}
75
80
}
76
81
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const uint16_t DB_VERSION = 1;
54
54
)
55
55
56
56
#define DB_SIZE_STORES \
57
- (FileSecurityDb::MAX_ENTRIES * DB_SIZE_STORE)
57
+ (BLE_SECURITY_DATABASE_MAX_ENTRIES * DB_SIZE_STORE)
58
58
59
59
#define DB_OFFSET_VERSION (0 )
60
60
#define DB_OFFSET_RESTORE (DB_OFFSET_VERSION + sizeof (DB_VERSION))
@@ -308,11 +308,11 @@ void FileSecurityDb::set_restore(bool reload) {
308
308
/* helper functions */
309
309
310
310
uint8_t FileSecurityDb::get_entry_count () {
311
- return MAX_ENTRIES ;
311
+ return BLE_SECURITY_DATABASE_MAX_ENTRIES ;
312
312
}
313
313
314
314
SecurityDistributionFlags_t* FileSecurityDb::get_entry_handle_by_index (uint8_t index) {
315
- if (index < MAX_ENTRIES ) {
315
+ if (index < BLE_SECURITY_DATABASE_MAX_ENTRIES ) {
316
316
return &_entries[index].flags ;
317
317
} else {
318
318
return NULL ;
You can’t perform that action at this time.
0 commit comments