Skip to content

Commit 9f09bb4

Browse files
rename private address controller to match security manager
1 parent 3f9798b commit 9f09bb4

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

connectivity/FEATURE_BLE/source/generic/GapImpl.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ Gap::Gap(
340340
ble::PalGap &pal_gap,
341341
ble::PalGenericAccessService &generic_access_service
342342
#if BLE_FEATURE_PRIVACY
343-
, ble::PrivateAddressController &pal_addr_reg
343+
, ble::PrivateAddressController &private_address_controller
344344
#endif //BLE_FEATURE_PRIVACY
345345
) : _event_queue(event_queue),
346346
_pal_gap(pal_gap),
347347
_gap_service(generic_access_service),
348348
#if BLE_FEATURE_PRIVACY
349-
_address_registry(pal_addr_reg),
349+
_private_address_controller(private_address_controller),
350350
#endif // BLE_FEATURE_PRIVACY
351351
_address_type(own_address_type_t::PUBLIC),
352352
_initiator_policy_mode(initiator_policy_t::NO_FILTER),
@@ -378,7 +378,7 @@ Gap::Gap(
378378

379379
_pal_gap.set_event_handler(this);
380380
#if BLE_FEATURE_PRIVACY
381-
_address_registry.set_event_handler(this);
381+
_private_address_controller.set_event_handler(this);
382382
#endif // BLE_FEATURE_PRIVACY
383383
}
384384

@@ -973,9 +973,9 @@ ble_error_t Gap::enablePrivacy(bool enable)
973973
_privacy_enabled = enable;
974974

975975
if (_privacy_enabled) {
976-
_address_registry.start_private_address_generation();
977-
if (_address_registry.get_non_resolvable_private_address() != address_t {} &&
978-
_address_registry.get_resolvable_private_address() != address_t{}
976+
_private_address_controller.start_private_address_generation();
977+
if (_private_address_controller.get_non_resolvable_private_address() != address_t {} &&
978+
_private_address_controller.get_resolvable_private_address() != address_t{}
979979
) {
980980
_event_queue.post([this] {
981981
if (_event_handler) {
@@ -986,12 +986,12 @@ ble_error_t Gap::enablePrivacy(bool enable)
986986
_privacy_initialization_pending = true;
987987
}
988988
} else {
989-
_address_registry.stop_private_address_generation();
989+
_private_address_controller.stop_private_address_generation();
990990
_privacy_initialization_pending = false;
991991
}
992992

993993
#if !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
994-
if (_address_registry.is_controller_privacy_supported()) {
994+
if (_private_address_controller.is_controller_privacy_supported()) {
995995
update_ll_address_resolution_setting();
996996
}
997997
#endif // !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
@@ -1010,7 +1010,7 @@ ble_error_t Gap::setPeripheralPrivacyConfiguration(
10101010
_peripheral_privacy_configuration = *configuration;
10111011

10121012
#if !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
1013-
if (_address_registry.is_controller_privacy_supported()) {
1013+
if (_private_address_controller.is_controller_privacy_supported()) {
10141014
update_ll_address_resolution_setting();
10151015
}
10161016
#endif // !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
@@ -1038,7 +1038,7 @@ ble_error_t Gap::setCentralPrivacyConfiguration(
10381038
_central_privacy_configuration = *configuration;
10391039

10401040
#if !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
1041-
if (_address_registry.is_controller_privacy_supported()) {
1041+
if (_private_address_controller.is_controller_privacy_supported()) {
10421042
update_ll_address_resolution_setting();
10431043
}
10441044
#endif // !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
@@ -1589,7 +1589,7 @@ ble_error_t Gap::update_ll_address_resolution_setting()
15891589
#endif // BLE_ROLE_OBSERVER
15901590
}
15911591

1592-
return _address_registry.enable_controller_address_resolution(enable);
1592+
return _private_address_controller.enable_controller_address_resolution(enable);
15931593
}
15941594
#endif // BLE_FEATURE_PRIVACY && !BLE_GAP_HOST_BASED_PRIVATE_ADDRESS_RESOLUTION
15951595

@@ -2451,7 +2451,7 @@ void Gap::signal_connection_complete(
24512451

24522452
/* first try to resolve synchronously in cache */
24532453
if (!address_resolved) {
2454-
address_resolved = _address_registry.resolve_address_in_host_cache(
2454+
address_resolved = _private_address_controller.resolve_address_in_host_cache(
24552455
event.getPeerAddress(),
24562456
&peer_address_type,
24572457
&peer_address
@@ -2476,7 +2476,7 @@ void Gap::signal_connection_complete(
24762476
_event_handler->onConnectionComplete(event);
24772477
} else {
24782478
bool resolution_pending = false;
2479-
ble_error_t ret = _address_registry.queue_resolve_address_on_host(event.getPeerAddress());
2479+
ble_error_t ret = _private_address_controller.queue_resolve_address_on_host(event.getPeerAddress());
24802480

24812481
if (ret == BLE_ERROR_NONE) {
24822482
ConnectionCompleteEvent* event_copy = new(std::nothrow) ConnectionCompleteEvent(event);
@@ -2532,7 +2532,7 @@ bool Gap::apply_peripheral_privacy_connection_policy(
25322532
switch (_peripheral_privacy_configuration.resolution_strategy) {
25332533
case peripheral_privacy_configuration_t::REJECT_NON_RESOLVED_ADDRESS:
25342534
/* if there is no bond then allow unresolved addresses */
2535-
if (_address_registry.read_resolving_list_size() == 0) {
2535+
if (_private_address_controller.read_resolving_list_size() == 0) {
25362536
return true;
25372537
}
25382538
_pal_gap.disconnect(
@@ -2576,7 +2576,7 @@ void Gap::conclude_signal_connection_complete_after_address_resolution(
25762576
if (identity_address) {
25772577
/* move old address to resolvable address */
25782578
event.setPeerResolvablePrivateAddress(event.getPeerAddress());
2579-
event.setLocalResolvablePrivateAddress(_address_registry.get_resolvable_private_address());
2579+
event.setLocalResolvablePrivateAddress(_private_address_controller.get_resolvable_private_address());
25802580

25812581
event.setPeerAddress(*identity_address);
25822582
event.setPeerAddressType(identity_address_type == target_peer_address_type_t::RANDOM ?
@@ -2616,7 +2616,7 @@ void Gap::signal_advertising_report(
26162616
const address_t *peer_address = nullptr;
26172617
target_peer_address_type_t peer_address_type(target_peer_address_type_t::RANDOM);
26182618

2619-
address_resolved = _address_registry.resolve_address_in_host_cache(
2619+
address_resolved = _private_address_controller.resolve_address_in_host_cache(
26202620
event.getPeerAddress(),
26212621
&peer_address_type,
26222622
&peer_address
@@ -2663,7 +2663,7 @@ void Gap::signal_advertising_report(
26632663

26642664
/* if there is already an item with the same address pending don't kick off resolution*/
26652665
if (!duplicate_pending_event) {
2666-
ret = _address_registry.queue_resolve_address_on_host(event.getPeerAddress());
2666+
ret = _private_address_controller.queue_resolve_address_on_host(event.getPeerAddress());
26672667
}
26682668

26692669
if (ret == BLE_ERROR_NONE) {
@@ -2678,7 +2678,7 @@ void Gap::signal_advertising_report(
26782678
}
26792679
#else
26802680
/* filter out unresolved address if at least one bond exists */
2681-
if (_address_registry.read_resolving_list_size() > 0 &&
2681+
if (_private_address_controller.read_resolving_list_size() > 0 &&
26822682
_central_privacy_configuration.resolution_strategy == central_privacy_configuration_t::RESOLVE_AND_FILTER &&
26832683
event.getPeerAddressType() != peer_address_type_t::PUBLIC &&
26842684
is_random_private_resolvable_address(event.getPeerAddress())) {
@@ -2724,7 +2724,7 @@ void Gap::conclude_signal_advertising_report_after_address_resolution(
27242724
event.setPeerAddressType(peer_address_type);
27252725
} else if (_central_privacy_configuration.resolution_strategy ==
27262726
central_privacy_configuration_t::RESOLVE_AND_FILTER &&
2727-
_address_registry.read_resolving_list_size() > 0) {
2727+
_private_address_controller.read_resolving_list_size() > 0) {
27282728
/* filter out unresolved address if at least one bond exists */
27292729
return;
27302730
}
@@ -3333,8 +3333,8 @@ void Gap::on_private_address_generated(bool connectable)
33333333
}
33343334

33353335
if (_privacy_initialization_pending &&
3336-
_address_registry.get_resolvable_private_address() != address_t{} &&
3337-
_address_registry.get_non_resolvable_private_address() != address_t{}
3336+
_private_address_controller.get_resolvable_private_address() != address_t{} &&
3337+
_private_address_controller.get_non_resolvable_private_address() != address_t{}
33383338
) {
33393339
_privacy_initialization_pending = false;
33403340
if (_event_handler) {
@@ -3475,8 +3475,8 @@ const address_t *Gap::get_random_address(controller_operation_t operation, size_
34753475
}
34763476

34773477
#if BLE_FEATURE_PRIVACY
3478-
const auto &resolvable_address = _address_registry.get_resolvable_private_address();
3479-
const auto &non_resolvable_address = _address_registry.get_non_resolvable_private_address();
3478+
const auto &resolvable_address = _private_address_controller.get_resolvable_private_address();
3479+
const auto &non_resolvable_address = _private_address_controller.get_non_resolvable_private_address();
34803480

34813481
#if BLE_ROLE_OBSERVER
34823482
bool central_non_resolvable = _central_privacy_configuration.use_non_resolvable_random_address;

connectivity/FEATURE_BLE/source/generic/GapImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ class Gap :
555555
ble::PalGap &pal_gap,
556556
ble::PalGenericAccessService &generic_access_service
557557
#if BLE_FEATURE_PRIVACY
558-
, ble::PrivateAddressController &pal_addr_reg
558+
, ble::PrivateAddressController &private_address_controller
559559
#endif // BLE_FEATURE_PRIVACY
560560
);
561561

@@ -874,7 +874,7 @@ class Gap :
874874
PalGap &_pal_gap;
875875
PalGenericAccessService &_gap_service;
876876
#if BLE_FEATURE_PRIVACY
877-
PrivateAddressController &_address_registry;
877+
PrivateAddressController &_private_address_controller;
878878
#endif // BLE_FEATURE_PRIVACY
879879
ble::own_address_type_t _address_type;
880880
initiator_policy_t _initiator_policy_mode;

0 commit comments

Comments
 (0)