mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 22:57:47 +00:00
[mesh-forwarder] calculate PAN ID compression according to 802.15.4-2015 (#6739)
This commit is contained in:
@@ -666,9 +666,32 @@ start:
|
||||
break;
|
||||
}
|
||||
|
||||
if (dstpan == Get<Mac::Mac>().GetPanId())
|
||||
// Handle special case in 15.4-2015:
|
||||
// Dest Address: Extended
|
||||
// Source Address: Extended
|
||||
// Dest PanId: Present
|
||||
// Src Panid: Not Present
|
||||
// Pan ID Compression: 0
|
||||
if (dstpan == Get<Mac::Mac>().GetPanId() &&
|
||||
((fcf & Mac::Frame::kFcfFrameVersionMask) == Mac::Frame::kFcfFrameVersion2006 ||
|
||||
(fcf & Mac::Frame::kFcfDstAddrMask) != Mac::Frame::kFcfDstAddrExt ||
|
||||
(fcf & Mac::Frame::kFcfSrcAddrMask) != Mac::Frame::kFcfSrcAddrExt))
|
||||
{
|
||||
fcf |= Mac::Frame::kFcfPanidCompression;
|
||||
#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
|
||||
// Handle a special case in IEEE 802.15.4-2015, when Pan ID Compression is 0, but Src Pan ID is not present:
|
||||
// Dest Address: Extended
|
||||
// Src Address: Extended
|
||||
// Dest Pan ID: Present
|
||||
// Src Pan ID: Not Present
|
||||
// Pan ID Compression: 0
|
||||
|
||||
if ((fcf & Mac::Frame::kFcfFrameVersionMask) != Mac::Frame::kFcfFrameVersion2015 ||
|
||||
(fcf & Mac::Frame::kFcfDstAddrMask) != Mac::Frame::kFcfDstAddrExt ||
|
||||
(fcf & Mac::Frame::kFcfSrcAddrMask) != Mac::Frame::kFcfSrcAddrExt)
|
||||
#endif
|
||||
{
|
||||
fcf |= Mac::Frame::kFcfPanidCompression;
|
||||
}
|
||||
}
|
||||
|
||||
aFrame.InitMacHeader(fcf, secCtl);
|
||||
|
||||
Reference in New Issue
Block a user