From a95be634d1cd4c1f6cbcc524ca19f05778255946 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Mon, 17 Jul 2023 15:26:56 +0200 Subject: [PATCH] pkg/opendsme: fix compilation with LLVM --- pkg/opendsme/contrib/DSMEPlatform.cpp | 14 +++++++------- pkg/opendsme/contrib/gnrc_netif_opendsme.cpp | 2 ++ pkg/opendsme/include/opendsme/DSMEMessage.h | 6 +++--- pkg/opendsme/include/opendsme/DSMEPlatform.h | 6 +++--- ...sageDispatcher-drop-unused-members-in-M.patch | Bin 0 -> 1048 bytes 5 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 pkg/opendsme/patches/0001-dsmeLayer-messageDispatcher-drop-unused-members-in-M.patch diff --git a/pkg/opendsme/contrib/DSMEPlatform.cpp b/pkg/opendsme/contrib/DSMEPlatform.cpp index a70f613d7c..db59256def 100644 --- a/pkg/opendsme/contrib/DSMEPlatform.cpp +++ b/pkg/opendsme/contrib/DSMEPlatform.cpp @@ -51,25 +51,25 @@ static void _handle_rx_offload(event_t *ev); static void _start_of_cfp_handler(event_t *ev); /* Event used for ACK Timeout */ -static event_t acktimer_ev = {0, _acktimer_ev_handler}; +static event_t acktimer_ev = {{}, _acktimer_ev_handler}; /* Event used for CCA Done */ -static event_t cca_ev = {0, _cca_ev_handler}; +static event_t cca_ev = {{}, _cca_ev_handler}; /* Event used for timer events */ -static event_t timer_event = {0, _timer_ev_handler}; +static event_t timer_event = {{}, _timer_ev_handler}; /* Event used for TX Done */ -static event_t tx_done_event = {0, _tx_done_handler}; +static event_t tx_done_event = {{}, _tx_done_handler}; /* Event used for RX Done */ -static event_t rx_done_event = {0, _rx_done_handler}; +static event_t rx_done_event = {{}, _rx_done_handler}; /* Event used for offloading the receive procedure */ -static event_t rx_offload_ev = {0, _handle_rx_offload}; +static event_t rx_offload_ev = {{}, _handle_rx_offload}; /* Event used for offloading the start of a CFP */ -static event_t start_of_cfp_ev = {0, _start_of_cfp_handler}; +static event_t start_of_cfp_ev = {{}, _start_of_cfp_handler}; void _handle_rx_offload(event_t *ev) { diff --git a/pkg/opendsme/contrib/gnrc_netif_opendsme.cpp b/pkg/opendsme/contrib/gnrc_netif_opendsme.cpp index 373ee933ca..b981aca117 100644 --- a/pkg/opendsme/contrib/gnrc_netif_opendsme.cpp +++ b/pkg/opendsme/contrib/gnrc_netif_opendsme.cpp @@ -117,6 +117,8 @@ static int _set(gnrc_netif_t *netif, const gnrc_netapi_opt_t *opt) case NETOPT_LINK: m_dsme.initialize(_pan_coord); m_dsme.start(); + assert(*(netopt_enable_t *)opt->data == NETOPT_ENABLE); + res = sizeof(netopt_enable_t); break; case NETOPT_PAN_COORD: if (*((bool *)opt->data) == true) { diff --git a/pkg/opendsme/include/opendsme/DSMEMessage.h b/pkg/opendsme/include/opendsme/DSMEMessage.h index 7378a951ed..0b202a0254 100644 --- a/pkg/opendsme/include/opendsme/DSMEMessage.h +++ b/pkg/opendsme/include/opendsme/DSMEMessage.h @@ -69,7 +69,7 @@ public: /** * @brief check whether the message has payload */ - bool hasPayload() + bool hasPayload() override { return this->pkt != NULL && this->pkt->size > 0; } @@ -93,7 +93,7 @@ public: /** * @brief get the total number of symbols in current frame */ - uint16_t getTotalSymbols() + uint16_t getTotalSymbols() override { DSME_ASSERT(pkt); /* Hardcoded to O-QPSK */ @@ -116,7 +116,7 @@ public: /** * @brief get IEEE 802.15.4 header */ - IEEE802154eMACHeader& getHeader() + IEEE802154eMACHeader& getHeader() override { return macHdr; } diff --git a/pkg/opendsme/include/opendsme/DSMEPlatform.h b/pkg/opendsme/include/opendsme/DSMEPlatform.h index 9c163db699..fad23b2aca 100644 --- a/pkg/opendsme/include/opendsme/DSMEPlatform.h +++ b/pkg/opendsme/include/opendsme/DSMEPlatform.h @@ -308,7 +308,7 @@ public: /** * @brief callback to offload the start of CFP */ - void scheduleStartOfCFP(); + void scheduleStartOfCFP() override; /** * @brief Get the minimum LQI. Beacons with LQI lower than this will not be @@ -321,12 +321,12 @@ public: /** * @brief turn on transceiver */ - void turnTransceiverOn(); + void turnTransceiverOn() override; /** * @brief turn off transceiver */ - void turnTransceiverOff(); + void turnTransceiverOff() override; /** * @brief get extended address diff --git a/pkg/opendsme/patches/0001-dsmeLayer-messageDispatcher-drop-unused-members-in-M.patch b/pkg/opendsme/patches/0001-dsmeLayer-messageDispatcher-drop-unused-members-in-M.patch new file mode 100644 index 0000000000000000000000000000000000000000..79c576ce55d960fc6fc57a3ea6ddf3cda4abb0bf GIT binary patch literal 1048 zcmbVKTW`}a6n^)wIFH-fq`qV;%>cEmbO=#Y*6s=M;KZk`X%a`a14V-Wj+4D~quNv~ zOP0=e@$u&~v!;YsLQ<8ngpNjvi_tKl?yJ}h@s#xHx(?g1~vpr({2N& zl#yAmNntLnmKD5fT)uT0f8q||b=ei;?4UTVjq_;Y3jJF$l^%oCRQ=ZWV^ai2E`VL8 zT%?y2dNkZXmQD5@bDzT3#bkB!;TtGd;wSkF?Vv>G69in&pNxnNoA8GHNY9FEZ z-7s|i56(x>&fyqZ*Ju|q-=TNYFj+OKSyL2W8f@?d`pnpy$>L?w?P~cz>K>dKQ-H3Nv4|6Fh}An+%+h5-S>