UUID scan

Hi,

I do have a question about the ble_app_uart for central device. Now it is set to make connection with the periheral based on the UUID. I can't find where in the software this is set. Can someone help me out?

Because now if I'm changing the device name I can't get connected. Am I able to change the connecting UUID?

Kind regards,

JP

Parents
  • Hi! 

    Could you share which version of the SDK you are working with? 

    Br, 
    Joakim

  • From the information in the question I assume you are working with the nRF5 SDK? Correct me if I'm mistaken. 

    The following code are copied from the ble_app_uart_c example in the nRF5 SDK v.17.1.0: 

    /**@brief Function for initializing the scanning and setting the filters.
     */
    static void scan_init(void)
    {
        ret_code_t          err_code;
        nrf_ble_scan_init_t init_scan;
    
        memset(&init_scan, 0, sizeof(init_scan));
    
        init_scan.connect_if_match = true;
        init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;
    
        err_code = nrf_ble_scan_init(&m_scan, &init_scan, scan_evt_handler);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_UUID_FILTER, &m_nus_uuid);
        APP_ERROR_CHECK(err_code);
    
        err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_UUID_FILTER, false);
        APP_ERROR_CHECK(err_code);

    From scan_init() you can see that the scan filter are set (using nrf_ble_scan_filter_set). SCAN_UUID_FILTER is selected and a pointer to the NUS UUID. 

    Br, 
    Joakim

  • Thank you Joakim,

    Yes you’re right I’m working with the nRF5 SDK.

    I find this also but wasn’t sure if it is what I’ searching for. So the SCAN_UUID_FILTER includes the UUID of the peripheral device?

    Kind regards,

    JP

Reply Children
Related