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

  • 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. 

  • Hi 

    The multilink example is designed around the Led Button service (LBS), and assumes that you are connecting to peripherals that use this service. 

    Some of the code you have included refers to the Nordic UART service (NUS), which is comparable to LBS, but use different UUID's and different characteristic properties. 

    Which service are you using on the peripheral side?

    The characteristic UUID's 0x1601 or 0x1602 doesn't fit with either NUS or LBS. 

    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?

    The ble_db_disc module is designed around the assumption that you know in advance what service(s) the peripheral device is using, and how many characteristics each service might have. 

    Best regards
    Torbjørn

  • Hi,

    Some of the code you have included refers to the Nordic UART service (NUS), which is comparable to LBS, but use different UUID's and different characteristic properties. 

    I changed the UUID in the central example, so I thought the connection done well. Even though the connect between peri and central is good, but I assumed that there was an error in the process of finding db.

  • Hi 

    I made the other case private so you can share your code. I suggest we continue the discussion there, and try to figure out what is happening in your code. 

    Best regards
    Torbjørn

Related