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) |
Asynchronous API to enable or disable the native Simple Network Time Protocol(SNTP) client running on the WINC. More... | |
sint8 | m2m_wifi_get_system_time (void) |
Asynchronous API to obtain the system time in use by the WINC. More... | |
sint8 | m2m_wifi_set_system_time (uint32 u32UTCSeconds) |
Asynchronous function for setting the system time within the WINC. 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.
Asynchronous API to enable or disable the native Simple Network Time Protocol(SNTP) client running on the WINC.
The SNTP client is enabled by default during chip initialization. This function can be used to disable or subsequently re-enable the service. The service is capable of synchronizing the WINC system clock to the UTC time from a well-known (and trusted) time server, for example "time.nist.gov". By default the SNTP client will update the system time once every 24 hours. The ability to track the time accurately is important for various applications such as checking expiry of X509 certificates during TLS (Transport Layer Security) session establishment. It is highly recommended to leave SNTP enabled if there is no alternative source of timing information. For systems including an RTC device, SNTP may not be needed and the WINC's time may be set 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.
This function will request the WINC to report its current system time to the application. The information will arrive at the application via the @ref tpfAppWifiCb and event @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.
Asynchronous function for setting the system time within the WINC.
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.