#include "os_type.h"
#include "lwip/ip_addr.h"
Go to the source code of this file.
◆ sntp_servermode_dhcp
#define sntp_servermode_dhcp |
( |
|
x | ) |
|
◆ sntp_get_current_timestamp()
uint32 sntp_get_current_timestamp |
( |
| ) |
|
get the seconds since Jan 01, 1970, 00:00 (GMT + 8)
◆ sntp_get_real_time()
char* sntp_get_real_time |
( |
long |
t | ) |
|
get real time (GTM + 8 time zone)
◆ sntp_get_timezone()
sint8 sntp_get_timezone |
( |
void |
| ) |
|
SNTP get time_zone default GMT + 8
◆ sntp_getserver()
ip_addr_t sntp_getserver |
( |
unsigned char |
idx | ) |
|
Obtain one of the currently configured by IP address (or DHCP) NTP servers
- Parameters
-
numdns | the index of the NTP server |
- Returns
- IP address of the indexed NTP server or "ip_addr_any" if the NTP server has not been configured by address (or at all).
◆ sntp_getservername()
char* sntp_getservername |
( |
unsigned char |
idx | ) |
|
Obtain one of the currently configured by name NTP servers.
- Parameters
-
numdns | the index of the NTP server |
- Returns
- IP address of the indexed NTP server or NULL if the NTP server has not been configured by name (or at all)
◆ sntp_init()
Initialize this module. Send out request instantly or after SNTP_STARTUP_DELAY(_FUNC).
◆ sntp_set_timezone()
bool sntp_set_timezone |
( |
sint8 |
timezone | ) |
|
SNTP set time_zone (default GMT + 8)
◆ sntp_setserver()
void sntp_setserver |
( |
unsigned char |
idx, |
|
|
ip_addr_t * |
addr |
|
) |
| |
Initialize one of the NTP servers by IP address
- Parameters
-
numdns | the index of the NTP server to set must be < SNTP_MAX_SERVERS |
dnsserver | IP address of the NTP server to set |
◆ sntp_setservername()
void sntp_setservername |
( |
unsigned char |
idx, |
|
|
char * |
server |
|
) |
| |
Initialize one of the NTP servers by name
- Parameters
-
numdns | the index of the NTP server to set must be < SNTP_MAX_SERVERS,now sdk support SNTP_MAX_SERVERS = 3 |
dnsserver | DNS name of the NTP server to set, to be resolved at contact time |
◆ sntp_stop()