mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #14921 from paul-szczepanek-arm/fix-ble-default-db
BLE: suppress error when no path is passed in for ble security dbpull/14941/head
commit
c9234177c1
|
@ -1210,15 +1210,23 @@ ble_error_t SecurityManager::init_database(
|
||||||
const char *db_path
|
const char *db_path
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
tr_info("Initialize database. Path = %s", db_path);
|
tr_info("Initialize database.");
|
||||||
delete _db;
|
delete _db;
|
||||||
|
|
||||||
#if BLE_SECURITY_DATABASE_FILESYSTEM
|
#if BLE_SECURITY_DATABASE_FILESYSTEM
|
||||||
FILE* db_file = FileSecurityDb::open_db_file(db_path);
|
FILE* db_file = nullptr;
|
||||||
|
if (db_path) {
|
||||||
|
tr_info("Using filesystem path = %s", db_path);
|
||||||
|
db_file = FileSecurityDb::open_db_file(db_path);
|
||||||
|
}
|
||||||
|
|
||||||
if (db_file) {
|
if (db_file) {
|
||||||
_db = new (std::nothrow) FileSecurityDb(db_file);
|
_db = new (std::nothrow) FileSecurityDb(db_file);
|
||||||
} else
|
} else
|
||||||
|
#else
|
||||||
|
if (db_path) {
|
||||||
|
tr_error("Passed in a path for BLE security DB init but BLE_SECURITY_DATABASE_FILESYSTEM is disabled");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if BLE_SECURITY_DATABASE_KVSTORE
|
#if BLE_SECURITY_DATABASE_KVSTORE
|
||||||
if (KVStoreSecurityDb::open_db()) {
|
if (KVStoreSecurityDb::open_db()) {
|
||||||
|
|
Loading…
Reference in New Issue