Files
fastbee/sdk/合宙/air780e/csdk/luatos-soc-2022/thirdparty/sntp/sntp.h
2023-03-04 03:44:56 +08:00

27 lines
570 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "commontypedef.h"
#include "common_api.h"
#define SNTP_RCV_TIMEOUT 15 //seconds
#define SNTP_RETRY_TIMES 3
#define SNTP_RESEND_REQUEST_DELAY 3000 //ms
#define SNTP_DEFAULT_PORT 123
typedef struct
{
uint8_t succ; //1成功0失败
uint32_t sec;
uint32_t us;
}sntp_result_t;
BOOL SntpInit(CHAR* serverAddr, UINT16 serverPort, BOOL autoSync, UINT8 cid, CBFuncEx_t callback, void *user_param);
void SntpTerminat(void);
//check sntp whether running,TRUE->running, FALSE->not run
BOOL SntpChkStatus(CHAR *serverAddr, UINT16 *serverPort, UINT8 *cid);