mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 22:57:46 +00:00
[announce-sender] feature to enable periodic tx of MLE Announce (#2693)
This commit adds a new feature/class namely `AnnounceSender` which enables periodic transmission of MLE Announce messages on all channels. The feature can be enabled using the config option `OPENTHREAD_CONFIG_ENABLE_ANNOUNCE_SENDER` (disabled by default). This commit also adds some new helper methods in `Mac::ChannelMask` to get number of channels in a given mask, and operator overloads to compare two masks.
This commit is contained in:
committed by
Jonathan Hui
parent
38a48b2b09
commit
7f901cf9c7
@@ -120,6 +120,8 @@ void VerifyChannelMaskContent(const Mac::ChannelMask &aMask, uint8_t *aChannels,
|
||||
{
|
||||
VerifyOrQuit(!aMask.IsSingleChannel(), "ChannelMask.IsSingleChannel() failed\n");
|
||||
}
|
||||
|
||||
VerifyOrQuit(aLength == aMask.GetNumberOfChannels(), "ChannelMask.GetNumberOfChannels() failed\n");
|
||||
}
|
||||
|
||||
void TestMacChannelMask(void)
|
||||
@@ -191,6 +193,17 @@ void TestMacChannelMask(void)
|
||||
VerifyChannelMaskContent(mask2, channles4, sizeof(channles4));
|
||||
|
||||
printf("channels4 = %s\n", mask2.ToString(stringBuffer, sizeof(stringBuffer)));
|
||||
|
||||
mask1.Clear();
|
||||
mask2.Clear();
|
||||
VerifyOrQuit(mask1 == mask2, "ChannelMask.operator== failed\n");
|
||||
|
||||
mask1.SetMask(OT_RADIO_SUPPORTED_CHANNELS);
|
||||
mask2.SetMask(OT_RADIO_SUPPORTED_CHANNELS);
|
||||
VerifyOrQuit(mask1 == mask2, "ChannelMask.operator== failed\n");
|
||||
|
||||
mask1.Clear();
|
||||
VerifyOrQuit(mask1 != mask2, "ChannelMask.operator== failed\n");
|
||||
}
|
||||
|
||||
} // namespace ot
|
||||
|
||||
Reference in New Issue
Block a user