From acd5b2123aaab232e7ec559c0c641f9f8ff604b7 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 1 Mar 2021 11:24:08 +0100 Subject: [PATCH] fix --- cube/User/Src/networkAbstractionLayer_lan.c | 46 +++++++++++---------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/cube/User/Src/networkAbstractionLayer_lan.c b/cube/User/Src/networkAbstractionLayer_lan.c index 802f339..5fb77ad 100644 --- a/cube/User/Src/networkAbstractionLayer_lan.c +++ b/cube/User/Src/networkAbstractionLayer_lan.c @@ -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 {