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
  • Hi,

    You are getting error code 5(NRF_ERROR_NOT_FOUND) from the function sd_ble_uuid_decode(),so that is probably what is causing this. You are not actually getting a valid UUID.

    Take a look at this post where this issue was solved.

  • Hi Sigurd, When I try to connect to the scanned MAC address (00001000-10101000-01011110-01110001-10110000-11100100), the function sd_ble_gap_connect return error code 18, which is

    #define NRF_ERROR_CONN_COUNT                  (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded.
    

    I checked that the following definition is set:

    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration.
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
    #endif
    

    Can you help me please? Thanks

Reply
  • Hi Sigurd, When I try to connect to the scanned MAC address (00001000-10101000-01011110-01110001-10110000-11100100), the function sd_ble_gap_connect return error code 18, which is

    #define NRF_ERROR_CONN_COUNT                  (NRF_ERROR_BASE_NUM + 18) ///< Maximum connection count exceeded.
    

    I checked that the following definition is set:

    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration.
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
    #endif
    

    Can you help me please? Thanks

Children
No Data
Related