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

increase BLE_GATT_DB_MAX_CHARS

Hello, i'm using nRF52833, pca10100.

I would like to connect multiple peripherals by referring to the mulit link example.

First of all, I'm going to try to connect to a single device. And then warning below appears.


I literally increased the characteristic value.
The previous one that was defined as 6 was randomly modified to 12, so it was connected well without warning.

I have a question here. In fact, I solved the problem without knowing the exact cause of the problem, so I'd like to hear a proper explanation for the cause of such a warning.

I gave a random value of 12, but I think I need to define it as much as the characterisitc that the device provides. Where can I check it?
As far as I know, the device I connected has only two characteristics: 1601, 1602. Is there anything I didn't check in the process of DB discovery?
Also, 0x1600 is my device service UUID, but why does 0x0000 come it up ?\

BR, lyrics

Parents
  • In my view, the cause of this problem is,

    Whether the peripheral is connected continuously or there seems to be an error during the connection process.

    I defined NRF_SDH_BLE_CENTRAL_LINK_COUNT as 4.
    and if I check LOG, something seems to be happening continuously in the process of connecting one peripheral.
    Like the 'Discovery complete' shows several times.

    After connecting with one peripheral, scanning does not seem to start again.

    When connected to a single device found, it seems that only db discovery for that device several times.

    and this is my code.

    void client_ble_evt_handler(ble_evt_t const * p_ble_evt)
    {
        ret_code_t            err_code;
    
        ...
        
        switch (p_ble_evt->header.evt_id)
        {
            case BLE_GAP_EVT_CONNECTED:
                if(p_gap_evt->params.connected.role == BLE_GAP_ROLE_CENTRAL)
                {
                    memset(&m_db_disc, 0, sizeof(m_db_disc));
    
                    NRF_LOG_INFO("Connection 0x%x established, starting DB discovery.", p_gap_evt->conn_handle);
    
                    APP_ERROR_CHECK_BOOL(p_gap_evt->conn_handle < NRF_SDH_BLE_CENTRAL_LINK_COUNT);
    
                    err_code = ble_nus_c_handles_assign(&m_ble_nus_c[p_gap_evt->conn_handle],
                                                        p_gap_evt->conn_handle,
                                                        NULL);
    
                    err_code = ble_db_discovery_start(&m_db_disc[p_gap_evt->conn_handle],
                                                      p_gap_evt->conn_handle);
                                                      //p_ble_evt->evt.gap_evt.conn_handle);
                    APP_ERROR_CHECK(err_code);
    
                    printf("\n\rdiscovery start\r\n");
    
                    if (ble_conn_state_central_conn_count() == NRF_SDH_BLE_CENTRAL_LINK_COUNT)
                    {
                        NRF_LOG_INFO("done");
                    }
                    else
                    {
                        // Resume scanning.
                        NRF_LOG_INFO("Keep Scanning");
                        scan_start();
                    }
                }
                break;
    
                ...
        }
    }

    I added the scan function by referring to " ble_app_uart_c " example, but now I am modifying the necessary parts through the "multi link central " example.

    I'm comparing the codes and modifying them, but I'm not sure which part of the setup I missed. 

Reply
  • In my view, the cause of this problem is,

    Whether the peripheral is connected continuously or there seems to be an error during the connection process.

    I defined NRF_SDH_BLE_CENTRAL_LINK_COUNT as 4.
    and if I check LOG, something seems to be happening continuously in the process of connecting one peripheral.
    Like the 'Discovery complete' shows several times.

    After connecting with one peripheral, scanning does not seem to start again.

    When connected to a single device found, it seems that only db discovery for that device several times.

    and this is my code.

    void client_ble_evt_handler(ble_evt_t const * p_ble_evt)
    {
        ret_code_t            err_code;
    
        ...
        
        switch (p_ble_evt->header.evt_id)
        {
            case BLE_GAP_EVT_CONNECTED:
                if(p_gap_evt->params.connected.role == BLE_GAP_ROLE_CENTRAL)
                {
                    memset(&m_db_disc, 0, sizeof(m_db_disc));
    
                    NRF_LOG_INFO("Connection 0x%x established, starting DB discovery.", p_gap_evt->conn_handle);
    
                    APP_ERROR_CHECK_BOOL(p_gap_evt->conn_handle < NRF_SDH_BLE_CENTRAL_LINK_COUNT);
    
                    err_code = ble_nus_c_handles_assign(&m_ble_nus_c[p_gap_evt->conn_handle],
                                                        p_gap_evt->conn_handle,
                                                        NULL);
    
                    err_code = ble_db_discovery_start(&m_db_disc[p_gap_evt->conn_handle],
                                                      p_gap_evt->conn_handle);
                                                      //p_ble_evt->evt.gap_evt.conn_handle);
                    APP_ERROR_CHECK(err_code);
    
                    printf("\n\rdiscovery start\r\n");
    
                    if (ble_conn_state_central_conn_count() == NRF_SDH_BLE_CENTRAL_LINK_COUNT)
                    {
                        NRF_LOG_INFO("done");
                    }
                    else
                    {
                        // Resume scanning.
                        NRF_LOG_INFO("Keep Scanning");
                        scan_start();
                    }
                }
                break;
    
                ...
        }
    }

    I added the scan function by referring to " ble_app_uart_c " example, but now I am modifying the necessary parts through the "multi link central " example.

    I'm comparing the codes and modifying them, but I'm not sure which part of the setup I missed. 

Children
No Data
Related