mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 07:10:08 +00:00
Update src address match logs to use the Mac::Address:ToString() (#1548)
This commit is contained in:
committed by
Jonathan Hui
parent
27ddb2d260
commit
a68bbfefa9
+12
-17
@@ -1680,13 +1680,11 @@ void Mac::EnableSrcMatch(bool aEnable)
|
||||
ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
char stringBuffer[Address::kAddressStringSize];
|
||||
|
||||
if (aAddr.mLength == 2)
|
||||
{
|
||||
error = otPlatRadioAddSrcMatchShortEntry(GetInstance(), aAddr.mShortAddress);
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding short address: 0x%04x -- %s (%d)", aAddr.mShortAddress,
|
||||
otThreadErrorToString(error), error);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1698,26 +1696,24 @@ ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
|
||||
}
|
||||
|
||||
error = otPlatRadioAddSrcMatchExtEntry(GetInstance(), buf);
|
||||
|
||||
otLogDebgMac(GetInstance(),
|
||||
"SrcAddrMatch - Adding extended address: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x -- %s (%d)",
|
||||
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], otThreadErrorToString(error),
|
||||
error);
|
||||
}
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding address: %s -- %s (%d)",
|
||||
aAddr.ToString(stringBuffer, sizeof(stringBuffer)), otThreadErrorToString(error), error);
|
||||
|
||||
(void)stringBuffer;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
char stringBuffer[Address::kAddressStringSize];
|
||||
|
||||
if (aAddr.mLength == 2)
|
||||
{
|
||||
error = otPlatRadioClearSrcMatchShortEntry(GetInstance(), aAddr.mShortAddress);
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing short address: 0x%04x -- %s (%d)", aAddr.mShortAddress,
|
||||
otThreadErrorToString(error), error);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1729,13 +1725,13 @@ ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
|
||||
}
|
||||
|
||||
error = otPlatRadioClearSrcMatchExtEntry(GetInstance(), buf);
|
||||
|
||||
otLogDebgMac(GetInstance(),
|
||||
"SrcAddrMatch - Clearing extended address: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x -- %s (%d)",
|
||||
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], otThreadErrorToString(error),
|
||||
error);
|
||||
}
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing address: %s -- %s (%d)",
|
||||
aAddr.ToString(stringBuffer, sizeof(stringBuffer)), otThreadErrorToString(error), error);
|
||||
|
||||
(void)stringBuffer;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1747,6 +1743,5 @@ void Mac::ClearSrcMatchEntries()
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Cleared all entries");
|
||||
}
|
||||
|
||||
|
||||
} // namespace Mac
|
||||
} // namespace Thread
|
||||
|
||||
Reference in New Issue
Block a user