* - the first is an immediate update when receiving time from the sntp server,
* - the second is a smooth time update (if the time error is no more than 35 minutes,
* and an immediate update if the error is more than 35 minutes).
*
* To receive notification of time synchronization,
* you can use the callback function or get the synchronization status
* via the sntp_get_sync_status() function.
*
* To determine the time synchronization time on the device, you can use:
* 1) sntp_set_time_sync_notification_cb() function to set the callback function,
* which is convenient to use to receive notification of the update time.
* 2) sntp_get_sync_status() function for getting time synchronization status.
* After the time synchronization is completed, the status will be
* SNTP_SYNC_STATUS_COMPLETED, after, it will be reseted to SNTP_SYNC_STATUS_RESET
* to wait for the next sync cycle.
*/
/// SNTP time update mode
typedefenum{
SNTP_SYNC_MODE_IMMED,/*!< Update system time immediately when receiving a response from the SNTP server. */
SNTP_SYNC_MODE_SMOOTH,/*!< Smooth time updating. Time error is gradually reduced using adjtime function. If the difference between SNTP response time and system time is large (more than 35 minutes) then update immediately. */
}sntp_sync_mode_t;
/// SNTP sync status
typedefenum{
SNTP_SYNC_STATUS_RESET,// Reset status.
SNTP_SYNC_STATUS_COMPLETED,// Time is synchronized.
SNTP_SYNC_STATUS_IN_PROGRESS,// Smooth time sync in progress.
}sntp_sync_status_t;
/**
* @brief SNTP callback function for notifying about time sync event