File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
connectivity/FEATURE_BLE/source/generic Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1038,8 +1038,12 @@ ble_error_t SecurityManager::init_identity()
1038
1038
ble::Gap& gap = BLE::Instance ().gap ();
1039
1039
1040
1040
irk_t irk = _db->get_local_irk ();
1041
+ address_t identity_address;
1042
+ bool public_identity_address = false ;
1041
1043
if (irk != irk_t ()) {
1042
1044
pirk = &irk;
1045
+ public_identity_address = _db->is_local_identity_address_public ();
1046
+ identity_address = _db->get_local_identity_address ();
1043
1047
1044
1048
if (!_db->is_local_identity_address_public ()) {
1045
1049
// Some controllers doesn't store their random static address and
@@ -1060,16 +1064,15 @@ ble_error_t SecurityManager::init_identity()
1060
1064
}
1061
1065
1062
1066
pirk = &irk;
1063
- address_t random_static_address = gap.getRandomStaticAddress ();
1064
- if (ret != BLE_ERROR_NONE) {
1065
- return ret;
1066
- }
1067
- _db->set_local_identity (irk, random_static_address, /* public_address */ false );
1067
+ public_identity_address = false ;
1068
+ identity_address = gap.getRandomStaticAddress ();
1069
+ _db->set_local_identity (irk, identity_address, public_identity_address);
1068
1070
}
1069
1071
1070
1072
auto err = _pal.set_irk (*pirk);
1071
1073
if (!err) {
1072
1074
_private_address_controller.set_local_irk (*pirk);
1075
+ _pal.set_identity_address (identity_address, public_identity_address);
1073
1076
}
1074
1077
return err;
1075
1078
}
You can’t perform that action at this time.
0 commit comments