Skip to content

Commit 203edfa

Browse files
committed
Doxygen for 941ad2f
1 parent 729a38b commit 203edfa

23 files changed

+311
-275
lines changed

main/code_example.html

Lines changed: 13 additions & 12 deletions
Large diffs are not rendered by default.

main/core__sntp__client_8h_source.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@
286286
<div class="ttc" id="agroup__sntp__callback__types_html_gade7b1a15684e1272ef7dbb9e4486c285"><div class="ttname"><a href="group__sntp__callback__types.html#gade7b1a15684e1272ef7dbb9e4486c285">SntpSetTime_t</a></div><div class="ttdeci">void(* SntpSetTime_t)(const SntpServerInfo_t *pTimeServer, const SntpTimestamp_t *pServerTime, int64_t clockOffsetMs, SntpLeapSecondInfo_t leapSecondInfo)</div><div class="ttdoc">Interface for user-defined function to update the system clock time so that it is synchronized the ti...</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:134</div></div>
287287
<div class="ttc" id="agroup__sntp__callback__types_html_gae382a67b0ffbb4721d8d599efe3020c4"><div class="ttname"><a href="group__sntp__callback__types.html#gae382a67b0ffbb4721d8d599efe3020c4">SntpValidateServerAuth_t</a></div><div class="ttdeci">SntpStatus_t(* SntpValidateServerAuth_t)(SntpAuthContext_t *pContext, const SntpServerInfo_t *pTimeServer, const void *pResponseData, uint16_t responseSize)</div><div class="ttdoc">Interface for user-defined function to authenticate server by validating the authentication code pres...</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:328</div></div>
288288
<div class="ttc" id="agroup__sntp__callback__types_html_gaef268b4cc2cf00e3e573b637cde7c09e"><div class="ttname"><a href="group__sntp__callback__types.html#gaef268b4cc2cf00e3e573b637cde7c09e">SntpResolveDns_t</a></div><div class="ttdeci">bool(* SntpResolveDns_t)(const SntpServerInfo_t *pServerAddr, uint32_t *pIpV4Addr)</div><div class="ttdoc">Interface for user-defined function to resolve time server domain-name to an IPv4 address....</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:89</div></div>
289-
<div class="ttc" id="agroup__sntp__enum__types_html_ga69e2cb17ab4e253491602ccfe48b141f"><div class="ttname"><a href="group__sntp__enum__types.html#ga69e2cb17ab4e253491602ccfe48b141f">SntpLeapSecondInfo_t</a></div><div class="ttdeci">SntpLeapSecondInfo_t</div><div class="ttdoc">Enumeration for leap second information that an SNTP server can send its response to a time request....</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:265</div></div>
290-
<div class="ttc" id="agroup__sntp__enum__types_html_gaef7b22d8008bbfbbc7bbea5a7a30e798"><div class="ttname"><a href="group__sntp__enum__types.html#gaef7b22d8008bbfbbc7bbea5a7a30e798">SntpStatus_t</a></div><div class="ttdeci">SntpStatus_t</div><div class="ttdoc">Enumeration of status codes that can be returned by the coreSNTP Library API.</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:140</div></div>
289+
<div class="ttc" id="agroup__sntp__enum__types_html_ga69e2cb17ab4e253491602ccfe48b141f"><div class="ttname"><a href="group__sntp__enum__types.html#ga69e2cb17ab4e253491602ccfe48b141f">SntpLeapSecondInfo_t</a></div><div class="ttdeci">SntpLeapSecondInfo_t</div><div class="ttdoc">Enumeration for leap second information that an SNTP server can send its response to a time request....</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:273</div></div>
290+
<div class="ttc" id="agroup__sntp__enum__types_html_gaef7b22d8008bbfbbc7bbea5a7a30e798"><div class="ttname"><a href="group__sntp__enum__types.html#gaef7b22d8008bbfbbc7bbea5a7a30e798">SntpStatus_t</a></div><div class="ttdeci">SntpStatus_t</div><div class="ttdoc">Enumeration of status codes that can be returned by the coreSNTP Library API.</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:154</div></div>
291291
<div class="ttc" id="agroup__sntp__struct__types_html_ga7769e434e7811caed8cd6fd7f9ec26ec"><div class="ttname"><a href="group__sntp__struct__types.html#ga7769e434e7811caed8cd6fd7f9ec26ec">NetworkContext_t</a></div><div class="ttdeci">struct NetworkContext NetworkContext_t</div><div class="ttdoc">A user-defined type for context that is passed to the transport interface functions....</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:148</div></div>
292292
<div class="ttc" id="agroup__sntp__struct__types_html_gaff243b342eebc2622fbb493d08663133"><div class="ttname"><a href="group__sntp__struct__types.html#gaff243b342eebc2622fbb493d08663133">SntpAuthContext_t</a></div><div class="ttdeci">struct SntpAuthContext SntpAuthContext_t</div><div class="ttdoc">A user-defined type for context that is passed to the authentication interface functions....</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:249</div></div>
293293
<div class="ttc" id="astruct_sntp_authentication_interface__t_html"><div class="ttname"><a href="struct_sntp_authentication_interface__t.html">SntpAuthenticationInterface_t</a></div><div class="ttdoc">Struct representing the authentication interface for securely communicating with time servers.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:343</div></div>
@@ -313,7 +313,7 @@
313313
<div class="ttc" id="astruct_sntp_server_info__t_html_a1c2da66f537d838bb5624ece9042771d"><div class="ttname"><a href="struct_sntp_server_info__t.html#a1c2da66f537d838bb5624ece9042771d">SntpServerInfo_t::serverNameLen</a></div><div class="ttdeci">size_t serverNameLen</div><div class="ttdoc">The length of the server name.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:70</div></div>
314314
<div class="ttc" id="astruct_sntp_server_info__t_html_a2c89b20c6fa40631a1d70000a39a3df5"><div class="ttname"><a href="struct_sntp_server_info__t.html#a2c89b20c6fa40631a1d70000a39a3df5">SntpServerInfo_t::port</a></div><div class="ttdeci">uint16_t port</div><div class="ttdoc">The UDP port supported by the server for SNTP/NTP communication.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:71</div></div>
315315
<div class="ttc" id="astruct_sntp_server_info__t_html_a3ac6b772408c867c83bc278aebbfe192"><div class="ttname"><a href="struct_sntp_server_info__t.html#a3ac6b772408c867c83bc278aebbfe192">SntpServerInfo_t::pServerName</a></div><div class="ttdeci">const char * pServerName</div><div class="ttdoc">The time server name.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:69</div></div>
316-
<div class="ttc" id="astruct_sntp_timestamp__t_html"><div class="ttname"><a href="struct_sntp_timestamp__t.html">SntpTimestamp_t</a></div><div class="ttdoc">Structure representing an SNTP timestamp.</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:284</div></div>
316+
<div class="ttc" id="astruct_sntp_timestamp__t_html"><div class="ttname"><a href="struct_sntp_timestamp__t.html">SntpTimestamp_t</a></div><div class="ttdoc">Structure representing an SNTP timestamp.</div><div class="ttdef"><b>Definition:</b> core_sntp_serializer.h:292</div></div>
317317
<div class="ttc" id="astruct_udp_transport_interface__t_html"><div class="ttname"><a href="struct_udp_transport_interface__t.html">UdpTransportInterface_t</a></div><div class="ttdoc">Struct representing the UDP transport interface for user-defined functions that coreSNTP library depe...</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:233</div></div>
318318
<div class="ttc" id="astruct_udp_transport_interface__t_html_a30f8e36e611f4d510d4ffa20b19d3cb4"><div class="ttname"><a href="struct_udp_transport_interface__t.html#a30f8e36e611f4d510d4ffa20b19d3cb4">UdpTransportInterface_t::recvFrom</a></div><div class="ttdeci">UdpTransportRecvFrom_t recvFrom</div><div class="ttdoc">The user-defined UDP receive function.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:237</div></div>
319319
<div class="ttc" id="astruct_udp_transport_interface__t_html_a332883a73a30ab9fb229ff24f305f0b5"><div class="ttname"><a href="struct_udp_transport_interface__t.html#a332883a73a30ab9fb229ff24f305f0b5">UdpTransportInterface_t::sendTo</a></div><div class="ttdeci">UdpTransportSendTo_t sendTo</div><div class="ttdoc">The user-defined UDP send function.</div><div class="ttdef"><b>Definition:</b> core_sntp_client.h:236</div></div>

main/core__sntp__serializer_8c.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@
195195
<tr class="memitem:a48dc19a11eb31d6077a2ca8964a1c6a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__sntp__enum__types.html#gaef7b22d8008bbfbbc7bbea5a7a30e798">SntpStatus_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="core__sntp__serializer_8c.html#a48dc19a11eb31d6077a2ca8964a1c6a9">Sntp_CalculatePollInterval</a> (uint16_t clockFreqTolerance, uint16_t desiredAccuracy, uint32_t *pPollInterval)</td></tr>
196196
<tr class="memdesc:a48dc19a11eb31d6077a2ca8964a1c6a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility to calculate the poll interval of sending periodic time queries to servers to achieve a desired system clock accuracy for a given frequency tolerance of the system clock. <br /></td></tr>
197197
<tr class="separator:a48dc19a11eb31d6077a2ca8964a1c6a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
198-
<tr class="memitem:ae2e96d3bc60bb30db3107a2bc1d69121"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__sntp__enum__types.html#gaef7b22d8008bbfbbc7bbea5a7a30e798">SntpStatus_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="core__sntp__serializer_8c.html#ae2e96d3bc60bb30db3107a2bc1d69121">Sntp_ConvertToUnixTime</a> (const <a class="el" href="struct_sntp_timestamp__t.html">SntpTimestamp_t</a> *pSntpTime, uint32_t *pUnixTimeSecs, uint32_t *pUnixTimeMicrosecs)</td></tr>
199-
<tr class="memdesc:ae2e96d3bc60bb30db3107a2bc1d69121"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility to convert SNTP timestamp (that uses 1st Jan 1900 as the epoch) to UNIX timestamp (that uses 1st Jan 1970 as the epoch). <br /></td></tr>
200-
<tr class="separator:ae2e96d3bc60bb30db3107a2bc1d69121"><td class="memSeparator" colspan="2">&#160;</td></tr>
198+
<tr class="memitem:a9d07377dd8efc162dcd33a53403f8d9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__sntp__enum__types.html#gaef7b22d8008bbfbbc7bbea5a7a30e798">SntpStatus_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="core__sntp__serializer_8c.html#a9d07377dd8efc162dcd33a53403f8d9a">Sntp_ConvertToUnixTime</a> (const <a class="el" href="struct_sntp_timestamp__t.html">SntpTimestamp_t</a> *pSntpTime, <a class="el" href="core__sntp__serializer_8h.html#a8877fd3eea1a90efdd3cea1024d5282d">UnixTime_t</a> *pUnixTimeSecs, uint32_t *pUnixTimeMicrosecs)</td></tr>
199+
<tr class="memdesc:a9d07377dd8efc162dcd33a53403f8d9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Utility to convert SNTP timestamp (that uses 1st Jan 1900 as the epoch) to UNIX timestamp (that uses 1st Jan 1970 as the epoch). <br /></td></tr>
200+
<tr class="separator:a9d07377dd8efc162dcd33a53403f8d9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
201201
</table>
202202
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
203203
<div class="textblock"><p>Implementation of the Serializer API of the coreSNTP library. </p>
@@ -947,8 +947,8 @@ <h2 class="memtitle"><span class="permalink"><a href="#a48dc19a11eb31d6077a2ca89
947947

948948
</div>
949949
</div>
950-
<a id="ae2e96d3bc60bb30db3107a2bc1d69121" name="ae2e96d3bc60bb30db3107a2bc1d69121"></a>
951-
<h2 class="memtitle"><span class="permalink"><a href="#ae2e96d3bc60bb30db3107a2bc1d69121">&#9670;&#160;</a></span>Sntp_ConvertToUnixTime()</h2>
950+
<a id="a9d07377dd8efc162dcd33a53403f8d9a" name="a9d07377dd8efc162dcd33a53403f8d9a"></a>
951+
<h2 class="memtitle"><span class="permalink"><a href="#a9d07377dd8efc162dcd33a53403f8d9a">&#9670;&#160;</a></span>Sntp_ConvertToUnixTime()</h2>
952952

953953
<div class="memitem">
954954
<div class="memproto">
@@ -962,7 +962,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#ae2e96d3bc60bb30db3107a2b
962962
<tr>
963963
<td class="paramkey"></td>
964964
<td></td>
965-
<td class="paramtype">uint32_t *&#160;</td>
965+
<td class="paramtype"><a class="el" href="core__sntp__serializer_8h.html#a8877fd3eea1a90efdd3cea1024d5282d">UnixTime_t</a> *&#160;</td>
966966
<td class="paramname"><em>pUnixTimeSecs</em>, </td>
967967
</tr>
968968
<tr>
@@ -980,9 +980,12 @@ <h2 class="memtitle"><span class="permalink"><a href="#ae2e96d3bc60bb30db3107a2b
980980
</div><div class="memdoc">
981981

982982
<p>Utility to convert SNTP timestamp (that uses 1st Jan 1900 as the epoch) to UNIX timestamp (that uses 1st Jan 1970 as the epoch). </p>
983-
<dl class="section note"><dt>Note</dt><dd>This function can ONLY handle conversions of SNTP timestamps that lie in the range from 1st Jan 1970 0h 0m 0s, the UNIX epoch time, to 19th Jan 2038 3h 14m 7s, the maximum UNIX time that can be represented in a signed 32 bit integer. (The limitation is to support systems that use signed 32-bit integer to represent the seconds part of the UNIX time.)</dd>
984-
<dd>
985-
This function supports overflow of the SNTP timestamp (from the 7 Feb 2036 6h 28m 16s time, i.e. SNTP era 1) by treating the timestamps with seconds part in the range [0, 61,505,152] seconds where the upper limit represents the UNIX overflow time (i.e. 19 Jan 2038 3h 14m 7s) for systems that use signed 32-bit integer to represent time.</dd></dl>
983+
<dl class="section note"><dt>Note</dt><dd>This function converts SNTP timestamps to UNIX time supporting both 32-bit and 64-bit representations based on the configuration macro USE_LEGACY_TIME_API.</dd></dl>
984+
<ul>
985+
<li>If USE_LEGACY_TIME_API is defined, the conversion is limited to the date range from 1st Jan 1970 0h 0m 0s (UNIX epoch) to 19th Jan 2038 3h 14m 7s, due to the 32-bit width limitation.</li>
986+
<li>If USE_LEGACY_TIME_API is not defined, 64-bit UNIX time representation is used, allowing conversion of SNTP timestamps beyond the year 2038 (Y2038 problem mitigated).</li>
987+
</ul>
988+
<dl class="section note"><dt>Note</dt><dd>The function also correctly handles SNTP era overflow (from 7 Feb 2036 6h 28m 16s, i.e., SNTP era 1) to ensure accurate conversion across SNTP eras.</dd></dl>
986989
<dl class="params"><dt>Parameters</dt><dd>
987990
<table class="params">
988991
<tr><td class="paramdir">[in]</td><td class="paramname">pSntpTime</td><td>The SNTP timestamp to convert to UNIX time. </td></tr>
@@ -993,8 +996,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#ae2e96d3bc60bb30db3107a2b
993996
</dl>
994997
<dl class="section return"><dt>Returns</dt><dd>Returns one of the following:<ul>
995998
<li><a class="el" href="group__sntp__enum__types.html#ggaef7b22d8008bbfbbc7bbea5a7a30e798a8486f9ee1815b43418a9c0478bd8f016" title="Successful operation of an SNTP API.">SntpSuccess</a> if conversion to UNIX time is successful</li>
996-
<li><a class="el" href="group__sntp__enum__types.html#ggaef7b22d8008bbfbbc7bbea5a7a30e798a1829c0158e4f2630b6806afa4511dfd7" title="Invalid parameter passed to an API function.">SntpErrorBadParameter</a> if any of the passed parameters are NULL.</li>
997-
<li><a class="el" href="group__sntp__enum__types.html#ggaef7b22d8008bbfbbc7bbea5a7a30e798afba7203b8ee0322999adf1edcca6e0cf" title="SNTP timestamp cannot be converted to UNIX time as time does not lie in time range supported by Sntp_...">SntpErrorTimeNotSupported</a> if the passed SNTP time does not lie in the supported time range. </li>
999+
<li><a class="el" href="group__sntp__enum__types.html#ggaef7b22d8008bbfbbc7bbea5a7a30e798a1829c0158e4f2630b6806afa4511dfd7" title="Invalid parameter passed to an API function.">SntpErrorBadParameter</a> if any of the passed parameters are NULL. </li>
9981000
</ul>
9991001
</dd></dl>
10001002

0 commit comments

Comments
 (0)