本文整理汇总了C++中Child::GetExtAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ Child::GetExtAddress方法的具体用法?C++ Child::GetExtAddress怎么用?C++ Child::GetExtAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Child
的用法示例。
在下文中一共展示了Child::GetExtAddress方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddAddress
otError SourceMatchController::AddAddress(const Child &aChild)
{
otError error = OT_ERROR_NONE;
if (aChild.IsIndirectSourceMatchShort())
{
error = otPlatRadioAddSrcMatchShortEntry(&GetInstance(), aChild.GetRloc16());
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding short addr: 0x%04x -- %s (%d)", aChild.GetRloc16(),
otThreadErrorToString(error), error);
}
else
{
otExtAddress addr;
for (uint8_t i = 0; i < sizeof(addr); i++)
{
addr.m8[i] = aChild.GetExtAddress().m8[sizeof(addr) - 1 - i];
}
error = otPlatRadioAddSrcMatchExtEntry(&GetInstance(), &addr);
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding addr: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x -- %s (%d)",
addr.m8[7], addr.m8[6], addr.m8[5], addr.m8[4], addr.m8[3], addr.m8[2], addr.m8[1], addr.m8[0],
otThreadErrorToString(error), error);
}
return error;
}
示例2: ClearEntry
void SourceMatchController::ClearEntry(Child &aChild)
{
otError error = OT_ERROR_NONE;
if (aChild.IsIndirectSourceMatchPending())
{
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing pending flag for 0x%04x", aChild.GetRloc16());
aChild.SetIndirectSourceMatchPending(false);
ExitNow();
}
if (aChild.IsIndirectSourceMatchShort())
{
error = otPlatRadioClearSrcMatchShortEntry(&GetInstance(), aChild.GetRloc16());
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing short address: 0x%04x -- %s (%d)", aChild.GetRloc16(),
otThreadErrorToString(error), error);
}
else
{
otExtAddress addr;
for (uint8_t i = 0; i < sizeof(addr); i++)
{
addr.m8[i] = aChild.GetExtAddress().m8[sizeof(aChild.GetExtAddress()) - 1 - i];
}
error = otPlatRadioClearSrcMatchExtEntry(&GetInstance(), &addr);
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing addr: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x -- %s (%d)",
addr.m8[7], addr.m8[6], addr.m8[5], addr.m8[4], addr.m8[3], addr.m8[2], addr.m8[1], addr.m8[0],
otThreadErrorToString(error), error);
}
SuccessOrExit(error);
if (!IsEnabled())
{
SuccessOrExit(AddPendingEntries());
Enable(true);
}
exit:
return;
}
示例3: ChildMatches
// Checks whether a `Child` matches the `TestChild` struct.
static bool ChildMatches(const Child &aChild, const TestChild &aTestChild)
{
return (aChild.GetState() == aTestChild.mState) && (aChild.GetRloc16() == aTestChild.mRloc16) &&
(aChild.GetExtAddress() == static_cast<const Mac::ExtAddress &>(aTestChild.mExtAddress));
}