From fd955ba8f1a8097e8c5ca35e01c2423c90c69d2a Mon Sep 17 00:00:00 2001 From: Christian Hopfner Date: Thu, 12 Nov 2020 08:36:57 +0100 Subject: [PATCH 1/2] FW-887 fix compile issues and update openmote-b, openmote_cc2538 oos_openwsn project --- .gitignore | 5 + bsp/boards/python/openwsnmodule_obj.h | 2 + openstack/03a-IPHC/frag.h | 6 +- openstack/03a-IPHC/iphc.c | 5 +- openstack/04-TRAN/sock.c | 58 + openstack/04-TRAN/sock.h | 5 - openweb/opencoap/oscore.c | 8 +- .../03oos_openwsn/03oos_openwsn.ewp | 234 +- .../03oos_openwsn/03oos_openwsn.ewd | 5467 +++++++++-------- .../03oos_openwsn/03oos_openwsn.ewp | 5458 ++++++++-------- 10 files changed, 5926 insertions(+), 5322 deletions(-) diff --git a/.gitignore b/.gitignore index 7b0464eeff..1c15b417d2 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,8 @@ settings /projects/telosb/01bsp_uart/path.txt /projects/telosb/03oos_macpong/path.txt /projects/telosb/02drv_opentimers/path.txt + +Exe +Obj +List +*.ewt \ No newline at end of file diff --git a/bsp/boards/python/openwsnmodule_obj.h b/bsp/boards/python/openwsnmodule_obj.h index 295e351fd2..40318bb6c6 100644 --- a/bsp/boards/python/openwsnmodule_obj.h +++ b/bsp/boards/python/openwsnmodule_obj.h @@ -206,7 +206,9 @@ struct OpenMote { icmpv6rpl_vars_t icmpv6rpl_vars; // l3 monitor_expiration_vars_t monitor_expiration_vars; +#if OPENWSN_6LO_FRAGMENTATION_C frag_vars_t frag_vars; +#endif // l2b sixtop_vars_t sixtop_vars; neighbors_vars_t neighbors_vars; diff --git a/openstack/03a-IPHC/frag.h b/openstack/03a-IPHC/frag.h index b520d2c064..fd438fc884 100644 --- a/openstack/03a-IPHC/frag.h +++ b/openstack/03a-IPHC/frag.h @@ -17,6 +17,8 @@ #include "config.h" +#if OPENWSN_6LO_FRAGMENTATION_C + #include "opendefs.h" #include "openqueue.h" #include "opentimers.h" @@ -102,7 +104,7 @@ typedef struct { -//=========================== variables ======================================= +//=========================== variables ======================================= //=========================== prototypes ====================================== @@ -114,4 +116,6 @@ void frag_receive(OpenQueueEntry_t *msg); owerror_t frag_fragment6LoPacket(OpenQueueEntry_t *msg); +#endif /* OPENWSN_6LO_FRAGMENTATION_C */ + #endif /* OPENWSN_FRAG_H */ diff --git a/openstack/03a-IPHC/iphc.c b/openstack/03a-IPHC/iphc.c index ca69e00f67..775f44950b 100644 --- a/openstack/03a-IPHC/iphc.c +++ b/openstack/03a-IPHC/iphc.c @@ -10,6 +10,7 @@ #include "neighbors.h" #include "openbridge.h" #include "icmpv6rpl.h" +#include "openqueue.h" //=========================== variables ======================================= @@ -145,7 +146,7 @@ owerror_t iphc_sendFromForwarding( return E_FAIL; } *((uint8_t * )(msg->payload)) = IPECAP_6LOTH_TYPE; - // length + // length if (packetfunctions_reserveHeader(&msg, sizeof(uint8_t)) == E_FAIL) { return E_FAIL; } @@ -1221,7 +1222,7 @@ uint8_t iphc_retrieveIPv6HopByHopHeader(OpenQueueEntry_t *msg, rpl_option_ht *rp \param[in,out] msg The message to retrieve the header from. \param[in] deadline_msg_ptr Pointer to the Deadline header. -\param[out] deadline_option Pointer to the structure to hold the retrieved Deadline option +\param[out] deadline_option Pointer to the structure to hold the retrieved Deadline option */ void iphc_retrieveIPv6DeadlineHeader( OpenQueueEntry_t *msg, diff --git a/openstack/04-TRAN/sock.c b/openstack/04-TRAN/sock.c index 689a4cb220..28bdbe827e 100644 --- a/openstack/04-TRAN/sock.c +++ b/openstack/04-TRAN/sock.c @@ -18,6 +18,64 @@ sock_udp_t* udp_socket_list; +#if (__ICCARM__) + // IAR's errno.h apparently doesn't define EOVERFLOW. + #ifndef EOVERFLOW + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define EOVERFLOW 1 + #endif + + // IAR's errno.h apparently doesn't define EINVAL. + #ifndef EINVAL + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define EINVAL 1 + #endif + + // IAR's errno.h apparently doesn't define ENOMEM. + #ifndef ENOMEM + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define ENOMEM 1 + #endif + + // IAR's errno.h apparently doesn't define EAFNOSUPPORT. + #ifndef EAFNOSUPPORT + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define EAFNOSUPPORT 1 + #endif + + // IAR's errno.h apparently doesn't define EADDRINUSE. + #ifndef EADDRINUSE + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define EADDRINUSE 1 + #endif + + // IAR's errno.h apparently doesn't define ENOTCONN. + #ifndef ENOTCONN + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define ENOTCONN 1 + #endif + + // IAR's errno.h apparently doesn't define ENOBUFS. + #ifndef ENOBUFS + // There is no real good choice for what to set + // errno to in this case, so we just pick the + // value '1' somewhat arbitrarily. + #define ENOBUFS 1 + #endif +#endif //(__ICCARM__) + // =========================== variables ======================================= // =========================== prototypes ====================================== diff --git a/openstack/04-TRAN/sock.h b/openstack/04-TRAN/sock.h index 8eb6a79d79..9a131d20a5 100644 --- a/openstack/04-TRAN/sock.h +++ b/openstack/04-TRAN/sock.h @@ -22,11 +22,6 @@ struct _sock_tl_ep { */ typedef struct _sock_tl_ep sock_udp_ep_t; -/** - * @brief Type for a UDP sock object - */ -typedef struct sock_udp sock_udp_t; - /** * @brief Initialize the internal UDP socket structures */ diff --git a/openweb/opencoap/oscore.c b/openweb/opencoap/oscore.c index bfc17133d5..abd5d8188a 100644 --- a/openweb/opencoap/oscore.c +++ b/openweb/opencoap/oscore.c @@ -11,7 +11,7 @@ #define EAAD_MAX_LEN 9 + OSCOAP_MAX_ID_LEN // assumes no Class I options #define AAD_MAX_LEN 12 + EAAD_MAX_LEN -#define INFO_MAX_LEN 2 * OSCOAP_MAX_ID_LEN + 2 + 1 + 4 + 1 + 3 +#define INFO_MAX_LEN 2 * OSCOAP_MAX_ID_LEN + 2 + 1 + 4 + 1 + 3 //=========================== variables ======================================= @@ -420,7 +420,7 @@ owerror_t oscore_parse_compressed_COSE(uint8_t *buffer, uint8_t **kid, uint8_t *kidLen) { - uint8_t tmp[0]; + uint8_t tmp; uint8_t *ptr; uint8_t index; uint8_t n; @@ -429,8 +429,8 @@ owerror_t oscore_parse_compressed_COSE(uint8_t *buffer, uint8_t reserved; if (bufferLen == 0) { - tmp[0] = 0x00; - ptr = tmp; + tmp = 0x00; + ptr = &tmp; bufferLen = 1; } else { ptr = buffer; diff --git a/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp index cf4b26633a..74851c5323 100644 --- a/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp +++ b/projects/openmote-b/03oos_openwsn/03oos_openwsn.ewp @@ -207,7 +207,7 @@ 1