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

ble_app_uart multilink_central with a peripheral

Hi team

I have a problem that bothers me for days.

I try to run demo ble_app_uart_c with

  NRF_SDH_BLE_CENTRAL_LINK_COUNT=8 and NRF_SDH_BLE_PERIPHERAL_LINK_COUNT=1.

first,I use APP nRF toolbox scan and connect first board witch running this demo.It works fine.I can send data with ble_nus_string_send() and recive data from APP.

And then,after I use the second board (runs demo ble_app_uart) connect the first board,the first board use ble_nus_string_send() send data to APP will get event BLE_ERROR_GATTS_SYS_ATTR_MISSING.The other functions work fine.Two boards can send data to each other.The first board can send data to APP.

And I found that if I use nRF toolbox to disconnect the board and reconnect it .It all goes normal.But when a new peripheral connect to the central board I will get this event again.

And What I'm referring to is ble_app_multilink_central and ble_app_hrs_rscs_relay without peer manager. Please give me some advice.

There is some change that i do: main:

int main(void)
{
uint32_t err_code;
bool     erase_bonds;
log_init();
timer_init();
power_init();
uart_init();
buttons_leds_init(&erase_bonds);
db_discovery_init();
ble_stack_init();
gatt_init();
nus_c_init();



if(0==isScanning)
  scan_start();
/***********ADD****************/
gap_params_init();
services_init();
advertising_init();
conn_params_init();
err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);

/***************************/

for (;;)
{
    if (NRF_LOG_PROCESS() == false)
    {
        nrf_pwr_mgmt_run();
    }
}
}

uart:

void uart_event_handle(app_uart_evt_t * p_event)
{
.............
switch (p_event->evt_type)
{
    .............
        
        if ((data_array[index - 1] == '\n') || (index >= (m_ble_nus_max_data_len)))
        {
            ...............

            do
            {//TODO
                //ret_val = ble_nus_c_string_send(&m_ble_nus_c, data_array, index);
                if(SendToTag==0xA0){
                      ret_val = ble_nus_string_send(&m_nus, data_array, &index);
                      
                }else if(SendToTag==0xA1){
                      ret_val = ble_nus_c_string_send(&m_ble_nus_c[data_array[1]], data_array,
   index);
                }
                
                if ( (ret_val != NRF_ERROR_INVALID_STATE) && 
                (ret_val != NRF_ERROR_BUSY) 
                )
                {
                    APP_ERROR_CHECK(ret_val);
                }
                
            } while (ret_val == NRF_ERROR_BUSY);

            index = 0;
        }
        break;

    ...........


}
}
Parents Reply Children
No Data
Related