esp_mqtt/ntp/ntp.h

33 wiersze
627 B
C

2017-07-12 20:04:02 +00:00
#ifndef __NTP_H__
#define __NTP_H__
#include <sys/time.h>
#define NTP_TIMEOUT_MS 5000
typedef struct {
uint8 options;
uint8 stratum;
uint8 poll;
uint8 precision;
uint32 root_delay;
uint32 root_disp;
uint32 ref_id;
uint8 ref_time[8];
uint8 orig_time[8];
uint8 recv_time[8];
uint8 trans_time[8];
} ntp_t;
void ntp_set_server(uint8_t *ntp_server);
2017-07-13 08:41:58 +00:00
bool ntp_sync_done();
2017-07-12 20:04:02 +00:00
void ntp_get_time();
void get_cur_time(struct timeval *tv);
2017-07-21 14:35:45 +00:00
void set_timezone(int16_t timezone);
uint8_t *get_timestr();
2017-08-24 19:48:58 +00:00
uint8_t *get_weekday();
2017-07-12 20:04:02 +00:00
2018-03-20 11:15:15 +00:00
void set_time_local(uint16_t h, uint16_t m, uint16_t s);
bool set_weekday_local(char *day);
2017-07-12 20:04:02 +00:00
#endif