File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
features/FEATURE_BLE/source/generic Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -229,8 +229,8 @@ static bool is_prand_24_bits_valid(const BLEProtocol::AddressBytes_t address)
229
229
*/
230
230
static bool is_random_static_address (const BLEProtocol::AddressBytes_t address)
231
231
{
232
- // top two msb bits shall be equal to 1 .
233
- if ((address[5 ] >> 6 ) != 0x03 ) {
232
+ // top two msb bits shall be equal to 0b11 .
233
+ if ((( address[5 ] >> 6 ) & 0xC0 ) != 0xC0 ) {
234
234
return false ;
235
235
}
236
236
@@ -243,8 +243,8 @@ static bool is_random_static_address(const BLEProtocol::AddressBytes_t address)
243
243
static bool is_random_private_non_resolvable_address (
244
244
const BLEProtocol::AddressBytes_t address
245
245
) {
246
- // top two msb bits shall be equal to 0 .
247
- if ((address[5 ] >> 6 ) != 0x00 ) {
246
+ // top two msb bits shall be equal to 0b00 .
247
+ if ((( address[5 ] >> 6 ) & 0xC0 ) != 0x00 ) {
248
248
return false ;
249
249
}
250
250
@@ -257,8 +257,8 @@ static bool is_random_private_non_resolvable_address(
257
257
static bool is_random_private_resolvable_address (
258
258
const BLEProtocol::AddressBytes_t address
259
259
) {
260
- // top two msb bits shall be equal to 01 .
261
- if ((address[5 ] >> 6 ) != 0x01 ) {
260
+ // top two msb bits shall be equal to 0b01 .
261
+ if ((( address[5 ] >> 6 ) & 0xC0 ) != 0x40 ) {
262
262
return false ;
263
263
}
264
264
You can’t perform that action at this time.
0 commit comments