From 9e509f435bb926d6e97228e3ca77925a88a6b711 Mon Sep 17 00:00:00 2001 From: Paul Szczeanek Date: Tue, 27 Oct 2020 14:05:56 +0000 Subject: [PATCH] fix incorrect parameter check in periodic advertising --- connectivity/FEATURE_BLE/source/generic/GapImpl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/connectivity/FEATURE_BLE/source/generic/GapImpl.cpp b/connectivity/FEATURE_BLE/source/generic/GapImpl.cpp index 0bdb3bdf4c..70bfaf1aa3 100644 --- a/connectivity/FEATURE_BLE/source/generic/GapImpl.cpp +++ b/connectivity/FEATURE_BLE/source/generic/GapImpl.cpp @@ -3219,9 +3219,8 @@ ble_error_t Gap::addDeviceToPeriodicAdvertiserList( return BLE_ERROR_NOT_IMPLEMENTED; } - if (peerAddressType != peer_address_type_t::PUBLIC || - peerAddressType != peer_address_type_t::RANDOM - ) { + if ((peerAddressType != peer_address_type_t::PUBLIC) && + (peerAddressType != peer_address_type_t::RANDOM)) { return BLE_ERROR_INVALID_PARAM; } @@ -3251,9 +3250,8 @@ ble_error_t Gap::removeDeviceFromPeriodicAdvertiserList( return BLE_ERROR_NOT_IMPLEMENTED; } - if (peerAddressType != peer_address_type_t::PUBLIC || - peerAddressType != peer_address_type_t::RANDOM - ) { + if ((peerAddressType != peer_address_type_t::PUBLIC) && + (peerAddressType != peer_address_type_t::RANDOM)) { return BLE_ERROR_INVALID_PARAM; }