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

send data from nrf connect app to the nrf device

Hi

I am using the nrf52832 DK for my project.

Using ble i need to establish wireless connection b/w the android phone and the board.

I need to send data from the phone to the board and store this data onto the flash. Which example program from the sdk fits my necessity?

I tried the ble_app_uart example and I am able to send data from the dk to the phone. 

Mostof the posts i read is about sending sensor data via ble to the nrfconnect app but i need to do it the other way round. 

Parents
  • Hi,

    The NUS example seems like a sensible starting point. It supports transferring data in both directions out of the box. Regarding flash storage that depends on how you want to do it, but if you want to use FDS, then you can refer to the FDS example.

  • in the NUS example when i use the RX Characteristic to send data i am able to view the data on the terminal application. I want to copy and store this data in a separate string, how do i do that?

    sorry if these questions seem too basic, I have only recently started working on MCUs. 

  • Hi,

    That all depends on how you want to do it. You will get a string with the characters written by the central (phone), which is handled by the nus_data_handler() function in the NUS example. There you can do whatever you like with it, in addition to or instead of logging it, as is done in the current example. If you would like to copy it to another string, then you can do that (for instance using strcpy() or memcpy()), and if you like, you can write it to flash using, for instance, FDS or another method. This is up to you.

Reply
  • Hi,

    That all depends on how you want to do it. You will get a string with the characters written by the central (phone), which is handled by the nus_data_handler() function in the NUS example. There you can do whatever you like with it, in addition to or instead of logging it, as is done in the current example. If you would like to copy it to another string, then you can do that (for instance using strcpy() or memcpy()), and if you like, you can write it to flash using, for instance, FDS or another method. This is up to you.

Children
Related