Commit 28def4c4 authored by yangjian's avatar yangjian

modify time zone

parent bdcd5f7c
......@@ -2258,7 +2258,7 @@ void amf_n1::registration_complete_handle(uint32_t ran_ue_ngap_id,
time_t tt;
time(&tt);
tt = tt + 8 * 3600; // transform the time zone
// tt = tt + 8 * 3600; // transform the time zone
tm *t = gmtime(&tt);
uint8_t conf[38] = {0};
......@@ -2279,12 +2279,16 @@ void amf_n1::registration_complete_handle(uint32_t ran_ue_ngap_id,
uint8_t time_zone[2] = {0x46, 0x23};
uint8_t time[8] = {0};
time[0] = 0x47;
time[1] = 0x12;
time[2] = ((t->tm_mon + 1) & 0x0f) << 4 | ((t->tm_mon + 1) & 0xf0) >> 4;
time[3] = ((t->tm_mday + 1) & 0x0f) << 4 | ((t->tm_mday + 1) & 0xf0) >> 4;
time[4] = ((t->tm_hour + 1) & 0x0f) << 4 | ((t->tm_hour + 1) & 0xf0) >> 4;
time[5] = ((t->tm_min + 1) & 0x0f) << 4 | ((t->tm_min + 1) & 0xf0) >> 4;
time[6] = ((t->tm_sec + 1) & 0x0f) << 4 | ((t->tm_sec + 1) & 0xf0) >> 4;
time[1] = ((t->tm_year%10) & 0x0f) << 4 | ((t->tm_year/10%10) & 0x0f);
time[2] = (((t->tm_mon+1)%10) & 0x0f) << 4 | (((t->tm_mon+1)/10%10) & 0x0f);
time[3] = ((t->tm_mday%10) & 0x0f) << 4 | ((t->tm_mday/10%10) & 0x0f);
time[4] = ((t->tm_hour%10) & 0x0f) << 4 | ((t->tm_hour/10%10) & 0x0f);
time[5] = ((t->tm_min%10) & 0x0f) << 4 | ((t->tm_min/10%10) & 0x0f);
time[6] = ((t->tm_sec%10) & 0x0f) << 4 | ((t->tm_sec/10%10) & 0x0f);
time[7] = 0x23;
uint8_t daylight[3] = {0x49, 0x01, 0x00};
memcpy(conf, header, 3);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment