Skip to content

Commit 6db63e4

Browse files
authored
Merge pull request #13822 from paul-szczepanek-arm/fix-preiod
BLE fix periodic advertising list function parameter checking
2 parents 2f87d59 + 34c75ff commit 6db63e4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

connectivity/FEATURE_BLE/source/generic/GapImpl.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,7 +2863,7 @@ void Gap::on_advertising_set_started(const mbed::Span<const uint8_t>& handles)
28632863
_adv_started_from_refresh.clear(handle);
28642864
} else if (_event_handler) {
28652865
_event_handler->onAdvertisingStart(
2866-
AdvertisingStartEvent(LEGACY_ADVERTISING_HANDLE)
2866+
AdvertisingStartEvent(handle)
28672867
);
28682868
}
28692869
}
@@ -3219,9 +3219,8 @@ ble_error_t Gap::addDeviceToPeriodicAdvertiserList(
32193219
return BLE_ERROR_NOT_IMPLEMENTED;
32203220
}
32213221

3222-
if (peerAddressType != peer_address_type_t::PUBLIC ||
3223-
peerAddressType != peer_address_type_t::RANDOM
3224-
) {
3222+
if ((peerAddressType != peer_address_type_t::PUBLIC) &&
3223+
(peerAddressType != peer_address_type_t::RANDOM)) {
32253224
return BLE_ERROR_INVALID_PARAM;
32263225
}
32273226

@@ -3251,9 +3250,8 @@ ble_error_t Gap::removeDeviceFromPeriodicAdvertiserList(
32513250
return BLE_ERROR_NOT_IMPLEMENTED;
32523251
}
32533252

3254-
if (peerAddressType != peer_address_type_t::PUBLIC ||
3255-
peerAddressType != peer_address_type_t::RANDOM
3256-
) {
3253+
if ((peerAddressType != peer_address_type_t::PUBLIC) &&
3254+
(peerAddressType != peer_address_type_t::RANDOM)) {
32573255
return BLE_ERROR_INVALID_PARAM;
32583256
}
32593257

0 commit comments

Comments
 (0)