Fix is_random_xxx_address() functions in GenericGap that I had broken :)

pull/6932/head
Donatien Garnier 2018-05-16 12:04:04 +01:00
parent 1fdb57e82c
commit 7ef7ef553c
1 changed files with 3 additions and 3 deletions

View File

@ -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) static bool is_random_static_address(const BLEProtocol::AddressBytes_t address)
{ {
// top two msb bits shall be equal to 0b11. // top two msb bits shall be equal to 0b11.
if (((address[5] >> 6) & 0xC0) != 0xC0) { if ((address[5] & 0xC0) != 0xC0) {
return false; return false;
} }
@ -244,7 +244,7 @@ static bool is_random_private_non_resolvable_address(
const BLEProtocol::AddressBytes_t address const BLEProtocol::AddressBytes_t address
) { ) {
// top two msb bits shall be equal to 0b00. // top two msb bits shall be equal to 0b00.
if (((address[5] >> 6) & 0xC0) != 0x00) { if ((address[5] & 0xC0) != 0x00) {
return false; return false;
} }
@ -258,7 +258,7 @@ static bool is_random_private_resolvable_address(
const BLEProtocol::AddressBytes_t address const BLEProtocol::AddressBytes_t address
) { ) {
// top two msb bits shall be equal to 0b01. // top two msb bits shall be equal to 0b01.
if (((address[5] >> 6) & 0xC0) != 0x40) { if ((address[5] & 0xC0) != 0x40) {
return false; return false;
} }