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

nRF UART app Send

FormerMember
FormerMember

In the nRF UART v2.0 App, the app have the "send" command. And I can send the data to my nRF52 DK, and it print what I'm sending on the Serial monitor.

However, in the ble_app_uart example code, I don't see where this function of code is locate, Does anyone know where in the code this function is called which when we "send" the data from phone to nRF52 and print it out on monitor?

Thanks.

Parents
  • I think what you are looking for is the callback function nus_data_handler() in main.c

    The handler is passed to the uart service during initialisation, and the on_write() function in the uart service calls the function pointer (which points to the callback function in main)

    If you are not seeing any output on your hardware (UART) pins, then you don't have the TX and RX pins configured correctly for the board you are using.

  • Hi wecare,

    You are only storing the last part of the number that was sent. E.g. if you send 42, only the number 2 is stored in send_value. Take a look at this answer for a method on how to store a number sent from the phone by modifying the nus_data_handler().

    Note: The method only works with positive numbers, and you need to make some changes for it to work with negative numbers.

Reply Children
No Data
Related