nrf calender get issue when we set current time and date at multiple times

Hello sir,

            I am using nrf52832 Dev board in that set  the time and date by using  nrf calendar github library.For setting the time and date i have used  functions as nrf_cal_set_time(uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second)  and for getting the  time  i have used function as nrf_cal_get_time_string(true)  which it  gives the time and date properly .I have use write_handler function as   write_handler(uint16_t conn_handle, ble_newcts_t * p_lbs, ble_gatts_evt_write_t * p_evt_write) for inserting the value through nrf connect app.When i set the value  through nrfconnect app then it get constant time stamp ,the current time is not increasing .

When i set the value through write_handler(uint16_t conn_handle, ble_newcts_t * p_lbs, ble_gatts_evt_write_t * p_evt_write)  function for the first time then the current time gives proper reading .

Parents
  • Hi

    I'm sorry, but I still don't understand why you need to set multiple values? In nrf_calendar.h you can see that the nrf_cal_get_time() struct is an uncalibrated time as a tm struct. Please check out this tutorial link for more information on this struct and time.h library. Do you also get this "constant" time if you call the nrf_cal_get_time_calibrated() to get the calibrated time?

    Please also note that nrf_cal_get_time is used to return the time, and not how to set it. You should set the time using the nrf_cal_set_time instead.

    Best regards,

    Simon

Reply
  • Hi

    I'm sorry, but I still don't understand why you need to set multiple values? In nrf_calendar.h you can see that the nrf_cal_get_time() struct is an uncalibrated time as a tm struct. Please check out this tutorial link for more information on this struct and time.h library. Do you also get this "constant" time if you call the nrf_cal_get_time_calibrated() to get the calibrated time?

    Please also note that nrf_cal_get_time is used to return the time, and not how to set it. You should set the time using the nrf_cal_set_time instead.

    Best regards,

    Simon

Children
No Data
Related