mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 23:11:19 +01:00
Only read pan ID when address mode is not 0, when reading 802.15.4 header
This commit is contained in:
parent
fce3a2243e
commit
406872751a
@ -186,9 +186,11 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame,
|
||||
|
||||
index++;
|
||||
|
||||
frame->dest_pan_id = (((uint16_t)buf[index]) << 8) | buf[index + 1];
|
||||
|
||||
index += 2;
|
||||
if(frame->fcf.dest_addr_m != 0)
|
||||
{
|
||||
frame->dest_pan_id = (((uint16_t)buf[index]) << 8) | buf[index + 1];
|
||||
index += 2;
|
||||
}
|
||||
|
||||
switch (frame->fcf.dest_addr_m) {
|
||||
case (0): {
|
||||
@ -220,8 +222,11 @@ uint8_t ieee802154_frame_read(uint8_t *buf, ieee802154_frame_t *frame,
|
||||
}
|
||||
|
||||
if (!(frame->fcf.panid_comp == 1)) {
|
||||
frame->src_pan_id = (((uint16_t)buf[index]) << 8) | buf[index + 1];
|
||||
index += 2;
|
||||
if(frame->fcf.src_addr_m != 0)
|
||||
{
|
||||
frame->src_pan_id = (((uint16_t)buf[index]) << 8) | buf[index + 1];
|
||||
index += 2;
|
||||
}
|
||||
}
|
||||
|
||||
switch (frame->fcf.src_addr_m) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user