43
43
#endif
44
44
/* *INDENT-ON* */
45
45
46
- /**
47
- * @brief Type representing seconds since Unix epoch (January 1, 1970 UTC).
48
- *
49
- * The width of this type depends on the configuration macro USE_LEGACY_TIME_API:
50
- * - If USE_LEGACY_TIME_API is defined, a 32-bit unsigned integer is used.
51
- * This limits date representation to the year 2038 (Y2038 limitation).
52
- * - Otherwise, a 64-bit unsigned integer is used for Y2038 compliance.
53
- */
54
- #ifdef USE_LEGACY_TIME_API
55
- typedef uint32_t UnixTime_t ; /**< 32-bit Unix time for legacy systems. */
56
- #else
57
- typedef uint64_t UnixTime_t ; /**< 64-bit Unix time for Y2038 compliance. */
58
- #endif
59
-
60
46
/**
61
47
* @ingroup sntp_constants
62
48
* @brief The base packet size of request and response of the (S)NTP protocol.
@@ -504,15 +490,7 @@ SntpStatus_t Sntp_CalculatePollInterval( uint16_t clockFreqTolerance,
504
490
* @brief Utility to convert SNTP timestamp (that uses 1st Jan 1900 as the epoch) to
505
491
* UNIX timestamp (that uses 1st Jan 1970 as the epoch).
506
492
*
507
- * @note This function converts SNTP timestamps to UNIX time supporting both 32-bit and
508
- * 64-bit representations based on the configuration macro USE_LEGACY_TIME_API.
509
- *
510
- * - If USE_LEGACY_TIME_API is defined, the conversion is limited to the date range
511
- * from 1st Jan 1970 0h 0m 0s (UNIX epoch) to 19th Jan 2038 3h 14m 7s, due to the
512
- * 32-bit width limitation.
513
- *
514
- * - If USE_LEGACY_TIME_API is not defined, 64-bit UNIX time representation is used,
515
- * allowing conversion of SNTP timestamps beyond the year 2038 (Y2038 problem mitigated).
493
+ * Refer to (this image)[docs/doxygen/images/Ntp_To_Unix_Time.png].
516
494
*
517
495
* @note The function also correctly handles SNTP era overflow (from 7 Feb 2036 6h 28m 16s,
518
496
* i.e., SNTP era 1) to ensure accurate conversion across SNTP eras.
@@ -529,7 +507,7 @@ SntpStatus_t Sntp_CalculatePollInterval( uint16_t clockFreqTolerance,
529
507
*/
530
508
/* @[define_sntp_converttounixtime] */
531
509
SntpStatus_t Sntp_ConvertToUnixTime ( const SntpTimestamp_t * pSntpTime ,
532
- UnixTime_t * pUnixTimeSecs ,
510
+ uint32_t * pUnixTimeSecs ,
533
511
uint32_t * pUnixTimeMicrosecs );
534
512
/* @[define_sntp_converttounixtime] */
535
513
0 commit comments