From a247d8bfa556ce5f07d2960ba39cdb0f5e1fb990 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= <joakim.nohlgard@eistec.se>
Date: Sat, 30 Jun 2018 15:31:34 +0200
Subject: [PATCH] gnrc_netif_ieee802154: set Frame Pending bit sometimes

Set frame pending bit in IEEE 802.15.4 FCF when
GNRC_NETIF_HDR_FLAGS_MORE_DATA is set on the netif header on outbound
frames.
---
 sys/net/gnrc/netif/gnrc_netif_ieee802154.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/net/gnrc/netif/gnrc_netif_ieee802154.c b/sys/net/gnrc/netif/gnrc_netif_ieee802154.c
index cb9c629d6c..6c29d342bb 100644
--- a/sys/net/gnrc/netif/gnrc_netif_ieee802154.c
+++ b/sys/net/gnrc/netif/gnrc_netif_ieee802154.c
@@ -187,6 +187,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
         return -EBADMSG;
     }
     netif_hdr = pkt->data;
+    if (netif_hdr->flags & GNRC_NETIF_HDR_FLAGS_MORE_DATA) {
+        /* Set frame pending field */
+        flags |= IEEE802154_FCF_FRAME_PEND;
+    }
     /* prepare destination address */
     if (netif_hdr->flags & /* If any of these flags is set assume broadcast */
         (GNRC_NETIF_HDR_FLAGS_BROADCAST | GNRC_NETIF_HDR_FLAGS_MULTICAST)) {
-- 
GitLab