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

2 UARTs on 51422

Hi,

I have a hardware (wired) UART transmitting data to the nRF51 at intervals. I'm currently trying to implement UART-BLE that runs could concurrently with the wired UART.

How should I go about doing that (uart event handler and uart initialization)?

Parents
  • Hi

    I suspect the BLE UART example in the nRF5 SDK does just what you are asking for. Otherwise let me know. It implements communication over the hardware UART and sends the data to a peer device over BLE using the NUS (Nordic UART Service).

  • Hi

    The uart_evt_handler is callback function for the hardware UART. The nus_data_handler is the callback function for the BLE-UART messages. The nus service is initialized in the services_init function, where the BLE-UART nus_data_handler callback is set.

    You can see in the nus_data_handler in the example that the data received from BLE-UART is directly forwarded to the hardware UART. You can also see in the uart_event_handle that data received on the hardware UART is directly forwarded to the BLE-UART. This means that the data can flow in both directions, from a BLE peer device to a hardware connected UART device, and also from hardware connected UART device to a BLE peer device.

    You can connect to the hardware UART with a UART terminal program on your PC, e.g. Realterm, and communicate with for example Master Control Panel on Win PC or any BLE analyzing app on your smartphone, or most simply, use the nRFToolbox UART app, available for IOS, Android and windows phone

Reply
  • Hi

    The uart_evt_handler is callback function for the hardware UART. The nus_data_handler is the callback function for the BLE-UART messages. The nus service is initialized in the services_init function, where the BLE-UART nus_data_handler callback is set.

    You can see in the nus_data_handler in the example that the data received from BLE-UART is directly forwarded to the hardware UART. You can also see in the uart_event_handle that data received on the hardware UART is directly forwarded to the BLE-UART. This means that the data can flow in both directions, from a BLE peer device to a hardware connected UART device, and also from hardware connected UART device to a BLE peer device.

    You can connect to the hardware UART with a UART terminal program on your PC, e.g. Realterm, and communicate with for example Master Control Panel on Win PC or any BLE analyzing app on your smartphone, or most simply, use the nRFToolbox UART app, available for IOS, Android and windows phone

Children
No Data
Related