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

nrf_cli_init is returning Error code 4

Hi I am using nRF52832 .My application acts as central and Peripheral at the same time.

board acting as Central: scans and connect to peripherals without any error.

But when board advertises and another central device try to connect i am getting error code 4.

code: inside ble_event_handler i have this case.

case BLE_GAP_EVT_CONNECTED:

        {

            NRF_LOG_INFO("Connected.");

            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);

            APP_ERROR_CHECK(err_code);

            m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;

            err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);

            APP_ERROR_CHECK(err_code);

          

            nrf_cli_ble_uart_config_t config = { .conn_handle = m_conn_handle };

 

            err_code = nrf_cli_init(&m_ble_cli, &config, true, true, NRF_LOG_SEVERITY_INFO);

            APP_ERROR_CHECK(nrf_cli_task_create(&m_ble_cli));

            NRF_LOG_INFO("error code after connection = %d\n", err_code); // Error occured here

 

            APP_ERROR_CHECK(err_code);

Parents Reply
  • Thank you.

    Yes i am getting error in blcm_link_ctx_get().

    condition:

    if (conn_id >= p_link_ctx_storage->max_links_cnt)

        {

          NRF_LOG_INFO("max link count = %d %d\r\n", conn_id, p_link_ctx_storage->max_links_cnt);

            return NRF_ERROR_NO_MEM;

        }

    this prints: conn_id  = 7, p_link_ctx_storage->max_links_cnt =1.

    my device acts as both and central and peripheral simultaneously.

    as central : device should connect 7 peripherals

    as peripheral: device should connect 1 central.

    how to achieve this?

    do i need to change anything in sdk_config.h?

    Thanks

Children
Related