This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

App Uart Question

I'm using the Nordic as a BLE solution, and it is just passing along data through the UART to another chip through the UART. However, I'm not sure how to just pass the data along using the example UART application from the SDK.

I am basically using the SDK example as is, but I've removed the APP_UART_DATA_READY code from the uart_event_handle callback. Right now, I'm testing it without having any data being returned via the UART, but the UART will be a two-way communication channel.

My two main questions are:

  1. How do I differentiate between data sent from the main firmware via the UART and data received via the BLE destined for the UART?
  2. What exactly is the app_uart_fifo doing?
  • I'm having trouble understanding you. What example are you using? (SDK and SoftDevice version is also nice to know).

  • I'm using the ble_app_uart example from SDK 12.0.1 using SoftDevice S130

  • Ok. But I was hoping you could explain a bit more clearly what you want. Why would you remove the handling of the APP_UART_DATA_READY event? Do you not want to send data received on UART over BLE to the central device?

  • I removed the data handling because it was just grabbing the data received over the nus_data_handler (because it was adding it via app_uart_put). I want the nus_data_handler to just pass the data along, and have the uart_evt_callback only handle data sent to the UART from outside my app

  • I'm sorry, but I still don't understand. The APP_UART_DATA_READY event is received in the uart_event_handle(), not nus_data_handler(). uart_event_handle() is triggered when data is sent over UART to the nRF51 peripheral, usually from a terminal on a PC, it will then call ble_nus_string_send() to send the data over BLE to the central device. nus_data_handler() is triggered when data is sent over BLE from the central to the nRF51 peripheral, it will call app_uart_put() to send the data over UART, usally to a terminal on a PC.

    You say you have removed the handling of the APP_UART_DATA_READY, which means that when data is sent over UART to the nRF51 peripheral, the data will not be sent over BLE to the central device.

    Is this the functionality you want? If not, what exactly do you want? Please try to be specific.

Related