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

ble_nus_string_send error

Hi, I am merging the Thingy app (Segger with softdevice s132_nrf52_4.0.5) with the UART example (taken from ble_app_uart in SDK 11). I have been fixing some errors before getting this error with ble_nus_string_send(&m_nus,data,length). I tracked in the debug and saw that p_nus->conn_handle = 0xFFFF and p_nusp_nus->is_notification_enabled= false.

This is the main loop:

        app_sched_execute();       
       
        err_code=ble_nus_string_send(&m_nus,data,length); /*data is random created by me*/
 
        if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
          {
              NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x.\n ", err_code);                   
          }
       
       
        if (!NRF_LOG_PROCESS()) // Process logs
        {
            power_manage();
        }

Everything works fine except that i cannot send data using ble_nus_string_send. (also if i run the ble_app_uart example alone, it works just fine).

Please give me some clues to fix this error. Many thanks.

Related