[riot-notifications] [RIOT] fixed byte order in network stack (#259)

Christian Mehlis notifications at github.com
Fri Nov 1 23:05:00 CET 2013


>      /* Sequence Number - 802.15.4 - 2006 - 7.2.1.2 */
>      buf[index] = frame->seq_nr;
>      index++;
>  
>      /* Destination PAN Identifier - 802.15.4 - 2006 - 7.2.1.3 */
>      if (frame->fcf.dest_addr_m == 0x02 || frame->fcf.dest_addr_m == 0x03) {
> -        buf[index] = ((frame->dest_pan_id >> 8) & 0xff);
> -        buf[index + 1] = (frame->dest_pan_id & 0xff);
> +        buf[index + 1] = ((frame->dest_pan_id >> 8) & 0xff);
> +        buf[index] = (frame->dest_pan_id & 0xff);

I would prefer a memcpy with a htons - this code is hard to understand

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/259/files#r7383198
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20131101/cc5ba53f/attachment.html>


More information about the notifications mailing list