Can you post your code to the discussion. I seem to recall that there was an issue setting the date, but I cannot find the previous posts.
Also, which sample application are you using?
At this point I can't say that I am using a sample application.
This is the code I am using and it is pretty straightforward.
I fill the current time structure with the data from the time service characteristic and call
Am I missing something?
Also, I found a post that mentions a problem with 2016 being a leap year. Could this be related?
BOOL on_write_current_time_service_current_time(int len, UINT8 *attrPtr)
unsigned char *cp;
rtc_getRTCTime(¤t_time); // fill in
cp = attrPtr;
It looks like that this is the problem. Using 2017 it worked. I will try the code in that post and I will let you know if that fixed the problem.
I tried the code you have in the other post but it won't work.
I guess the rest of the functions using the rtc_RtcTime2Sec() must be updated as well.
Let me know if you have a way to achieve to this.
1 of 1 people found this helpful
Which SDK are you operating on? It appears that there is a patch in the latest SDK 2.2.2 addressing this very problem. Additionally, there is a sample app included called rtc_sample which builds using the patch (see the makefile to see how it's done).
I've run the sample app with a date in 2016 and it appears to be updating fine for me. Please follow the method in the sample app and let us know if the problem persists.
Ok. I am using SDK 2.2.2.
I rechecked the problem and it persists. Using 04/06/2016 sets the month to January.
04/06/2017 and everything works as expected.
I will try the sample app because I am facing problems with the time that I get back as well.
It looks like the clock is ticking too fast and after a while I get values that are a couple of seconds
in the future (no matter which year I used).
In order for the new SDK to solve the problem you must include the patch in your app's makefile as is done in the sample app. Did you try this?
Actually, no. I'll try that first. Thank you, I'll let you know what happened.