This commit is contained in:
2021-03-01 11:24:08 +01:00
parent 3b3d5ee6a6
commit acd5b2123a

View File

@ -24,29 +24,31 @@ extern const uint8_t SNTP_SOCK;
const uint8_t SEND_LI_VN_MODE = 0xe3; // LI: unknown (3), VN: 4, Mode: Client (3)
typedef struct s_ntpStruct {
uint8_t li_vn_mode;
uint8_t stratum;
uint8_t poll;
uint8_t precision;
uint32_t rootdelay;
uint32_t rootdisp;
uint32_t refid;
//uint64_t reftime;
uint32_t reftime_h;
uint32_t reftime_l;
//uint64_t org;
uint32_t org_h;
uint32_t org_l;
//uint64_t rec;
uint32_t rec_h;
uint32_t rec_l;
//uint64_t xmt;
uint32_t xmt_h;
uint32_t xmt_l;
} t_ntpStruct;
typedef union __attribute__((__packed__)) {
struct s {
uint8_t li_vn_mode;
uint8_t stratum;
uint8_t poll;
uint8_t precision;
uint32_t rootdelay;
uint32_t rootdisp;
uint32_t refid;
//uint64_t reftime;
uint32_t reftime_h;
uint32_t reftime_l;
//uint64_t org;
uint32_t org_h;
uint32_t org_l;
//uint64_t rec;
uint32_t rec_h;
uint32_t rec_l;
//uint64_t xmt;
uint32_t xmt_h;
uint32_t xmt_l;
};
uint8_t b[sizeof(struct s)];
t_ntpStruct s;
uint8_t b[sizeof(t_ntpStruct)];
} ntpMsg_t;
typedef struct {