This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Scan UUID increase after each scanning periods

Hi everyone,

I am using board PCA10040 v1.1.0, softdevice 13.0.0, Eclipse Oxygen. I am trying to scan my phone and communicate with it but the scaned UUID is increasing as you can see in the image below.

image description

Here is the ble_evt_handler function:

static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            PrintInfo("BLE GAP event: Connected");
            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
            break;

        case BLE_GAP_EVT_DISCONNECTED:
            PrintInfo("BLE GAP event: Disconnected");
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break;

        case BLE_GAP_EVT_ADV_REPORT:
        {
            // The advertisement report
            ble_gap_evt_adv_report_t const * p_adv_report = &p_gap_evt->params.adv_report;
            if(is_uuid_present(m_scan_uuids, p_adv_report))
            {

            }
        }
            break;

        default:
            // No implementation needed.
            break;
    }
}

The is_uuid_presentfunction is as same as the code in the "ble_app_uart_c" example, I just add below code to that:

else if (field_type == BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA)
{
    err_code = sd_ble_uuid_decode(UUID128_SIZE, &p_data[index + 2], &extracted_uuid);
    PrintDebug("err_code: %X", err_code);
    PrintInfo("Scan UUID: %X", extracted_uuid.uuid);
    if (err_code == NRF_SUCCESS)
    {
        if (   (extracted_uuid.uuid == p_target_uuid->uuid)
            && (extracted_uuid.type == p_target_uuid->type))
        {
            return true;
        }
    }
}

Could you help me please? Thanks

Parents Reply
  • Since the phone uses a Private Resolvable address, the MAC that you scan will change often, and it won’t match the MAC you see in the device information in androidOS. This is the intended behavior.

    Private Resolvable addresses are generated from an identity resolving key (IRK) and a random number, and they can be changed often (even during the lifetime of a connection) to avoid the device being identified and tracked by an unknown scanning device.

Children
No Data
Related