mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 03:37:46 +00:00
Set the Beacon Joining Permitted flag if unsecure ports are configured. (#370)
This commit is contained in:
@@ -381,6 +381,7 @@ void Mac::SendBeaconRequest(Frame &aFrame)
|
||||
|
||||
void Mac::SendBeacon(Frame &aFrame)
|
||||
{
|
||||
uint8_t numUnsecurePorts;
|
||||
uint16_t fcf;
|
||||
|
||||
// initialize MAC header
|
||||
@@ -389,6 +390,18 @@ void Mac::SendBeacon(Frame &aFrame)
|
||||
aFrame.SetSrcPanId(mPanId);
|
||||
aFrame.SetSrcAddr(mExtAddress);
|
||||
|
||||
// set the Joining Permitted flag
|
||||
mNetif.GetIp6Filter().GetUnsecurePorts(numUnsecurePorts);
|
||||
|
||||
if (numUnsecurePorts)
|
||||
{
|
||||
mBeacon.SetJoiningPermitted();
|
||||
}
|
||||
else
|
||||
{
|
||||
mBeacon.ClearJoiningPermitted();
|
||||
}
|
||||
|
||||
// write payload
|
||||
memcpy(aFrame.GetPayload(), &mBeacon, sizeof(mBeacon));
|
||||
aFrame.SetPayloadLength(sizeof(mBeacon));
|
||||
|
||||
Reference in New Issue
Block a user