From 7ef7ef553cad50e40c462503bf4f1cbd00fcd882 Mon Sep 17 00:00:00 2001 From: Donatien Garnier Date: Wed, 16 May 2018 12:04:04 +0100 Subject: [PATCH] Fix is_random_xxx_address() functions in GenericGap that I had broken :) --- features/FEATURE_BLE/source/generic/GenericGap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index c1f47f0f8d..faa78eb4d3 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -230,7 +230,7 @@ static bool is_prand_24_bits_valid(const BLEProtocol::AddressBytes_t address) static bool is_random_static_address(const BLEProtocol::AddressBytes_t address) { // top two msb bits shall be equal to 0b11. - if (((address[5] >> 6) & 0xC0) != 0xC0) { + if ((address[5] & 0xC0) != 0xC0) { return false; } @@ -244,7 +244,7 @@ static bool is_random_private_non_resolvable_address( const BLEProtocol::AddressBytes_t address ) { // top two msb bits shall be equal to 0b00. - if (((address[5] >> 6) & 0xC0) != 0x00) { + if ((address[5] & 0xC0) != 0x00) { return false; } @@ -258,7 +258,7 @@ static bool is_random_private_resolvable_address( const BLEProtocol::AddressBytes_t address ) { // top two msb bits shall be equal to 0b01. - if (((address[5] >> 6) & 0xC0) != 0x40) { + if ((address[5] & 0xC0) != 0x40) { return false; }