mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
[mac-frame] update InitMacHeader() (#8660)
This commit updates how we prepare the MAC headers: - New `enum`s are defined in `Mac::Frame` to specify the frame `Type`, `Version`, `SecurityLevel`, etc. - `InitMacHeader()` will itself determine the Frame Control Field from the given address info. - It now uses `FrameBuilder` to prepare the headers. - New helper `MeshForwarder::PrepareMacHeaders()` is added which takes care of adding MAC (address, security header) along with any IE headers. - These changes ensure that PAN ID Compression bit is properly set on MAC frames when using 2015 version (ensure that PAN IDs are not omitted when both addresses use Extended format).
This commit is contained in:
@@ -68,17 +68,17 @@ exit:
|
||||
|
||||
bool otMacFrameIsAck(const otRadioFrame *aFrame)
|
||||
{
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kFcfFrameAck;
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kTypeAck;
|
||||
}
|
||||
|
||||
bool otMacFrameIsData(const otRadioFrame *aFrame)
|
||||
{
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kFcfFrameData;
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kTypeData;
|
||||
}
|
||||
|
||||
bool otMacFrameIsCommand(const otRadioFrame *aFrame)
|
||||
{
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kFcfFrameMacCmd;
|
||||
return static_cast<const Mac::Frame *>(aFrame)->GetType() == Mac::Frame::kTypeMacCmd;
|
||||
}
|
||||
|
||||
bool otMacFrameIsDataRequest(const otRadioFrame *aFrame)
|
||||
|
||||
Reference in New Issue
Block a user