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

Related