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

Logging realtime sensor data to flash

I would like to know if it is possible to log realtime sensor data to flash while advertising. I would like to have a device which transmits real time ECG data over ble UART to an android device when in range and once out of range, should start logging the data to the nrf51822 flash. It should resume transferring the data to android device once it is in range again and connected. I would be glad if you could give me a clue as to how to realise this if it is possible.

Parents
  • Hi

    You should not do advertising and perform flash operation at the same time. This is ensured in i.e. the ble_app_hrs example in nRF51 SDK 6.1.0, see the advertising_start in main.c. Also in nRF51 SDK 8.0.0, see ble_advertising_start.

    So if you want to flash application data, then stop advertising, perform the flash operations and then restart advertising again.

  • Ok. How then can I implement this feature such that data is not lost when a remote device is not in range. The idea here is that I have a peripheral that transmits ECG data 100 times per second to an android device. When the connected android device goes out of range, the connection is lost and then the peripheral, which is nrf51822 should start saving the data to flash while at the same time waiting for the android device to reconnect. Is it possible for the android device, which already has the address of the peripheral from the former connection, to reconnect without the peripheral advertising? If not, how do I implement this feature? Thanks.

Reply
  • Ok. How then can I implement this feature such that data is not lost when a remote device is not in range. The idea here is that I have a peripheral that transmits ECG data 100 times per second to an android device. When the connected android device goes out of range, the connection is lost and then the peripheral, which is nrf51822 should start saving the data to flash while at the same time waiting for the android device to reconnect. Is it possible for the android device, which already has the address of the peripheral from the former connection, to reconnect without the peripheral advertising? If not, how do I implement this feature? Thanks.

Children
No Data
Related