Here are listed all the functions that implement the System Time APIs.
Functions | |
sint8 | m2m_wifi_configure_sntp (uint8 *pu8NTPServerName, uint8 u8NTPServerNameLength, tenuSNTPUseDHCP useDHCP) |
Configures what NTP server the SNTP client should use. More... | |
sint8 | m2m_wifi_enable_sntp (uint8 bEnable) |
Synchronous function to enable/disable the native Simple Network Time Protocol(SNTP) client in the WINC15x0 firmware. More... | |
sint8 | m2m_wifi_get_system_time (void) |
Asynchronous API to obtain the system time in use by the WINC IC. More... | |
sint8 | m2m_wifi_set_system_time (uint32 u32UTCSeconds) |
Function for setting the system time within the WINC IC. More... | |
NMI_API sint8 m2m_wifi_configure_sntp | ( | uint8 * | pu8NTPServerName, |
uint8 | u8NTPServerNameLength, | ||
tenuSNTPUseDHCP | useDHCP | ||
) |
Configures what NTP server the SNTP client should use.
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org). |
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH |
[in] | useDHCP | Should the NTP server provided by the DHCP server be used. |
Configures what NTP server the SNTP client should use. Only 1 server name can be provided, if the configured server name begins with an asterisk then it will be treated as a server pool. The SNTP client can also use the NTP server provided by the DHCP server through option 42. By default the NTP server provided by DHCP will be tried first, then the built-in default NTP server (time.nist.gov) will be used.
[in] | pu8NTPServerName | Buffer holding the NTP server name. If the first character is an asterisk (*) then it will be treated as a server pool, where the asterisk will be replaced with an incrementing value from 0 to 3 each time a server fails (example: *.pool.ntp.org). |
[in] | u8NTPServerNameLength | Length of the NTP server name. Should not exceed the maximum NTP server name length of M2M_NTP_MAX_SERVER_NAME_LENGTH. |
[in] | useDHCP | Explicity tell the WINC if it should use the NTP server provided by the DHCP server or not. |
References tstrM2MSNTPConfig::acNTPServer, tstrM2MSNTPConfig::enuUseDHCP, hif_send(), M2M_ERR_FAIL, m2m_memcpy(), M2M_NTP_MAX_SERVER_NAME_LENGTH, M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_CONFIG_SNTP, and NULL.
Referenced by main().
Synchronous function to enable/disable the native Simple Network Time Protocol(SNTP) client in the WINC15x0 firmware.
The SNTP is enabled by default at start-up.The SNTP client at firmware is used to synchronize the system clock to the UTC time from the well known time servers (e.g. "time-c.nist.gov"). The SNTP client uses a default update cycle of 1 day. The UTC is important for checking the expiration date of X509 certificates used while establishing TLS (Transport Layer Security) connections. It is highly recommended to use it if there is no other means to get the UTC time. If there is a RTC on the host MCU, the SNTP could be disabled and the host should set the system time to the firmware using the @ref m2m_wifi_set_system_time function.
[in] | bEnable | Enables or disables the SNTP service '0' :disable SNTP '1' :enable SNTP |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_DISABLE_SNTP_CLIENT, M2M_WIFI_REQ_ENABLE_SNTP_CLIENT, and NULL.
Asynchronous API to obtain the system time in use by the WINC IC.
Asynchronous function used to retrieve the system time through the use of the response @ref M2M_WIFI_RESP_GET_SYS_TIME. Response time retrieved is parsed into the members defined in the structure @ref tstrSystemTime.
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_GET_SYS_TIME, and NULL.
Function for setting the system time within the WINC IC.
Synchronous function for setting the system time in time/date format (@ref uint32). The @ref tstrSystemTime structure can be used as a reference to the time values that should be set and pass its value as @ref uint32.
[in] | u32UTCSeconds | Seconds elapsed since January 1, 1900 (NTP Timestamp). |
References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_SET_SYS_TIME, and NULL.