...
Files
clk.h/clk.c
Prototype
Code Block |
---|
|
CPU_BOOLEAN Clk_GetTS_NTP (CLK_TS_SEC *p_ts_ntp_sec); |
Arguments
p_ts_ntp_sec
Pointer to variable that will receive the NTP timestamp:
...
NTP timestamp will eventually overflow, thus it's not possible to get NTP timestamp for years on or after CLK_NTP_EPOCH_YR_END
.
Example Usage
Anchor |
---|
| Listing - Clk_GetTS_NTP() Example Usage |
---|
| Listing - Clk_GetTS_NTP() Example Usage |
---|
|
Code Block |
---|
language | cpp |
---|
title | Listing - Clk_GetTS_NTP() Example Usage |
---|
linenumbers | true |
---|
|
CLK_TS_SEC ts_ntp_sec;
CPU_BOOLEAN valid;
valid = Clk_GetTS_NTP(&ts_ntp_sec);
if (valid == DEF_OK) {
printf("Timestamp NTP = %u", ts_ntp_sec);
} else {
printf("Get TS NTP error\n\r");
} |