Skip to content

Commit 7ef7ef5

Browse files
author
Donatien Garnier
committed
Fix is_random_xxx_address() functions in GenericGap that I had broken :)
1 parent 1fdb57e commit 7ef7ef5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

features/FEATURE_BLE/source/generic/GenericGap.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static bool is_prand_24_bits_valid(const BLEProtocol::AddressBytes_t address)
230230
static bool is_random_static_address(const BLEProtocol::AddressBytes_t address)
231231
{
232232
// top two msb bits shall be equal to 0b11.
233-
if (((address[5] >> 6) & 0xC0) != 0xC0) {
233+
if ((address[5] & 0xC0) != 0xC0) {
234234
return false;
235235
}
236236

@@ -244,7 +244,7 @@ static bool is_random_private_non_resolvable_address(
244244
const BLEProtocol::AddressBytes_t address
245245
) {
246246
// top two msb bits shall be equal to 0b00.
247-
if (((address[5] >> 6) & 0xC0) != 0x00) {
247+
if ((address[5] & 0xC0) != 0x00) {
248248
return false;
249249
}
250250

@@ -258,7 +258,7 @@ static bool is_random_private_resolvable_address(
258258
const BLEProtocol::AddressBytes_t address
259259
) {
260260
// top two msb bits shall be equal to 0b01.
261-
if (((address[5] >> 6) & 0xC0) != 0x40) {
261+
if ((address[5] & 0xC0) != 0x40) {
262262
return false;
263263
}
264264

0 commit comments

Comments
 (0)