Update source address matching logs (#1514)

This commit updates the source address matching feature's debug logs.
It mainly adds a prefix of "SrcAddrMatch" to the log string.
This commit is contained in:
Abtin Keshavarzian
2017-03-24 17:52:35 -07:00
committed by Jonathan Hui
parent 227d2a091b
commit 62678c2d51
2 changed files with 19 additions and 9 deletions
+19 -8
View File
@@ -1674,7 +1674,7 @@ otMacCounters &Mac::GetCounters(void)
void Mac::EnableSrcMatch(bool aEnable)
{
otPlatRadioEnableSrcMatch(GetInstance(), aEnable);
otLogDebgMac(GetInstance(), "Enable SrcMatch -- %d(0:Dis, 1:En)", aEnable);
otLogDebgMac(GetInstance(), "SrcAddrMatch - %s", aEnable ? "Enabling" : "Disabling");
}
ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
@@ -1684,7 +1684,9 @@ ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
if (aAddr.mLength == 2)
{
error = otPlatRadioAddSrcMatchShortEntry(GetInstance(), aAddr.mShortAddress);
otLogDebgMac(GetInstance(), "Adding short address: 0x%x -- %d (0:Ok, 3:NoBufs)", aAddr.mShortAddress, error);
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding short address: 0x%04x -- %s (%d)", aAddr.mShortAddress,
otThreadErrorToString(error), error);
}
else
{
@@ -1696,8 +1698,11 @@ ThreadError Mac::AddSrcMatchEntry(Address &aAddr)
}
error = otPlatRadioAddSrcMatchExtEntry(GetInstance(), buf);
otLogDebgMac(GetInstance(), "Adding extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 3:NoBufs)",
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], error);
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);
}
return error;
@@ -1710,7 +1715,9 @@ ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
if (aAddr.mLength == 2)
{
error = otPlatRadioClearSrcMatchShortEntry(GetInstance(), aAddr.mShortAddress);
otLogDebgMac(GetInstance(), "Clearing short address: 0x%x -- %d (0:OK, 10:NoAddress)", aAddr.mShortAddress, error);
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing short address: 0x%04x -- %s (%d)", aAddr.mShortAddress,
otThreadErrorToString(error), error);
}
else
{
@@ -1722,8 +1729,11 @@ ThreadError Mac::ClearSrcMatchEntry(Address &aAddr)
}
error = otPlatRadioClearSrcMatchExtEntry(GetInstance(), buf);
otLogDebgMac(GetInstance(), "Clearing extended address: 0x%02x%02x%02x%02x%02x%02x%02x%02x -- %d (0:OK, 10:NoAddress)",
buf[7], buf[6], buf[5], buf[4], buf[3], buf[2], buf[1], buf[0], error);
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);
}
return error;
@@ -1733,7 +1743,8 @@ void Mac::ClearSrcMatchEntries()
{
otPlatRadioClearSrcMatchShortEntries(GetInstance());
otPlatRadioClearSrcMatchExtEntries(GetInstance());
otLogDebgMac(GetInstance(), "Clearing source match table");
otLogDebgMac(GetInstance(), "SrcAddrMatch - Cleared all entries");
}
-1
View File
@@ -401,7 +401,6 @@ exit:
void MeshForwarder::ClearSrcMatchEntry(Child &aChild)
{
Mac::Address macAddr;
otLogDebgMac(GetInstance(), "SrcMatch %d (0:Dis, 1:En))", mSrcMatchEnabled);
if (aChild.mAddSrcMatchEntryShort)
{