Skip to content

Commit c923417

Browse files
authored
Merge pull request #14921 from paul-szczepanek-arm/fix-ble-default-db
BLE: suppress error when no path is passed in for ble security db
2 parents 1a7175d + 8a4b278 commit c923417

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

connectivity/FEATURE_BLE/source/generic/SecurityManagerImpl.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,15 +1210,23 @@ ble_error_t SecurityManager::init_database(
12101210
const char *db_path
12111211
)
12121212
{
1213-
tr_info("Initialize database. Path = %s", db_path);
1213+
tr_info("Initialize database.");
12141214
delete _db;
12151215

12161216
#if BLE_SECURITY_DATABASE_FILESYSTEM
1217-
FILE* db_file = FileSecurityDb::open_db_file(db_path);
1217+
FILE* db_file = nullptr;
1218+
if (db_path) {
1219+
tr_info("Using filesystem path = %s", db_path);
1220+
db_file = FileSecurityDb::open_db_file(db_path);
1221+
}
12181222

12191223
if (db_file) {
12201224
_db = new (std::nothrow) FileSecurityDb(db_file);
12211225
} else
1226+
#else
1227+
if (db_path) {
1228+
tr_error("Passed in a path for BLE security DB init but BLE_SECURITY_DATABASE_FILESYSTEM is disabled");
1229+
}
12221230
#endif
12231231
#if BLE_SECURITY_DATABASE_KVSTORE
12241232
if (KVStoreSecurityDb::open_db()) {

0 commit comments

Comments
 (0)