[riot-notifications] [RIOT-OS/RIOT] net/gnrc/netif: Added CC1xxx adaption layer (#10638)

Martine Lenders notifications at github.com
Wed Jan 9 18:16:01 CET 2019


miri64 commented on this pull request.



> +    /* get the payload size and the dst address details */
+    size = gnrc_pkt_len(pkt->next);
+    DEBUG("[cc1xxx-gnrc] send: payload of packet is %i\n", (int)size);
+    netif_hdr = (gnrc_netif_hdr_t *)pkt->data;
+
+
+    l2hdr.src_addr = cc1xxx_dev->addr;
+    if (netif_hdr->flags & BCAST) {
+        l2hdr.dest_addr = 0x00;
+        DEBUG("[cc1xxx-gnrc] send: preparing to send broadcast\n");
+    }
+    else {
+        /* check that destination address is valid */
+        assert(netif_hdr->dst_l2addr_len > 0);
+        uint8_t *addr = gnrc_netif_hdr_get_dst_addr(netif_hdr);
+        l2hdr.dest_addr = addr[netif_hdr->dst_l2addr_len - 1];

I prefer to not check the exact length of the address however. At least I remember, that we once stated, that addresses could be whatever length in input and the driver just takes the most significant bytes.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10638#discussion_r246459976
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190109/15e7fb47/attachment.html>


More information about the notifications mailing list