MeterLogger
Macros | Functions
sntp.h File Reference
#include "lwip/opt.h"
#include "lwip/ip_addr.h"
Include dependency graph for sntp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SNTP_MAX_SERVERS   3
 
#define SNTP_GET_SERVERS_FROM_DHCP   0
 
#define SNTP_SERVER_DNS   1
 
#define sntp_servermode_dhcp(x)
 

Functions

uint32 sntp_get_current_timestamp ()
 
char * sntp_get_real_time (long t)
 
void sntp_init (void)
 
void sntp_stop (void)
 
sint8 sntp_get_timezone (void)
 
bool sntp_set_timezone (sint8 timezone)
 
void sntp_setserver (u8_t idx, ip_addr_t *addr)
 
ip_addr_t sntp_getserver (u8_t idx)
 
void sntp_setservername (u8_t idx, char *server)
 
char * sntp_getservername (u8_t idx)
 

Macro Definition Documentation

◆ SNTP_GET_SERVERS_FROM_DHCP

#define SNTP_GET_SERVERS_FROM_DHCP   0

Set this to 1 to implement the callback function called by dhcp when NTP servers are received.

Definition at line 19 of file sntp.h.

◆ SNTP_MAX_SERVERS

#define SNTP_MAX_SERVERS   3

The maximum number of SNTP servers that can be set

Definition at line 13 of file sntp.h.

◆ SNTP_SERVER_DNS

#define SNTP_SERVER_DNS   1

Definition at line 24 of file sntp.h.

◆ sntp_servermode_dhcp

#define sntp_servermode_dhcp (   x)

Definition at line 49 of file sntp.h.

Function Documentation

◆ sntp_get_current_timestamp()

uint32 sntp_get_current_timestamp ( )

One server address/name can be defined as default if SNTP_SERVER_DNS == 1: #define SNTP_SERVER_ADDRESS "pool.ntp.org"

Referenced by get_unix_time(), get_uptime(), and sntp_check_timer_func().

Here is the caller graph for this function:

◆ sntp_get_real_time()

char* sntp_get_real_time ( long  t)

◆ sntp_get_timezone()

sint8 sntp_get_timezone ( void  )

◆ sntp_getserver()

ip_addr_t sntp_getserver ( u8_t  idx)

◆ sntp_getservername()

char* sntp_getservername ( u8_t  idx)

◆ sntp_init()

void sntp_init ( void  )

Referenced by init_unix_time().

Here is the caller graph for this function:

◆ sntp_set_timezone()

bool sntp_set_timezone ( sint8  timezone)

Referenced by init_unix_time().

Here is the caller graph for this function:

◆ sntp_setserver()

void sntp_setserver ( u8_t  idx,
ip_addr_t addr 
)

◆ sntp_setservername()

void sntp_setservername ( u8_t  idx,
char *  server 
)

Referenced by init_unix_time().

Here is the caller graph for this function:

◆ sntp_stop()

void sntp_stop ( void  )