Embedded TCP/IP stack
4.7.0
|
fnet_return_t fnet_sntp_init | ( | fnet_sntp_params_t * | params | ) |
Initializes the SNTP client service and starts the time resolving.
params | Initialization parameters. |
This function initializes the SNTP client service and starts the time resolving. It allocates all needed resources and registers the SNTP service in the polling list.
After the initialization, the user application should call the main polling function fnet_service_poll() periodically to run the SNTP service routine in the background.
The resolved timestamp will be passed to the fnet_sntp_callback_resolved_t callback function, which is set in params
.
The SNTP service is released automatically as soon as the resolving is finished or a timeout is occurred. The timeout equals to FNET_CFG_SNTP_RETRANSMISSION_TIMEOUT * FNET_CFG_SNTP_RETRANSMISSION_MAX seconds.