Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to Sync RTC with Current Time Service to generate timestamps??

Hello,

I am trying to get acquire the accelerometer data every 4 hours for a sample duration of 60secs. These data are stored in RAM and on ble connection with the mobile app the data is sent to mobile over BLE. I am using Current time service to get the time and I am also using internal RTC. I need to generate the time stamp on every data acquisition and store it in RAM with accelerometer data before sending it to the mobile app.

But I don't understand how the timestamp is generated when a device is not connected to the app as the current time from CTS can be available only on the connection.

How does RTC sync with CTS and generate a timestamp for each data acquisition even when the device is not connected?

I am using nRF52832 device.

  • Hi Padmashree, 

    You can have a look at this case.

    As mentioned in the case, you can for example create an app_timer that triggers an event  every 1 second and you can keep track of the time using that. Please get familiar with the app_timer. The example of how to use it can be found in most of our BLE example , we use the timer to notify the battery level every 2 seconds

Related