47 #ifdef COMMON_INTERFACE 53 #define LCODE_STRING_MAX 4 54 #define TIME_STRING_MAX 9 55 #define DATE_STRING_MAX 11 56 #define CLOCK_STRING_MAX 11 57 #define SERIAL_NO_MAX 50 58 #define VERSION_NO_MAX 9 69 BOOLEAN use_broadcast_time;
74 U16BIT offset_change_date;
75 U8BIT offset_change_hour;
76 U8BIT offset_change_min;
77 U8BIT offset_change_secs;
78 S8BIT offset_old_hour;
80 S8BIT offset_new_hour;
90 static void *time_mutex;
91 static U8BIT lcode_string[LCODE_STRING_MAX];
92 static U8BIT time_string[TIME_STRING_MAX];
93 static U8BIT date_string[DATE_STRING_MAX];
94 static U8BIT clock_string[CLOCK_STRING_MAX];
95 static U8BIT serial_no[SERIAL_NO_MAX];
96 static U8BIT version_no[VERSION_NO_MAX];
101 static void ExtractUTCDate(U16BIT code, U8BIT *wday, U8BIT *day, U8BIT *month, U16BIT *year);
102 static void AddTime(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1,
103 S16BIT ohour, S16BIT omin, S16BIT osecs,
104 U16BIT *code, U8BIT *hour, U8BIT *min, U8BIT *secs);
105 static BOOLEAN FutureTime(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1,
106 U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2);
107 static void ConvertTimestamp(U32BIT timestamp, U16BIT *date, U8BIT *hour, U8BIT *mins, U8BIT *secs);
108 static U32BIT ConvertToTimestamp(U16BIT code, U8BIT hour, U8BIT min, U8BIT sec);
109 static void SetCTime(
void );
110 static void GetCTime(
void );
111 static void SetOffset(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs,
112 S8BIT ohour1, S8BIT omin1, S8BIT ohour2, S8BIT omin2);
113 static void GetOffset(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs,
114 S8BIT *ohour, S8BIT *omin);
133 static void ExtractUTCDate(U16BIT code, U8BIT *wday, U8BIT *day, U8BIT *month, U16BIT *year)
135 U32BIT t1, t2, t3, t4;
137 FUNCTION_START(ExtractUTCDate);
141 t1 = (U32BIT)code * 10L;
146 *year = (U16BIT)t2 + 1900;
158 *month = (U8BIT)t3 - 1;
162 *day = (U8BIT)((U32BIT)code - 14956UL - t2 - t3);
167 *month = *month - 12;
170 *wday = (U8BIT)((((U32BIT)code + 2L) % 7) + 1);
180 FUNCTION_FINISH(ExtractUTCDate);
204 static void AddTime(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1,
205 S16BIT ohour, S16BIT omin, S16BIT osecs,
206 U16BIT *code, U8BIT *hour, U8BIT *min, U8BIT *secs)
208 S32BIT rcode, rhour, rmin, rsecs;
210 FUNCTION_START(AddTime);
212 rcode = (S32BIT)code1;
213 rhour = ((S32BIT)hour1 + (S32BIT)ohour);
214 rmin = ((S32BIT)min1 + (S32BIT)omin);
215 rsecs = ((S32BIT)secs1 + (S32BIT)osecs);
251 *code = (U16BIT)rcode;
254 *hour = (U8BIT)rhour;
256 *secs = (U8BIT)rsecs;
258 FUNCTION_FINISH(AddTime);
279 static BOOLEAN FutureTime(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1,
280 U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2)
282 BOOLEAN ret_val = FALSE;
284 FUNCTION_START(FutureTime);
312 FUNCTION_FINISH(FutureTime);
328 static void SetCTime(
void )
332 U8BIT ehour, emin, esecs;
334 FUNCTION_START(SetCTime);
336 now = ConvertToTimestamp(general_status.date_code, general_status.time_hour,
337 general_status.time_min, general_status.time_secs);
339 if (general_status.use_broadcast_time)
346 GetOffset(general_status.date_code, general_status.time_hour,
347 general_status.time_min, general_status.time_secs,
348 &general_status.rtcoff_hour, &general_status.rtcoff_min);
350 AddTime(general_status.date_code, general_status.time_hour, general_status.time_min, general_status.time_secs,
351 (S16BIT)general_status.rtcoff_hour, (S16BIT)general_status.rtcoff_min, 0,
352 &ecode, &ehour, &emin, &esecs);
354 now = ConvertToTimestamp(ecode, ehour, emin, esecs);
359 FUNCTION_FINISH(SetCTime);
370 static void ConvertTimestamp(U32BIT timestamp, U16BIT *date, U8BIT *hour, U8BIT *mins, U8BIT *secs)
376 FUNCTION_START(ConvertTimestamp);
379 tm_time = gmtime(&t);
384 date_code = 14956L + (U32BIT)tm_time->tm_mday;
386 if (tm_time->tm_mon < 2)
388 date_code += (((U32BIT)tm_time->tm_year - 1L) * 36525L) / 100L;
389 date_code += (((U32BIT)tm_time->tm_mon + 14L) * 306001L) / 10000L;
393 date_code += ((U32BIT)tm_time->tm_year * 36525L) / 100L;
394 date_code += (((U32BIT)tm_time->tm_mon + 2L) * 306001L) / 10000L;
397 *date = (U16BIT)date_code;
398 *hour = (U8BIT)tm_time->tm_hour;
399 *mins = (U8BIT)tm_time->tm_min;
400 *secs = (U8BIT)tm_time->tm_sec;
402 FUNCTION_FINISH(ConvertTimestamp);
417 static U32BIT ConvertToTimestamp(U16BIT code, U8BIT hour, U8BIT min, U8BIT sec)
421 FUNCTION_START(ConvertToTimestamp);
423 timestamp = (U32BIT)code;
424 if (timestamp >= 40587)
431 timestamp += (U32BIT)hour * 3600L;
432 timestamp += (U32BIT)min * 60L;
433 timestamp += (U32BIT)sec;
435 FUNCTION_FINISH(ConvertToTimestamp);
451 static void GetCTime(
void )
455 U8BIT hour, mins, secs;
457 FUNCTION_START(GetCTime);
460 if (general_status.use_broadcast_time)
470 if (general_status.time_set == TRUE)
472 ConvertTimestamp(t, &date, &hour, &mins, &secs);
474 #ifndef USE_SYSTEM_CLOCK 475 AddTime(date, hour, mins, secs,
476 (S16BIT)(general_status.rtcoff_hour * -1), (S16BIT)(general_status.rtcoff_min * -1), 0,
477 &general_status.date_code, &general_status.time_hour, &general_status.time_min, &general_status.time_secs);
479 general_status.time_hour = hour;
480 general_status.time_min = mins;
481 general_status.time_secs = secs;
482 general_status.date_code = date;
483 #endif //USE_SYSTEM_CLOCK 487 general_status.time_hour = 0;
488 general_status.time_min = 0;
489 general_status.time_secs = 0;
490 general_status.date_code = 0;
493 FUNCTION_FINISH(GetCTime);
514 static void SetOffset(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs,
515 S8BIT ohour1, S8BIT omin1, S8BIT ohour2, S8BIT omin2)
517 FUNCTION_START(SetOffset);
519 general_status.offset_change_date = code;
520 general_status.offset_change_hour = hour;
521 general_status.offset_change_min = min;
522 general_status.offset_change_secs = secs;
524 general_status.offset_old_hour = ohour1;
525 general_status.offset_old_min = omin1;
526 general_status.offset_new_hour = ohour2;
527 general_status.offset_new_min = omin2;
529 FUNCTION_FINISH(SetOffset);
548 static void GetOffset(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs,
549 S8BIT *ohour, S8BIT *omin)
551 FUNCTION_START(GetOffset);
553 if (FutureTime(code, hour, min, secs,
554 general_status.offset_change_date, general_status.offset_change_hour,
555 general_status.offset_change_min, general_status.offset_change_secs))
557 *ohour = general_status.offset_new_hour;
558 *omin = general_status.offset_new_min;
562 *ohour = general_status.offset_old_hour;
563 *omin = general_status.offset_old_min;
566 FUNCTION_FINISH(GetOffset);
586 general_status.lang_code = 0;
587 general_status.audio_signal = FALSE;
588 general_status.time_set = FALSE;
589 general_status.use_broadcast_time = TRUE;
590 general_status.date_code = 0;
591 general_status.time_hour = 0;
592 general_status.time_min = 0;
593 general_status.time_secs = 0;
594 general_status.offset_change_date = 0;
595 general_status.offset_change_hour = 0;
596 general_status.offset_change_min = 0;
597 general_status.offset_change_secs = 0;
598 general_status.offset_old_hour = 0;
599 general_status.offset_old_min = 0;
600 general_status.offset_new_hour = 0;
601 general_status.offset_new_min = 0;
602 general_status.rtcoff_hour = 0;
603 general_status.rtcoff_min = 0;
625 general_status.lang_code = lang;
647 ret_val = general_status.lang_code;
669 lcode_string[0] = (U8BIT)((lang >> 16) & 0x000000ff);
670 lcode_string[1] = (U8BIT)((lang >> 8) & 0x000000ff);
671 lcode_string[2] = (U8BIT)((lang) & 0x000000ff);
672 lcode_string[3] =
'\0';
676 return(lcode_string);
694 #ifdef COMMON_INTERFACE 705 USE_UNWANTED_PARAM(standby);
750 snprintf((
char *)version_no, VERSION_NO_MAX,
"%02d.%02d.%02d", lib_ver_number[0], lib_ver_number[1], lib_ver_number[2]);
780 general_status.audio_signal = state;
802 ret_val = general_status.audio_signal;
838 oh = ((S8BIT)ohour * -1);
839 om = ((S8BIT)omin * -1);
846 SetOffset(0, 0, 0, 0, oh, om, oh, om);
875 ASSERT(ohour != NULL);
876 ASSERT(omin != NULL);
885 GetOffset(general_status.date_code, general_status.time_hour,
886 general_status.time_min, general_status.time_secs,
892 *ohour = (U8BIT)abs(oh);
893 *omin = (U8BIT)abs(om);
894 if ((oh < 0) || (om < 0))
926 U8BIT ohour1, U8BIT omin1, U8BIT ohour2, U8BIT omin2, BOOLEAN neg)
928 S8BIT oh1, om1, oh2, om2;
935 ASSERT(ohour1 <= 23);
937 ASSERT(ohour2 <= 23);
947 oh1 = ((S8BIT)ohour1 * -1);
948 om1 = ((S8BIT)omin1 * -1);
949 oh2 = ((S8BIT)ohour2 * -1);
950 om2 = ((S8BIT)omin2 * -1);
959 SetOffset(code, hour, min, secs, oh1, om1, oh2, om2);
987 U8BIT *ohour, U8BIT *omin, BOOLEAN *neg)
996 ASSERT(ohour != NULL);
997 ASSERT(omin != NULL);
1000 USE_UNWANTED_PARAM(code);
1001 USE_UNWANTED_PARAM(hour);
1002 USE_UNWANTED_PARAM(min);
1003 USE_UNWANTED_PARAM(secs);
1009 GetOffset(general_status.date_code, general_status.time_hour,
1010 general_status.time_min, general_status.time_secs, &oh, &om);
1015 *ohour = (U8BIT)abs(oh);
1016 *omin = (U8BIT)abs(om);
1017 if ((oh < 0) || (om < 0))
1055 general_status.time_hour = hour;
1056 general_status.time_min = min;
1057 general_status.time_secs = secs;
1063 general_status.time_set = TRUE;
1092 ret_val = general_status.time_hour;
1123 ret_val = general_status.time_min;
1154 ret_val = general_status.time_secs;
1183 general_status.date_code = code;
1189 general_status.time_set = TRUE;
1218 ret_val = general_status.date_code;
1240 U8BIT wday, day, month;
1242 E_STB_GC_WEEKDAY ret_val;
1251 ExtractUTCDate(general_status.date_code, &wday, &day, &month, &year);
1255 ret_val = (E_STB_GC_WEEKDAY)wday;
1275 U8BIT wday, day, month;
1285 ExtractUTCDate(general_status.date_code, &wday, &day, &month, &year);
1307 U8BIT wday, day, month;
1317 ExtractUTCDate(general_status.date_code, &wday, &day, &month, &year);
1339 U8BIT wday, day, month;
1349 ExtractUTCDate(general_status.date_code, &wday, &day, &month, &year);
1376 ASSERT(code != NULL);
1377 ASSERT(hour != NULL);
1378 ASSERT(min != NULL);
1379 ASSERT(secs != NULL);
1386 *code = general_status.date_code;
1387 *hour = general_status.time_hour;
1388 *min = general_status.time_min;
1389 *secs = general_status.time_secs;
1426 ret_val = !FutureTime(general_status.date_code, general_status.time_hour,
1427 general_status.time_min, general_status.time_secs,
1428 code, hour, min, secs);
1450 E_STB_GC_WEEKDAY ret_val;
1454 ret_val = (E_STB_GC_WEEKDAY)(((code + 2L) % 7) + 1);
1474 E_STB_GC_WEEKDAY wday;
1480 if ((wday >= WEEKDAY_MONDAY) && (wday <= WEEKDAY_FRIDAY))
1503 E_STB_GC_WEEKDAY wday;
1509 if ((wday >= WEEKDAY_SATURDAY) && (wday <= WEEKDAY_SUNDAY))
1541 U8BIT ohour, U8BIT omin, U8BIT osecs,
1542 U16BIT *rcode, U8BIT *rhour, U8BIT *rmin, U8BIT *rsecs,
1543 E_STB_GC_CALCTYPE calc)
1547 ASSERT(rcode != NULL);
1548 ASSERT(rhour != NULL);
1549 ASSERT(rmin != NULL);
1550 ASSERT(rsecs != NULL);
1555 AddTime(code, hour, min, secs,
1556 (S16BIT)ohour, (S16BIT)omin, (S16BIT)osecs,
1557 rcode, rhour, rmin, rsecs);
1561 AddTime(code, hour, min, secs,
1562 ((S16BIT)ohour * -1), ((S16BIT)omin * -1), ((S16BIT)osecs * -1),
1563 rcode, rhour, rmin, rsecs);
1592 U16BIT *rcode, U8BIT *rhour, U8BIT *rmin, U8BIT *rsecs,
1593 E_STB_GC_CONVTYPE conv)
1599 ASSERT(rcode != NULL);
1600 ASSERT(rhour != NULL);
1601 ASSERT(rmin != NULL);
1602 ASSERT(rsecs != NULL);
1607 GetOffset(code, hour, min, secs, &ohour, &omin);
1612 AddTime(code, hour, min, secs, (S16BIT)ohour, (S16BIT)omin, 0, rcode, rhour, rmin, rsecs);
1616 AddTime(code, hour, min, secs, (S16BIT)(ohour * -1), (S16BIT)(omin * -1), 0,
1617 rcode, rhour, rmin, rsecs);
1648 U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2,
1649 E_STB_GC_COMPTYPE comp)
1651 BOOLEAN ret_val = FALSE;
1664 if ((code1 == code2) && (hour1 == hour2) && (min1 == min2) && (secs1 == secs2))
1672 ret_val = FutureTime(code2, hour2, min2, secs2, code1, hour1, min1, secs1);
1678 ret_val = FutureTime(code1, hour1, min1, secs1, code2, hour2, min2, secs2);
1683 ret_val = FutureTime(code1, hour1, min1, secs1, code2, hour2, min2, secs2);
1689 ret_val = FutureTime(code2, hour2, min2, secs2, code1, hour1, min1, secs1);
1715 U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2)
1717 S32BIT time1, time2;
1721 time1 = ((code1 * 24 + hour1) * 60 + min1) * 60 + secs1;
1722 time2 = ((code2 * 24 + hour2) * 60 + min2) * 60 + secs2;
1726 return(time1 - time2);
1746 U8BIT lhour, lmin, lsecs;
1758 GetOffset(code, hour, min, 0, &ohour, &omin);
1759 AddTime(code, hour, min, 0, (S16BIT)ohour, (S16BIT)omin, 0,
1760 &lcode, &lhour, &lmin, &lsecs);
1772 snprintf((
char *)time_string, TIME_STRING_MAX,
"%d:%02d pm", lhour, lmin);
1778 snprintf((
char *)time_string, TIME_STRING_MAX,
"%d:%02d am", lhour, lmin);
1783 snprintf((
char *)time_string, TIME_STRING_MAX,
"%02d:%02d", lhour, lmin);
1792 return(time_string);
1812 U8BIT lhour, lmin, lsecs, wday, day, month;
1824 GetOffset(code, hour, min, 0, &ohour, &omin);
1825 AddTime(code, hour, min, 0, (S16BIT)ohour, (S16BIT)omin, 0,
1826 &lcode, &lhour, &lmin, &lsecs);
1827 ExtractUTCDate(lcode, &wday, &day, &month, &year);
1834 snprintf((
char *)date_string, DATE_STRING_MAX,
"%02d/%02d/%04d", day, month, year);
1838 snprintf((
char *)date_string, DATE_STRING_MAX,
"%04d/%02d/%02d", year, month, day);
1847 return(date_string);
1868 U8BIT *month, U16BIT *year)
1871 U8BIT lhour, lmin, lsecs;
1883 GetOffset(code, hour, min, 0, &ohour, &omin);
1884 AddTime(code, hour, min, 0, (S16BIT)ohour, (S16BIT)omin, 0,
1885 &lcode, &lhour, &lmin, &lsecs);
1889 ExtractUTCDate(lcode, wday, day, month, year);
1906 ExtractUTCDate(code, wday, day, month, year);
1932 snprintf((
char *)clock_string, CLOCK_STRING_MAX,
"%02d:%02d:%02d", hour, min, secs);
1936 snprintf((
char *)clock_string, CLOCK_STRING_MAX,
"%02d:%02d:%02d", secs, min, hour);
1940 snprintf((
char *)clock_string, CLOCK_STRING_MAX,
"%02d:%02d", hour, min);
1944 snprintf((
char *)clock_string, CLOCK_STRING_MAX,
"%02d:%02d", min, hour);
1953 return(clock_string);
1971 U16BIT gcode, lcode;
1972 U8BIT ghour, gmin, secs, wday;
1977 ASSERT(year != NULL);
1978 ASSERT(month != NULL);
1979 ASSERT(day != NULL);
1980 ASSERT(hour != NULL);
1981 ASSERT(min != NULL);
1987 gcode = general_status.date_code;
1988 ghour = general_status.time_hour;
1989 gmin = general_status.time_min;
1991 GetOffset(gcode, ghour, gmin, 0, &ohour, &omin);
1992 AddTime(gcode, ghour, gmin, 0, (S16BIT)ohour, (S16BIT)omin, 0,
1993 &lcode, hour, min, &secs);
1997 ExtractUTCDate(lcode, &wday, day, month, year);
2011 if (state != general_status.use_broadcast_time)
2015 general_status.use_broadcast_time = state;
2017 if (!general_status.use_broadcast_time)
2021 general_status.time_set = TRUE;
2053 ASSERT( hour < 24 );
2054 ASSERT( mins < 60 );
2055 ASSERT( secs < 60 );
2056 dtm = (U32DHMS)date << D_DSHFT |
2057 (U32DHMS)hour << D_HSHFT |
2058 (U32DHMS)mins << D_MSHFT |
2102 return DHMS_CREATE(date, hour, mins, secs);
2116 hours = num_seconds / 3600;
2117 num_seconds %= 3600;
2119 mins = num_seconds / 60;
2124 return(DHMS_CREATE(0, hours, mins, num_seconds));
2138 S32BIT rcode, rhour, rmins, rsecs;
2142 if (calc == CALC_ADD)
2146 rcode = DHMS_DAYS(dhms) + DHMS_DAYS(period);
2147 rhour = DHMS_HOUR32(dhms) + DHMS_HOUR32(period);
2148 rmins = DHMS_MINS32(dhms) + DHMS_MINS32(period);
2149 rsecs = DHMS_SECS32(dhms) + DHMS_SECS32(period);
2167 else if (calc == CALC_SUB)
2171 rcode = (S32BIT)DHMS_DAYS(dhms) - (S32BIT)DHMS_DAYS(period);
2172 rhour = (S32BIT)DHMS_HOUR32(dhms) - (S32BIT)DHMS_HOUR32(period);
2173 rmins = (S32BIT)DHMS_MINS32(dhms) - (S32BIT)DHMS_MINS32(period);
2174 rsecs = (S32BIT)DHMS_SECS32(dhms) - (S32BIT)DHMS_SECS32(period);
2195 return DHMS_CREATE(rcode, rhour, rmins, rsecs);
2215 GetOffset(DHMS_DATE(dhms), DHMS_HOUR(dhms), DHMS_MINS(dhms), 0, &ohour, &omin);
2219 if (conv == CONV_GMT)
2233 else if (conv == CONV_LOCAL)
2273 now = DHMS_CREATE(general_status.date_code,
2274 general_status.time_hour,
2275 general_status.time_min,
2276 general_status.time_secs);
2306 GetOffset( general_status.date_code,
2307 general_status.time_hour,
2308 general_status.time_min, 0, &ohour, &omin);
2314 DHMS_CREATE(general_status.date_code,
2315 general_status.time_hour,
2316 general_status.time_min,
2317 general_status.time_secs),
2318 DHMS_CREATE(0, ohour, omin, 0), CALC_SUB);
2323 DHMS_CREATE(general_status.date_code,
2324 general_status.time_hour,
2325 general_status.time_min,
2326 general_status.time_secs),
2327 DHMS_CREATE(0, ohour, omin, 0), CALC_ADD);
2352 U8BIT wday, day, month;
2358 ExtractUTCDate(DHMS_DATE(dhms), &wday, &day, &month, &year);
2362 snprintf((
char *)date_string, DATE_STRING_MAX,
"%02d/%02d/%04d", day, month, year);
2366 snprintf((
char *)date_string, DATE_STRING_MAX,
"%04d/%02d/%02d", year, month, day);
2373 return(date_string);
2396 lhour = DHMS_HOUR(dhms);
2397 lmins = DHMS_MINS(dhms);
2406 snprintf((
char *)time_string, TIME_STRING_MAX,
"%d:%02d pm", lhour, lmins);
2412 snprintf((
char *)time_string, TIME_STRING_MAX,
"%d:%02d am", lhour, lmins);
2416 snprintf((
char *)time_string, TIME_STRING_MAX,
"%02d:%02d", lhour, lmins);
2424 return(time_string);
2440 ConvertTimestamp(timestamp, &date, &h, &m, &s);
2461 code = DHMS_DATE(time);
2462 h = DHMS_HOUR(time);
2463 m = DHMS_MINS(time);
2464 s = DHMS_SECS(time);
2466 timestamp = ConvertToTimestamp(code, h, m, s);
void STB_GCInitialise(void)
Initialises general control.
void STB_GCSetAudioSignal(BOOLEAN state)
Enables/disables audio signal bleep and writes value into general control store.
U32DHMS STB_GCCalculateDHMS(U32DHMS dhms, U32DHMS period, E_STB_GC_CALCTYPE calc)
Calculates the date/time when the period is added/subtracted to/from dhms.
U32BIT STB_OSGetClockGMT(void)
Returns the system time in seconds.
U32DHMS STB_GCCreateDHMSFromSeconds(U32BIT num_seconds)
Creates a DHMS value consisting of hours, minutes and seconds from a number of seconds.
U8BIT * STB_GCGetLangCodeString(U32BIT lang)
Converts the given 24bit ISO language code to a null-terminated string.
BOOLEAN STB_GCIsFutureDateTime(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs)
Tests given date and time against current GMT date and time.
void STB_OSSetClockRTC(U32BIT num_seconds)
Set the local time in seconds since midnight 1-1-1970.
Header file - macros and function prototypes for public use.
U8BIT STB_GCGetGMTDay(void)
Reads the current GMT day number.
U32DHMS STB_GCCreateDHMS(U16BIT date, U8BIT hour, U8BIT mins, U8BIT secs)
Makes U32DHMS formated date/time from date code, hour, minutes, seconds.
U8BIT * STB_GCGetTimeStringDHMS(U32DHMS dhms, E_STB_GC_TIMETYPE format)
Supplies specified time as local time string, in format requested.
void STB_GCCalculateDateTime(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs, U8BIT ohour, U8BIT omin, U8BIT osecs, U16BIT *rcode, U8BIT *rhour, U8BIT *rmin, U8BIT *rsecs, E_STB_GC_CALCTYPE calc)
Adds or subtracts offset from a date/time.
U16BIT STB_HWGetCustomerId(void)
Returns the platform customer identifier code.
U16BIT STB_HWGetHwId(void)
Returns the platform hardware identifier code.
U32BIT STB_HWGetBoxSerialNumber(void)
Returns the serial number of the Set Top Box.
U8BIT * STB_GCGetVersionNumberString(void)
Retrieves and returns the library version number as a string.
void STB_GCSetGMTTime(U8BIT hour, U8BIT min, U8BIT secs)
Sets current GMT time.
void STB_GCSetGMTDate(U16BIT code)
Sets current GMT date.
U8BIT * STB_GCGetTimeString(U16BIT code, U8BIT hour, U8BIT min, E_STB_GC_TIMETYPE format)
Supplies specified time as local time string, in format requested.
Header file - Function prototypes for A/V control.
void STB_GCGetMJDDateInfo(U16BIT code, U8BIT *day, U8BIT *wday, U8BIT *month, U16BIT *year)
Returns the date info from the given MJD date code.
E_STB_GC_WEEKDAY STB_GCGetGMTWeekDay(void)
Reads the current GMT weekday number.
void STB_GCUseBroadcastTime(BOOLEAN state)
Sets whether the date/time are taken from the broadcast or the system. The default is to use the broa...
void STB_OSMutexUnlock(void *mutex)
Unlock a mutex (a.k.a. 'leave', 'signal' or 'release')
U32BIT STB_GCConvertToTimestamp(U32DHMS time)
Returns the number of seconds from midnight (UTC) 1 January 1970 to the specified U32DHMS time...
void STB_GCConvertDateTime(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs, U16BIT *rcode, U8BIT *rhour, U8BIT *rmin, U8BIT *rsecs, E_STB_GC_CONVTYPE conv)
Converts specified date / time to another.
BOOLEAN STB_GCCompareDateTime(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1, U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2, E_STB_GC_COMPTYPE comp)
Compares one date/time to another.
BOOLEAN STB_GCGetAudioSignal(void)
Reads the current audio signal bleep state from general control store.
U8BIT STB_GCGetGMTMonth(void)
Reads the current GMT month number.
void STB_GCGetGMTDateTime(U16BIT *code, U8BIT *hour, U8BIT *min, U8BIT *secs)
Reads the current GMT date code and time.
U32BIT STB_OSGetClockRTC(void)
Returns the current time in seconds. This is calculated by using the set UTC time and adding the diff...
S32BIT STB_GCDateTimeDiff(U16BIT code1, U8BIT hour1, U8BIT min1, U8BIT secs1, U16BIT code2, U8BIT hour2, U8BIT min2, U8BIT secs2)
Returns the difference in seconds between the two dates/times, as time1 - time2, so the result will b...
void STB_GCSetSearchLangCode(U32BIT lang)
Writes SI search language code into general control store.
void STB_GCSetLocalTimeOffset(U8BIT ohour, U8BIT omin, BOOLEAN neg)
Sets local time offset from GMT.
Debug functions header file.
void STB_OSMutexLock(void *mutex)
Lock a mutex (a.k.a. 'enter', 'wait' or 'get').
Header file - macros and function prototypes for public use.
U8BIT * STB_GCGetClockString(U8BIT hour, U8BIT min, U8BIT secs, E_STB_GC_CLOCKTYPE format)
Supplies specified time as clock string, in format requested.
U8BIT STB_GCGetGMTHour(void)
Reads the current GMT hour.
U8BIT STB_GCGetGMTMin(void)
Reads the current GMT minute.
U8BIT * STB_GCGetFullSerialString(void)
Retrieves and returns the fulls serial string, incorporating the hardware version box serial number a...
U8BIT * STB_GCGetDateString(U16BIT code, U8BIT hour, U8BIT min, E_STB_GC_DATETYPE format)
Supplies specifed date as local date string, in format requested.
U32DHMS STB_GCNowDHMSGmt(void)
Reads the current GMT date code and time.
void STB_GCGetLocalTimeChange(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs, U8BIT *ohour, U8BIT *omin, BOOLEAN *neg)
Reads local time offset from GMT.
Header file - library version number.
void STB_GCGetDateInfo(U16BIT code, U8BIT hour, U8BIT min, U8BIT *day, U8BIT *wday, U8BIT *month, U16BIT *year)
Get the day, weekday, month and the year from a date code and hour / minute offset.
U32DHMS STB_GCConvertDHMS(U32DHMS dhms, E_STB_GC_CONVTYPE conv)
Converts the given date/time to local or GMT.
Header file - Function prototypes for operating system.
System Wide Global Technical Data Type Definitions.
BOOLEAN STB_GCIsDateDayWeek(U16BIT code)
Tests whether the weekday of the specified date code is during the week.
void STB_GCGetLocalDateTime(U16BIT *year, U8BIT *month, U8BIT *day, U8BIT *hour, U8BIT *min)
Get the local year, month, day, hour and minute.
void STB_GCSetLocalTimeChange(U16BIT code, U8BIT hour, U8BIT min, U8BIT secs, U8BIT ohour1, U8BIT omin1, U8BIT ohour2, U8BIT omin2, BOOLEAN neg)
Sets new and old local time offset from GMT.
U16BIT STB_GCGetGMTDate(void)
Reads the current GMT date code.
U32DHMS STB_GCNowDHMSLocal(void)
Reads the current Local date code and time.
void STB_GCSetCIStandby(BOOLEAN standby)
Enables / disables CI standby state.
void STB_GCGetLocalTimeOffset(U8BIT *ohour, U8BIT *omin, BOOLEAN *neg)
Reads local time offset from GMT.
U32DHMS STB_GCCreateDebugDHMS(U32BIT date, U32BIT hour, U32BIT mins, U32BIT secs)
Makes U32DHMS formated date/time from date code, hour, minutes, seconds.
void STB_OSSetClockGMT(U32BIT num_seconds)
Set the time in seconds since midnight 1-1-1970 in GMT.
U32BIT STB_GCGetSearchLangCode(void)
Reads the SI search language code from general control store.
U8BIT STB_GCGetGMTSecs(void)
Reads the current GMT seconds.
void * STB_OSCreateMutex(void)
Create a mutex.
BOOLEAN STB_GCIsDateDayWeekend(U16BIT code)
Tests whether the weekday of the specified date code is during the weekend.
E_STB_GC_WEEKDAY STB_GCGetDateWeekDay(U16BIT code)
Returns the weekday number of the specified date code.
Header file - Function prototypes for front panel control.
U32DHMS STB_GCConvertTimestamp(U32BIT timestamp)
Converts a timestamp expressed in number of seconds since midnight (UTC) 1 January 1970...
U8BIT * STB_GCGetDateStringDHMS(U32DHMS dhms, E_STB_GC_DATETYPE format)
Supplies specifed date as local date string, in format requested.
U16BIT STB_GCGetGMTYear(void)
Reads the current GMT year number.