Functions#
This section provides a reference to the SNTP API functions.
Functions#
Start SNTP client.
Get time and date information from NTP.
Get NTP server information.
Stop SNTP client.
Function Documentation#
sl_sntp_client_start#
sl_status_t sl_sntp_client_start (sl_sntp_client_config_t * config, uint32_t timeout)
Start SNTP client.
[in] | config | Valid pointer to client configuration structure. This shall not be null. |
[in] | timeout | Timeout for starting SNTP client. This is blocking API for timeout > 0, else results are returned in sl_sntp_client_event_handler_t callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
Note
This API needs to be called before calling any other SNTP API
104
of file components/service/sntp/inc/sl_sntp.h
sl_sntp_client_get_time_date#
sl_status_t sl_sntp_client_get_time_date (uint8_t * data, uint16_t data_length, uint32_t timeout)
Get time and date information from NTP.
[in] | data | Valid pointer to data buffer. |
[in] | data_length | Data buffer length. |
[in] | timeout | Timeout for getting time and date. This is blocking API for timeout > 0, else results are returned in sl_sntp_client_event_handler_t callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
115
of file components/service/sntp/inc/sl_sntp.h
sl_sntp_client_get_server_info#
sl_status_t sl_sntp_client_get_server_info (uint8_t * data, uint16_t data_length, uint32_t timeout)
Get NTP server information.
[in] | data | Valid pointer to data buffer. |
[in] | data_length | Data buffer length. |
[in] | timeout | Timeout for getting server information. This is blocking API for timeout > 0, else results are returned in sl_sntp_client_event_handler_t callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
126
of file components/service/sntp/inc/sl_sntp.h
sl_sntp_client_stop#
sl_status_t sl_sntp_client_stop (uint32_t timeout)
Stop SNTP client.
[in] | timeout | Timeout for stop SNTP client. This is blocking API for timeout > 0, else results are returned in sl_sntp_client_event_handler_t callback |
Returns
sl_status_t. See https://docs.silabs.com/gecko-platform/4.1/common/api/group-status for details.
135
of file components/service/sntp/inc/sl_sntp.h