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

questions on how to implement the current time service

I'm working on an implementation of the Current Time Service specified by the Bluetooth SIG (I'm happy to share it).

where I am so far:

  • The service and the caracteristics are set up and working correctly.
  • I can initialise the value attribute with a static date_time
  • I can increment the time using a timer created with the timer lib and update the value in the softdevice

My questions:

  • where do I get the time from? The timer lib uses the RTC but can I still set and read the absolute value of the RTC and read the time-value from there? Or will it interfere? I later want to be able to go into a power saving mode where the device doesn't do anything until the user wakes it up by the press of a button. Of course the RTC should continue to run during that time. Or will I anyway not save a significant amount of energy compared to waking up every secound to run the timer lib?

  • the time gets read from the device very seldomly. Do I really need to update the time value in the softdevice every secound even though it is almost never read? Is there a possibility to get an event from the softdevice when the time is read, so the application can than read the RTC value, write it to the softdevice and tell the softdevice that the value is now ready to be delivered to the peer device?

P.S. Im using your ble_date_time.h file for the date_time format definition. Could it be that there is the include #include "app_util.h" missing? the definitions for __INLINE and the datatypes are missing. I was unable to compile without adding it.

Parents Reply Children
No Data
Related