This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC2538: UTCTimeStuct data are not filling proprerly

Part Number: CC2538

Tool/software: TI-RTOS

I am getting current date and time from the server and trying to update my controller cc2538.

So I am using the UTCTimeStruct for time setting. But it's not storing the data. I have tried in many ways.

The below formates are I have tried.


1. UTCSetTime->seconds = (char)sec;
UTCSetTime->minutes =(char)min;
UTCSetTime->hour =(char)hour;
UTCSetTime->day = (char)day;
UTCSetTime->month =(char)month; 
UTCSetTime->year =(int)year ;

2. UTCSetTime->seconds = "57";
UTCSetTime->minutes ="45";
UTCSetTime->hour ="21";
UTCSetTime->day = "26";
UTCSetTime->month ="10"; 
UTCSetTime->year =17;

3. UTCSetTime->seconds = 57;
UTCSetTime->minutes =45;
UTCSetTime->hour =21;
UTCSetTime->day = 26;
UTCSetTime->month =10; 
UTCSetTime->year =17;
after set time I have printed, but I am getting correct values.

sprintf(newBuf1, "%d,%d,%d,%d,%d,%d \r\n", UTCSetTime->year,UTCSetTime->month,UTCSetTime->day,UTCSetTime->hour,UTCSetTime->minutes,UTCSetTime->seconds);
HalUARTWrite ( MT_UART_DEFAULT_PORT, newBuf1, strlen(newBuf1) );

its not printing the correct value what i have set.
can help me to how to set the values into the UTCTimeStruct.