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

ble_nus_data_send prints data to peripheral device terminal

I am using below base example on my peripheral device to send a string over BLE to a central device:

\examples\ble_peripheral\ble_app_uart\pca10040\s132

I use function ble_nus_data_send(&m_nus, my_c_string, &length, m_conn_handle); in my app_timer_handler(void * p_context) function to send my_c_string over BLE every 1 second to my central device which works well. But I can see my_c_string is also printed to my terminal or serial interface of the peripheral device. I dont want this happen. Just want my_c_string be send over BLE to central. 

Parents
  • Hi,

    I do not see any code here that would print your string to the serial interface while sending it. Essentially, the only place where you string is used is here:

    static void app_timer_handler(void * p_context)
    {
            // Send Data Request
        uint16_t length = sizeof(my_c_string);
        ble_nus_data_send(&m_nus, my_c_string, &length, m_conn_handle);
    }
    

    and the ble_nus_data_send() as implemented in the SDK does not log anything.

    Could it be that you have added some logging in the implementation of ble_nus_data_send() in components\ble\ble_services\ble_nus\ble_nus.c and forgot about it?

Reply
  • Hi,

    I do not see any code here that would print your string to the serial interface while sending it. Essentially, the only place where you string is used is here:

    static void app_timer_handler(void * p_context)
    {
            // Send Data Request
        uint16_t length = sizeof(my_c_string);
        ble_nus_data_send(&m_nus, my_c_string, &length, m_conn_handle);
    }
    

    and the ble_nus_data_send() as implemented in the SDK does not log anything.

    Could it be that you have added some logging in the implementation of ble_nus_data_send() in components\ble\ble_services\ble_nus\ble_nus.c and forgot about it?

Children
Related