Skip to content

Commit 9e509f4

Browse files
fix incorrect parameter check in periodic advertising
1 parent 5283c4f commit 9e509f4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

connectivity/FEATURE_BLE/source/generic/GapImpl.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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)