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

Setting the RTC on the Client to the Server time

Hi

I can get the current time from the server using the time service characteristic. Which function should I use to set the RTC clock on the nrf 51 to the current time obtained from the server so that the timer starts from that point.

Parents
  • There is no clock on the nrf51 which has a notion of 'current time'. The RTC is just a counter. if you want to use it as a clock you have to get it to call you at regular time intervals (eg one second) and then you count ticks and turn that into a time.

    So when you get the current time from the server, you set your count to that time and start counting from there.

  • this has nothing to do with the counter register on the RTC, and it's not read only anyway, although it may be in use by something like the app_timer module. But it's really irrelevant anyway, the RTC will just give you regular ticks, you need to implement the clock functions by yourself.

Reply Children
No Data
Related