47 #ifndef M2MB_SNTP_API_H 48 #define M2MB_SNTP_API_H 73 #define M2MB_SNTP_DEFAULT_SERVER "pool.ntp.org" 76 #define M2MB_SNTP_SERVER_NAME_SIZE 68 79 #define M2MB_SNTP_SERVER_MAX 2 82 #define M2MB_IP_ADDR_STR_LEN 48 85 #define M2MB_SNTP_SYNC_DONE 0x0010 enum M2MB_SNTP_SERVER_STATUS M2MB_SNTP_SERVER_STATUS_E
Server status enumeration.
M2MB_SNTP_SERVER_STATUS
Server status enumeration.
INT32 m2mb_sntp_init(M2MB_SNTPC_APP_CB_t user_cb, void *user_ctx, uint32_t poll_interval)
m2mb_sntp_init is called to initialize the SNTP user callback and continuous interval.
M2MB_SNTPC_RTC_STATUS_E
The enum indicates RTC SYCN status.
INT32 m2mb_sntp_deinit(VOID)
m2mb_sntp_deinit is called to de-initialize SNTP module.
#define M2MB_IP_ADDR_STR_LEN
struct M2MB_SNTP_SERVER_LIST M2MB_SNTP_SERVER_LIST_T
SNTP server list structure.
struct M2MB_SNTP_TM M2MB_SNTP_TM_T
Time broken down.
M2MB_SNTPC_EVENTS_ID_E
Events from SNTP module.
struct M2MB_SNTP_SERVER_ENTRY M2MB_SNTP_SERVER_ENTRY_T
SNTP server entry structure.
INT32 m2mb_sntp_svr_delete(M2MB_SNTP_SERVER_ID_E serverID)
m2mb_sntp_svr_delete is called to delete the SNTP server details.
INT32 m2mb_sntp_svr_add(M2MB_SNTP_SERVER_ID_E serverID, UINT8 *name)
m2mb_sntp_svr_add is called to add a SNTP server to get the time.
enum M2MB_SNTP_SERVER_ID M2MB_SNTP_SERVER_ID_E
Server ID enumeration.
INT32 m2mb_sntp_update(VOID)
m2mb_sntp_update is called to update the system time from SNTP server.
INT32 m2mb_sntp_get_server_list(M2MB_SNTP_SERVER_LIST_T *svr_List)
m2mb_sntp_get_server_list is called to get the SNTP server list.
UINT8 name[M2MB_SNTP_SERVER_NAME_SIZE]
M2MB_SNTP_SERVER_ID
Server ID enumeration.
M2MB_SNTP_SERVER_ENTRY_T server[M2MB_SNTP_SERVER_MAX]
#define M2MB_SNTP_SERVER_MAX
SNTP server list structure.
INT32 m2mb_sntp_is_started(VOID)
m2mb_sntp_is_started is called to check SNTP status.
INT32 m2mb_sntp_start(VOID)
m2mb_sntp_start is called to start SNTP.
void(* M2MB_SNTPC_APP_CB_t)(void *sntpc_ctx, uint32_t event, void *uData)
User callback to indicate SNTP event.
UINT8 addr[M2MB_IP_ADDR_STR_LEN]
SNTP server entry structure.
INT32 m2mb_sntp_get_time(M2MB_SNTP_TM_T *tm)
m2mb_sntp_get_time is called to get the current system time.
#define M2MB_SNTP_SERVER_NAME_SIZE