Functions#

This section provides a reference to the SNTP API functions.

Functions#

sl_status_t
sl_sntp_client_start(sl_sntp_client_config_t *config, uint32_t timeout)

Start SNTP client.

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.

sl_status_t
sl_sntp_client_get_server_info(uint8_t *data, uint16_t data_length, uint32_t timeout)

Get NTP server information.

sl_status_t
sl_sntp_client_stop(uint32_t timeout)

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.

Parameters
[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

Note

  • This API needs to be called before calling any other SNTP API


Definition at line 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.

Parameters
[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


Definition at line 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.

Parameters
[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


Definition at line 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.

Parameters
[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


Definition at line 135 of file components/service/sntp/inc/sl_sntp.h