Hi,
can anyone give sample code to update current time in device.
i am using pca10001 device.
Regards Balaji
Hi,
can anyone give sample code to update current time in device.
i am using pca10001 device.
Regards Balaji
Hi, Could you explain a little bit more on how you want to update real time on device ? You want to keep track of the time using internal RTC and/or want to sync the time from a external device, such as a phone?
Hi Hung Bui,
I want to update time from external device (Phone).
But Can you explain both ways.
Regards Balaji
What you would need to do is to implement a time profile on the server on the phone to store data. You can find the structure of time profile here and the spec here.
Then on the nRF51822, you will have to keep track of the time using RTC. You can use the provided app timer (that uses RTC1) to do the task. You can create a timer with interval of for example 1 second and keep track of the time inside that app-timer timeout handler.
Finally, you can do a time sync with the phone everyday or every time the device get connected by reading the current time characteristic in the time profile on the phone server.
Unfortunately, we don't have a sample code of this feature, but I don't think there could be any issue implement this.