Embedded TCP/IP stack: fnet_sntp_init

FNET

fnet_return_t fnet_sntp_init ( struct fnet_sntp_params params)

Initializes the SNTP client service and starts the time resolving.

Parameters
paramsInitialization parameters.
Returns
This function returns:
See also
fnet_sntp_params, fnet_sntp_callback_resolved_t, fnet_sntp_release()

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.


© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net