From a7a97e92c3641c232f0aa919bd5e1cbdb17cbddd Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 5 Nov 2013 17:46:16 -0800 Subject: [PATCH] fixed byte order in reception of IEEE802.15.4 frames according to the fixed sending in f6c37b0b4fab35ab50aa9095f1c584fb74f92d0a --- sys/net/ieee802154/ieee802154_frame.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/net/ieee802154/ieee802154_frame.c b/sys/net/ieee802154/ieee802154_frame.c index 5e4b3500d4..125fedaac3 100644 --- a/sys/net/ieee802154/ieee802154_frame.c +++ b/sys/net/ieee802154/ieee802154_frame.c @@ -148,12 +148,6 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, uint8_t index = 0; uint8_t hdrlen; - frame->fcf.dest_addr_m = (buf[index] >> 2) & 0x03; - frame->fcf.frame_ver = (buf[index] >> 4) & 0x03; - frame->fcf.src_addr_m = (buf[index] >> 6) & 0x03; - - index++; - frame->fcf.frame_type = (buf[index]) & 0x07; frame->fcf.sec_enb = (buf[index] >> 3) & 0x01; frame->fcf.frame_pend = (buf[index] >> 4) & 0x01; @@ -162,6 +156,12 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame, index++; + frame->fcf.dest_addr_m = (buf[index] >> 2) & 0x03; + frame->fcf.frame_ver = (buf[index] >> 4) & 0x03; + frame->fcf.src_addr_m = (buf[index] >> 6) & 0x03; + + index++; + frame->seq_nr = buf[index]; index++;