We are using public MAC that was purchased from IEEE (20 low bits are available for us to set and the upper 28 bits are constant to value assigned to us by the IEEE).
We also see this code in your library (components/ble/nrf_ble_scan.c):
static uint16_t nrf_ble_scan_address_type_decode(uint8_t const * p_addr)
{
uint8_t addr_type = p_addr[0];
addr_type = addr_type >> 6;
addr_type &= 0x03;
switch (addr_type)
{
case 0:
return BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_NON_RESOLVABLE;
case 1:
return BLE_GAP_ADDR_TYPE_PUBLIC;
case 2:
return BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE;
case 3:
return BLE_GAP_ADDR_TYPE_RANDOM_STATIC;
default:
return BLE_ERROR_GAP_INVALID_BLE_ADDR;
}
}
1. isn't this code conflict with the use of IEEE MAC addresses?
2. if our MAC is "uint8_t mac[6];" then these two bits settings the address type should be bits 6:7 in mac[5] or bits 6:7 in mac[0]?