- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a problem setting the current time to BCM20737S. Everything is set correctly except for the month.
The month always resets to January, no matter what value I send. I am pretty sure that the time structure is set properly
and I cannot figure out what could be the problem. I am using the rtc_setRTCTime function to set the time.
Any ideas on what may be happening?
Solved! Go to Solution.
- Labels:
-
Debug
-
ReadWrite Characteristics
-
Timers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
the rtc_setRTCTime.
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)
{
RtcTime current_time;
unsigned char *cp;
rtc_getRTCTime(¤t_time); // fill in
cp = attrPtr;
current_time.year=*(cp++);
current_time.year+=((unsigned int)*(cp++))<<8;
current_time.month=(*(cp++))-1;
current_time.day=*(cp++);
current_time.hour =*(cp++);
current_time.minute =*(cp++);
current_time.second=*(cp++);
rtc_setRTCTime(¤t_time);
return FALSE;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's the one I was thinking of....
It's here: rtc_RtcTime2Sec() returns wrong seconds when RtcTime.year is 2016
Can you use the same Kevin provided to check to see if the problem is still present.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi kmichalopoulos
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.
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually, no. I'll try that first. Thank you, I'll let you know what happened.
Kostas