Hi,
I am developing an application (Peripheral Sensor device: Acceleration measurement), I have included the characteritsics for the measurement and I am trying to include three packets of data to this characteristics value Timestamp, Value and Flag. I have already done the part of Value and Flag and currently I am facing difficulty in adding time stamp (I wish to add unix timestamp in Seconds). My client device has the Synchronization characteristics which notifies the current time (unix timestamp in Seconds in milliseconds). But I am not aware of where to start in order to include the timestamp in to my characetristic value. I refered nordic example "ble_cts_c" but I could not understand how can I sync the readed current time with my RTC of my measurement. In short I have following challanges,
1. Can I duplicate the Nordic example of Current Time Service Client in order to read the current time from my master/client which provides the current time (unix time stamp in millisecond)?
2. How and Where should I synchronize the readed current time value with my app_timer for the acceleration measurement? Is there any public example/codes available to refer? Can anyone comment on the code procedure (I mean where to start)?
2.1 Where should I call the function to read the current time?
2.2 If I use 20 ppm timer accuracy how often should I call this read current time function?
2.3 what happens when the the device enters in to the idle state (sleep mode), do I need to synch the time again after wake?
3. Is there any another way to include unix time stamp?
(I am using nRF5, development kit: nRF52840DK)
It would be really helpful, If i get some guidance on this topic.
Thanks and Regards,
Sreejith