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

nRF51 ble_uart example problem

Hello I noticed the problem with nRF51 DK and ble_uart app.

1. The nRF51 DK is connected to the Terminal

2. Connect to the nRF via "nRF Connect" application on Android

3. Enable notification for TX characteristic after connection to Nordic UART Service

4. Send data from terminal and notify them on smartphone in TX characteristic

5. Send data every 100ms and try to Disconnect on smartphone

6. There are problems with disconecting / connecting when data is still being sent from the terminal

What can cause such a behaviour ?

Parents
  • Hi,

    ble_nus_data_send needs the following conditions to work properly:

    • you have to be in a connection (connection handle is not BLE_CONN_HANDLE_INVALID)
    • notifications must be enabled (you can tell that notifications have been enabled by BLE_NUS_EVT_COMM_STARTED event, and disabled by BLE_NUS_EVT_COMM_STOPPED or BLE_GAP_EVT_DISCONNECTED)

    Check these before calling ble_nus_data_send and it should help with the connect/disconnect behaviour

Reply
  • Hi,

    ble_nus_data_send needs the following conditions to work properly:

    • you have to be in a connection (connection handle is not BLE_CONN_HANDLE_INVALID)
    • notifications must be enabled (you can tell that notifications have been enabled by BLE_NUS_EVT_COMM_STARTED event, and disabled by BLE_NUS_EVT_COMM_STOPPED or BLE_GAP_EVT_DISCONNECTED)

    Check these before calling ble_nus_data_send and it should help with the connect/disconnect behaviour

Children
Related