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

How to use the calendar_example to extract the current time

How to extract the current time from the calendar_example, i am not clear with the procedure

Parents Reply
  • Hi Adeel 

    Anything is possible, but I am not sure how much sense it makes to adapt the calendar example when the date_time library is available in NCS/Zephyr. 

    I modified the example I shared earlier to set up a standard Zephyr timer, and use that to update the timestamp in a fashion similar to the calendar example. 

    The difference is that it uses the date_time library to get the time initially, and then defaults to using a timer afterwards to reduce the need of calling date_time repeatedly. 

    Please have a look at the updated example and see if it gets you closer to what you need:
    https://github.com/too1/mqtt_w_date_time

    Best regards
    Torbjørn

Children
Related