mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[logging] remove aInstance as input parameter to logging macros (#3184)
This commit is contained in:
committed by
Jonathan Hui
parent
f0b5245f88
commit
309bd09d75
@@ -77,6 +77,7 @@ LOCAL_SRC_FILES := \
|
||||
src/core/api/joiner_api.cpp \
|
||||
src/core/api/link_api.cpp \
|
||||
src/core/api/link_raw_api.cpp \
|
||||
src/core/api/logging_api.cpp \
|
||||
src/core/api/message_api.cpp \
|
||||
src/core/api/netdata_api.cpp \
|
||||
src/core/api/server_api.cpp \
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<ClCompile Include="..\..\src\core\api\joiner_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\link_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\link_raw_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\logging_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\message_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\netdata_api.cpp" />
|
||||
<ClCompile Include="..\..\src\core\api\tasklet_api.cpp" />
|
||||
|
||||
@@ -102,6 +102,9 @@
|
||||
<ClCompile Include="..\..\src\core\api\link_raw_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\logging_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\core\api\message_api.cpp">
|
||||
<Filter>Source Files\api</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -106,7 +106,7 @@ void enableReceiver(void)
|
||||
{
|
||||
if (!sIsReceiverEnabled)
|
||||
{
|
||||
otLogInfoPlat(sInstance, "Enabling receiver", NULL);
|
||||
otLogInfoPlat("Enabling receiver", NULL);
|
||||
|
||||
// flush rxfifo
|
||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHRX;
|
||||
@@ -122,7 +122,7 @@ void disableReceiver(void)
|
||||
{
|
||||
if (sIsReceiverEnabled)
|
||||
{
|
||||
otLogInfoPlat(sInstance, "Disabling receiver", NULL);
|
||||
otLogInfoPlat("Disabling receiver", NULL);
|
||||
|
||||
while (HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE)
|
||||
;
|
||||
@@ -153,7 +153,7 @@ void setChannel(uint8_t aChannel)
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
otLogInfoPlat(sInstance, "Channel=%d", aChannel);
|
||||
otLogInfoPlat("Channel=%d", aChannel);
|
||||
|
||||
HWREG(RFCORE_XREG_FREQCTRL) = 11 + (aChannel - 11) * 5;
|
||||
sChannel = aChannel;
|
||||
@@ -171,7 +171,7 @@ void setTxPower(int8_t aTxPower)
|
||||
|
||||
if (sTxPower != aTxPower)
|
||||
{
|
||||
otLogInfoPlat(sInstance, "TxPower=%d", aTxPower);
|
||||
otLogInfoPlat("TxPower=%d", aTxPower);
|
||||
|
||||
for (i = sizeof(sTxPowerTable) / sizeof(TxPowerTable) - 1; i > 0; i--)
|
||||
{
|
||||
@@ -219,7 +219,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "PANID=%X", aPanid);
|
||||
otLogInfoPlat("PANID=%X", aPanid);
|
||||
|
||||
HWREG(RFCORE_FFSM_PAN_ID0) = aPanid & 0xFF;
|
||||
HWREG(RFCORE_FFSM_PAN_ID1) = aPanid >> 8;
|
||||
@@ -229,8 +229,8 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5],
|
||||
aAddress->m8[4], aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
otLogInfoPlat("ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5], aAddress->m8[4],
|
||||
aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
@@ -242,7 +242,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "ShortAddr=%X", aAddress);
|
||||
otLogInfoPlat("ShortAddr=%X", aAddress);
|
||||
|
||||
HWREG(RFCORE_FFSM_SHORT_ADDR0) = aAddress & 0xFF;
|
||||
HWREG(RFCORE_FFSM_SHORT_ADDR1) = aAddress >> 8;
|
||||
@@ -276,7 +276,7 @@ void cc2538RadioInit(void)
|
||||
HWREG(RFCORE_XREG_TXPOWER) = sTxPowerTable[0].mTxPowerReg;
|
||||
sTxPower = sTxPowerTable[0].mTxPowerVal;
|
||||
|
||||
otLogInfoPlat(sInstance, "Initialized", NULL);
|
||||
otLogInfoPlat("Initialized", NULL);
|
||||
}
|
||||
|
||||
bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
@@ -289,7 +289,7 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
if (!otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogDebgPlat("State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
sState = OT_RADIO_STATE_SLEEP;
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
if (otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=OT_RADIO_STATE_DISABLED", NULL);
|
||||
otLogDebgPlat("State=OT_RADIO_STATE_DISABLED", NULL);
|
||||
sState = OT_RADIO_STATE_DISABLED;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
|
||||
if (sState == OT_RADIO_STATE_SLEEP || sState == OT_RADIO_STATE_RECEIVE)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogDebgPlat("State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
error = OT_ERROR_NONE;
|
||||
sState = OT_RADIO_STATE_SLEEP;
|
||||
disableReceiver();
|
||||
@@ -330,7 +330,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
|
||||
if (sState != OT_RADIO_STATE_DISABLED)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "State=OT_RADIO_STATE_RECEIVE", NULL);
|
||||
otLogDebgPlat("State=OT_RADIO_STATE_RECEIVE", NULL);
|
||||
|
||||
error = OT_ERROR_NONE;
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
@@ -395,7 +395,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogCritPlat(sInstance, "Radio is stuck!!! FSMSTAT0=0x%08x FSMSTAT1=0x%08x RFERRF=0x%08x",
|
||||
otLogCritPlat("Radio is stuck!!! FSMSTAT0=0x%08x FSMSTAT1=0x%08x RFERRF=0x%08x",
|
||||
HWREG(RFCORE_XREG_FSMSTAT0), HWREG(RFCORE_XREG_FSMSTAT1), HWREG(RFCORE_SFR_RFERRF));
|
||||
i = 1000000;
|
||||
}
|
||||
@@ -407,12 +407,12 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
if (HWREG(RFCORE_SFR_RFERRF) & RFCORE_SFR_RFERRF_RXOVERF)
|
||||
{
|
||||
otLogCritPlat(sInstance, "RX Buffer Overflow detected", NULL);
|
||||
otLogCritPlat("RX Buffer Overflow detected", NULL);
|
||||
}
|
||||
|
||||
if (HWREG(RFCORE_SFR_RFERRF) & RFCORE_SFR_RFERRF_RXABO)
|
||||
{
|
||||
otLogCritPlat(sInstance, "Aborted RX detected", NULL);
|
||||
otLogCritPlat("Aborted RX detected", NULL);
|
||||
}
|
||||
|
||||
// Flush the RX buffer
|
||||
@@ -423,7 +423,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
// Check for idle state. After flushing the RX buffer, we may wind up here.
|
||||
if (!(HWREG(RFCORE_XREG_FSMSTAT1) & (RFCORE_XREG_FSMSTAT1_TX_ACTIVE | RFCORE_XREG_FSMSTAT1_RX_ACTIVE)))
|
||||
{
|
||||
otLogCritPlat(sInstance, "Idle state detected", NULL);
|
||||
otLogCritPlat("Idle state detected", NULL);
|
||||
|
||||
// In this case, the state of our driver mis-matches our state. So force
|
||||
// matters by clearing our channel variable and calling setChannel. This
|
||||
@@ -450,7 +450,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
while (HWREG(RFCORE_XREG_FSMSTAT1) & RFCORE_XREG_FSMSTAT1_TX_ACTIVE)
|
||||
;
|
||||
|
||||
otLogDebgPlat(sInstance, "Transmitted %d bytes", aFrame->mLength);
|
||||
otLogDebgPlat("Transmitted %d bytes", aFrame->mLength);
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -485,7 +485,7 @@ void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "PromiscuousMode=%d", aEnable ? 1 : 0);
|
||||
otLogInfoPlat("PromiscuousMode=%d", aEnable ? 1 : 0);
|
||||
|
||||
if (aEnable)
|
||||
{
|
||||
@@ -537,7 +537,7 @@ void readFrame(otInstance *aInstance)
|
||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHRX;
|
||||
HWREG(RFCORE_SFR_RFST) = RFCORE_SFR_RFST_INSTR_FLUSHRX;
|
||||
|
||||
otLogDebgPlat(sInstance, "Dropping %d received bytes (Invalid CRC)", length);
|
||||
otLogDebgPlat("Dropping %d received bytes (Invalid CRC)", length);
|
||||
}
|
||||
|
||||
// check for rxfifo overflow
|
||||
@@ -573,7 +573,7 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
if (((HWREG(RFCORE_XREG_FRMFILT0) & RFCORE_XREG_FRMFILT0_FRAME_FILTER_EN) == 0) ||
|
||||
(sReceiveFrame.mLength > IEEE802154_ACK_LENGTH))
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Received %d bytes", sReceiveFrame.mLength);
|
||||
otLogDebgPlat("Received %d bytes", sReceiveFrame.mLength);
|
||||
otPlatRadioReceiveDone(aInstance, &sReceiveFrame, sReceiveError);
|
||||
}
|
||||
}
|
||||
@@ -585,7 +585,7 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sTransmitError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Transmit failed ErrorCode=%d", sTransmitError);
|
||||
otLogDebgPlat("Transmit failed ErrorCode=%d", sTransmitError);
|
||||
}
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
@@ -734,8 +734,8 @@ int8_t findSrcMatchAvailEntry(bool aShort)
|
||||
uint32_t shortEnableStatus = getSrcMatchEntriesEnableStatus(true);
|
||||
uint32_t extEnableStatus = getSrcMatchEntriesEnableStatus(false);
|
||||
|
||||
otLogDebgPlat(sInstance, "Short enable status: 0x%x", shortEnableStatus);
|
||||
otLogDebgPlat(sInstance, "Ext enable status: 0x%x", extEnableStatus);
|
||||
otLogDebgPlat("Short enable status: 0x%x", shortEnableStatus);
|
||||
otLogDebgPlat("Ext enable status: 0x%x", extEnableStatus);
|
||||
|
||||
if (aShort)
|
||||
{
|
||||
@@ -784,7 +784,7 @@ void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "EnableSrcMatch=%d", aEnable ? 1 : 0);
|
||||
otLogInfoPlat("EnableSrcMatch=%d", aEnable ? 1 : 0);
|
||||
|
||||
if (aEnable)
|
||||
{
|
||||
@@ -806,7 +806,7 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Add ShortAddr entry: %d", entry);
|
||||
otLogDebgPlat("Add ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
@@ -830,7 +830,7 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
uint32_t *addr = (uint32_t *)RFCORE_FFSM_SRCADDRESS_TABLE;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Add ExtAddr entry: %d", entry);
|
||||
otLogDebgPlat("Add ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
@@ -853,7 +853,7 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
int8_t entry = findSrcMatchShortEntry(aShortAddress);
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entry: %d", entry);
|
||||
otLogDebgPlat("Clear ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -869,7 +869,7 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
int8_t entry = findSrcMatchExtEntry(aExtAddress);
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entry: %d", entry);
|
||||
otLogDebgPlat("Clear ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -885,7 +885,7 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
uint32_t *addrAutoPendEn = (uint32_t *)RFCORE_FFSM_SRCSHORTPENDEN0;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entries", NULL);
|
||||
otLogDebgPlat("Clear ShortAddr entries", NULL);
|
||||
|
||||
for (uint8_t i = 0; i < RFCORE_XREG_SRCMATCH_ENABLE_STATUS_SIZE; i++)
|
||||
{
|
||||
@@ -900,7 +900,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
uint32_t *addrAutoPendEn = (uint32_t *)RFCORE_FFSM_SRCEXTPENDEN0;
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entries", NULL);
|
||||
otLogDebgPlat("Clear ExtAddr entries", NULL);
|
||||
|
||||
for (uint8_t i = 0; i < RFCORE_XREG_SRCMATCH_ENABLE_STATUS_SIZE; i++)
|
||||
{
|
||||
|
||||
@@ -152,22 +152,22 @@ void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64)
|
||||
|
||||
void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanid)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Set PanId: %X", aPanid);
|
||||
otLogInfoPlat("Set PanId: %X", aPanid);
|
||||
|
||||
ftdf_set_value(FTDF_PIB_PAN_ID, &aPanid);
|
||||
}
|
||||
|
||||
void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aAddress)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Set Extended Address: %X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6],
|
||||
aAddress->m8[5], aAddress->m8[4], aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
otLogInfoPlat("Set Extended Address: %X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5],
|
||||
aAddress->m8[4], aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
|
||||
ftdf_set_value(FTDF_PIB_EXTENDED_ADDRESS, aAddress->m8);
|
||||
}
|
||||
|
||||
void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Set Short Address: %X", aAddress);
|
||||
otLogInfoPlat("Set Short Address: %X", aAddress);
|
||||
|
||||
ftdf_set_value(FTDF_PIB_SHORT_ADDRESS, &aAddress);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
ftdf_enable_transparent_mode(FTDF_TRUE, options);
|
||||
otPlatRadioSetPromiscuous(aInstance, false);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_SLEEP", NULL);
|
||||
sRadioState = OT_RADIO_STATE_SLEEP;
|
||||
|
||||
exit:
|
||||
@@ -212,7 +212,7 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
|
||||
ftdf_fppr_reset();
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_DISABLED", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_DISABLED", NULL);
|
||||
sRadioState = OT_RADIO_STATE_DISABLED;
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
@@ -241,7 +241,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
|
||||
otEXPECT_ACTION(sRadioState == OT_RADIO_STATE_RECEIVE, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_SLEEP", NULL);
|
||||
sRadioState = OT_RADIO_STATE_SLEEP;
|
||||
|
||||
sEnableRX = 0;
|
||||
@@ -269,7 +269,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
sEnableRX = 1;
|
||||
ftdf_set_value(FTDF_PIB_RX_ON_WHEN_IDLE, &sEnableRX);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_RECEIVE", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_RECEIVE", NULL);
|
||||
sRadioState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
exit:
|
||||
@@ -293,7 +293,7 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
|
||||
otEXPECT_ACTION(ftdf_fppr_get_free_short_address(&entry, &entryIdx), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
otLogDebgPlat(aInstance, "Add ShortAddress entry: %d", entry);
|
||||
otLogDebgPlat("Add ShortAddress entry: %d", entry);
|
||||
|
||||
ftdf_fppr_set_short_address(entry, entryIdx, aShortAddress);
|
||||
ftdf_fppr_set_short_address_valid(entry, entryIdx, FTDF_TRUE);
|
||||
@@ -321,7 +321,7 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
|
||||
otEXPECT_ACTION(ftdf_fppr_get_free_ext_address(&entry), error = OT_ERROR_NO_BUFS);
|
||||
|
||||
otLogDebgPlat(aInstance, "Add ExtAddress entry: %d", entry);
|
||||
otLogDebgPlat("Add ExtAddress entry: %d", entry);
|
||||
|
||||
ftdf_fppr_set_ext_address(entry, addr);
|
||||
ftdf_fppr_set_ext_address_valid(entry, FTDF_TRUE);
|
||||
@@ -338,7 +338,7 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
|
||||
otEXPECT_ACTION(ftdf_fppr_lookup_short_address(aShortAddress, &entry, &entryIdx), error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
otLogDebgPlat(aInstance, "Clear ShortAddress entry: %d", entry);
|
||||
otLogDebgPlat("Clear ShortAddress entry: %d", entry);
|
||||
|
||||
ftdf_fppr_set_short_address(entry, entryIdx, 0);
|
||||
ftdf_fppr_set_short_address_valid(entry, entryIdx, FTDF_FALSE);
|
||||
@@ -363,7 +363,7 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
|
||||
otEXPECT_ACTION(ftdf_fppr_lookup_ext_address(addr, &entry), error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
otLogDebgPlat(aInstance, "Clear ExtAddress entry: %d", entry);
|
||||
otLogDebgPlat("Clear ExtAddress entry: %d", entry);
|
||||
|
||||
ftdf_fppr_set_ext_address(entry, 0);
|
||||
ftdf_fppr_set_ext_address_valid(entry, FTDF_FALSE);
|
||||
@@ -376,7 +376,7 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
uint8_t i, j;
|
||||
|
||||
otLogDebgPlat(aInstance, "Clear ShortAddress entries", NULL);
|
||||
otLogDebgPlat("Clear ShortAddress entries", NULL);
|
||||
|
||||
for (i = 0; i < FTDF_FPPR_TABLE_ENTRIES; i++)
|
||||
{
|
||||
@@ -394,7 +394,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
otLogDebgPlat(aInstance, "Clear ExtAddress entries", NULL);
|
||||
otLogDebgPlat("Clear ExtAddress entries", NULL);
|
||||
|
||||
for (i = 0; i < FTDF_FPPR_TABLE_ENTRIES; i++)
|
||||
{
|
||||
@@ -418,11 +418,11 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
|
||||
otEXPECT_ACTION(sRadioState != OT_RADIO_STATE_DISABLED, error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio start transmit: %d bytes on channel: %d", aFrame->mLength, aFrame->mChannel);
|
||||
otLogDebgPlat("Radio start transmit: %d bytes on channel: %d", aFrame->mLength, aFrame->mChannel);
|
||||
|
||||
ad_ftdf_send_frame_simple(aFrame->mLength, aFrame->mPsdu, aFrame->mChannel, 0, FTDF_TRUE);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_TRANSMIT", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_TRANSMIT", NULL);
|
||||
sRadioState = OT_RADIO_STATE_TRANSMIT;
|
||||
|
||||
otPlatRadioTxStarted(aInstance, aFrame);
|
||||
@@ -454,7 +454,7 @@ bool otPlatRadioGetPromiscuous(otInstance *aInstance)
|
||||
|
||||
void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Set Promiscuous: %d", aEnable ? 1 : 0);
|
||||
otLogInfoPlat("Set Promiscuous: %d", aEnable ? 1 : 0);
|
||||
|
||||
ftdf_set_value(FTDF_PIB_PROMISCUOUS_MODE, &aEnable);
|
||||
sRadioPromiscuous = aEnable;
|
||||
@@ -483,7 +483,7 @@ exit:
|
||||
|
||||
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Set DefaultTxPower: %d", aPower);
|
||||
otLogInfoPlat("Set DefaultTxPower: %d", aPower);
|
||||
|
||||
sTxPower = aPower;
|
||||
ftdf_set_value(FTDF_PIB_TX_POWER, &aPower);
|
||||
@@ -499,7 +499,7 @@ void da15000RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
ftdf_get_frame_header(sReceiveFrame[sReadFrame].mPsdu, &frameHeader);
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio received: %d bytes", sReceiveFrame[sReadFrame].mLength);
|
||||
otLogDebgPlat("Radio received: %d bytes", sReceiveFrame[sReadFrame].mLength);
|
||||
|
||||
if (frameHeader.frame_type == FTDF_ACKNOWLEDGEMENT_FRAME)
|
||||
{
|
||||
@@ -515,7 +515,7 @@ void da15000RadioProcess(otInstance *aInstance)
|
||||
|
||||
if (sTransmitDoneFrame)
|
||||
{
|
||||
otLogDebgPlat(aInstance, "Radio transmit status: %s", otThreadErrorToString(sTransmitStatus));
|
||||
otLogDebgPlat("Radio transmit status: %s", otThreadErrorToString(sTransmitStatus));
|
||||
|
||||
ftdf_get_frame_header(sTransmitFrame.mPsdu, &frameHeader);
|
||||
|
||||
@@ -534,7 +534,7 @@ void da15000RadioProcess(otInstance *aInstance)
|
||||
|
||||
sTransmitDoneFrame = false;
|
||||
|
||||
otLogDebgPlat(aInstance, "Radio state: OT_RADIO_STATE_RECEIVE", NULL);
|
||||
otLogDebgPlat("Radio state: OT_RADIO_STATE_RECEIVE", NULL);
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -192,7 +192,7 @@ void efr32RadioInit(void)
|
||||
sTransmitFrame.mLength = 0;
|
||||
sTransmitFrame.mPsdu = sTransmitPsdu;
|
||||
|
||||
otLogInfoPlat(sInstance, "Initialized", NULL);
|
||||
otLogInfoPlat("Initialized", NULL);
|
||||
}
|
||||
|
||||
void efr32RadioDeinit(void)
|
||||
@@ -226,7 +226,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "PANID=%X", aPanId);
|
||||
otLogInfoPlat("PANID=%X", aPanId);
|
||||
|
||||
sPanId = aPanId;
|
||||
status = RAIL_IEEE802154_SetPanId(sRailHandle, aPanId, 0);
|
||||
@@ -239,8 +239,8 @@ void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aA
|
||||
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5],
|
||||
aAddress->m8[4], aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
otLogInfoPlat("ExtAddr=%X%X%X%X%X%X%X%X", aAddress->m8[7], aAddress->m8[6], aAddress->m8[5], aAddress->m8[4],
|
||||
aAddress->m8[3], aAddress->m8[2], aAddress->m8[1], aAddress->m8[0]);
|
||||
|
||||
status = RAIL_IEEE802154_SetLongAddress(sRailHandle, (uint8_t *)aAddress->m8, 0);
|
||||
assert(status == RAIL_STATUS_NO_ERROR);
|
||||
@@ -252,7 +252,7 @@ void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aAddress)
|
||||
|
||||
(void)aInstance;
|
||||
|
||||
otLogInfoPlat(sInstance, "ShortAddr=%X", aAddress);
|
||||
otLogInfoPlat("ShortAddr=%X", aAddress);
|
||||
|
||||
status = RAIL_IEEE802154_SetShortAddress(sRailHandle, aAddress, 0);
|
||||
assert(status == RAIL_STATUS_NO_ERROR);
|
||||
@@ -268,7 +268,7 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otEXPECT(!otPlatRadioIsEnabled(aInstance));
|
||||
|
||||
otLogInfoPlat(sInstance, "State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogInfoPlat("State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
sState = OT_RADIO_STATE_SLEEP;
|
||||
|
||||
exit:
|
||||
@@ -279,7 +279,7 @@ otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otEXPECT(otPlatRadioIsEnabled(aInstance));
|
||||
|
||||
otLogInfoPlat(sInstance, "State=OT_RADIO_STATE_DISABLED", NULL);
|
||||
otLogInfoPlat("State=OT_RADIO_STATE_DISABLED", NULL);
|
||||
sState = OT_RADIO_STATE_DISABLED;
|
||||
|
||||
exit:
|
||||
@@ -294,7 +294,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
otEXPECT_ACTION((sState != OT_RADIO_STATE_TRANSMIT) && (sState != OT_RADIO_STATE_DISABLED),
|
||||
error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogInfoPlat(sInstance, "State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
otLogInfoPlat("State=OT_RADIO_STATE_SLEEP", NULL);
|
||||
sState = OT_RADIO_STATE_SLEEP;
|
||||
|
||||
RAIL_Idle(sRailHandle, RAIL_IDLE, true);
|
||||
@@ -314,7 +314,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
status = RAIL_StartRx(sRailHandle, aChannel, NULL);
|
||||
otEXPECT_ACTION(status == RAIL_STATUS_NO_ERROR, error = OT_ERROR_FAILED);
|
||||
|
||||
otLogInfoPlat(sInstance, "State=OT_RADIO_STATE_RECEIVE", NULL);
|
||||
otLogInfoPlat("State=OT_RADIO_STATE_RECEIVE", NULL);
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
sReceiveFrame.mChannel = aChannel;
|
||||
|
||||
@@ -513,7 +513,7 @@ otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, const uint16_t a
|
||||
int8_t entry = -1;
|
||||
|
||||
entry = findSrcMatchAvailEntry(true);
|
||||
otLogDebgPlat(sInstance, "Add ShortAddr entry: %d", entry);
|
||||
otLogDebgPlat("Add ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
@@ -530,7 +530,7 @@ otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress
|
||||
(void)aInstance;
|
||||
|
||||
entry = findSrcMatchAvailEntry(false);
|
||||
otLogDebgPlat(sInstance, "Add ExtAddr entry: %d", entry);
|
||||
otLogDebgPlat("Add ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM, error = OT_ERROR_NO_BUFS);
|
||||
|
||||
@@ -547,7 +547,7 @@ otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, const uint16_t
|
||||
(void)aInstance;
|
||||
|
||||
entry = findSrcMatchShortEntry(aShortAddress);
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entry: %d", entry);
|
||||
otLogDebgPlat("Clear ShortAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -564,7 +564,7 @@ otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddre
|
||||
(void)aInstance;
|
||||
|
||||
entry = findSrcMatchExtEntry(aExtAddress);
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entry: %d", entry);
|
||||
otLogDebgPlat("Clear ExtAddr entry: %d", entry);
|
||||
|
||||
otEXPECT_ACTION(entry >= 0 && entry < RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM, error = OT_ERROR_NO_ADDRESS);
|
||||
|
||||
@@ -578,7 +578,7 @@ void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ShortAddr entries", NULL);
|
||||
otLogDebgPlat("Clear ShortAddr entries", NULL);
|
||||
|
||||
memset(srcMatchShortEntry, 0, sizeof(srcMatchShortEntry));
|
||||
}
|
||||
@@ -587,7 +587,7 @@ void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Clear ExtAddr entries", NULL);
|
||||
otLogDebgPlat("Clear ExtAddr entries", NULL);
|
||||
|
||||
memset(srcMatchExtEntry, 0, sizeof(srcMatchExtEntry));
|
||||
}
|
||||
@@ -617,7 +617,7 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle
|
||||
// check the length validity of recv packet
|
||||
otEXPECT(length >= IEEE802154_MIN_LENGTH && length <= IEEE802154_MAX_LENGTH);
|
||||
|
||||
otLogInfoPlat(aInstance, "Received data:%d", length);
|
||||
otLogInfoPlat("Received data:%d", length);
|
||||
|
||||
// skip length byte
|
||||
assert(packetInfo.firstPortionBytes > 0);
|
||||
@@ -673,7 +673,7 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle
|
||||
// otherwise only signal MAC layer for non-ACK frame
|
||||
if (sPromiscuous || sReceiveFrame.mLength > IEEE802154_ACK_LENGTH)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "Received %d bytes", sReceiveFrame.mLength);
|
||||
otLogInfoPlat("Received %d bytes", sReceiveFrame.mLength);
|
||||
otPlatRadioReceiveDone(aInstance, &sReceiveFrame, sReceiveError);
|
||||
}
|
||||
}
|
||||
@@ -776,7 +776,7 @@ void efr32RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sTransmitError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Transmit failed ErrorCode=%d", sTransmitError);
|
||||
otLogDebgPlat("Transmit failed ErrorCode=%d", sTransmitError);
|
||||
}
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
@@ -156,7 +156,7 @@ static void setTxPower(uint8_t aPower)
|
||||
}
|
||||
}
|
||||
|
||||
otLogDebgPlat(sInstance, "Radio set tx power: %d, %d", aPower, i);
|
||||
otLogDebgPlat("Radio set tx power: %d, %d", aPower, i);
|
||||
|
||||
radioTrxOff();
|
||||
|
||||
@@ -172,7 +172,7 @@ static void setChannel(uint8_t aChannel)
|
||||
{
|
||||
if (aChannel != sChannel)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Radio set channel: %d", aChannel);
|
||||
otLogDebgPlat("Radio set channel: %d", aChannel);
|
||||
|
||||
radioTrxOff();
|
||||
|
||||
@@ -234,7 +234,7 @@ static void handleRx(void)
|
||||
// otherwise only signal MAC layer for non-ACK frame
|
||||
if (sPromiscuous || sReceiveFrame.mLength > IEEE802154_ACK_LENGTH)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Radio receive done, rssi: %d", sReceiveFrame.mInfo.mRxInfo.mRssi);
|
||||
otLogDebgPlat("Radio receive done, rssi: %d", sReceiveFrame.mInfo.mRxInfo.mRssi);
|
||||
|
||||
otPlatRadioReceiveDone(sInstance, &sReceiveFrame, OT_ERROR_NONE);
|
||||
}
|
||||
@@ -257,7 +257,7 @@ static void handleTx(void)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Radio transmit done, status: %d", sTxStatus);
|
||||
otLogDebgPlat("Radio transmit done, status: %d", sTxStatus);
|
||||
|
||||
otPlatRadioTxDone(sInstance, &sTransmitFrame, NULL, sTxStatus);
|
||||
}
|
||||
@@ -376,7 +376,7 @@ void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Set Pan ID: 0x%04X", aPanId);
|
||||
otLogDebgPlat("Set Pan ID: 0x%04X", aPanId);
|
||||
|
||||
radioTrxOff();
|
||||
|
||||
@@ -416,7 +416,7 @@ bool otPlatRadioIsEnabled(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioEnable(otInstance *aInstance)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Radio enable");
|
||||
otLogDebgPlat("Radio enable");
|
||||
|
||||
if (!otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
@@ -430,7 +430,7 @@ otError otPlatRadioEnable(otInstance *aInstance)
|
||||
|
||||
otError otPlatRadioDisable(otInstance *aInstance)
|
||||
{
|
||||
otLogDebgPlat(sInstance, "Radio disable");
|
||||
otLogDebgPlat("Radio disable");
|
||||
|
||||
if (otPlatRadioIsEnabled(aInstance))
|
||||
{
|
||||
@@ -446,7 +446,7 @@ otError otPlatRadioSleep(otInstance *aInstance)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Radio sleep");
|
||||
otLogDebgPlat("Radio sleep");
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
@@ -465,7 +465,7 @@ otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Radio receive, channel: %d", aChannel);
|
||||
otLogDebgPlat("Radio receive, channel: %d", aChannel);
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
@@ -486,7 +486,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Radio transmit");
|
||||
otLogDebgPlat("Radio transmit");
|
||||
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
@@ -606,7 +606,7 @@ otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
|
||||
{
|
||||
(void)aInstance;
|
||||
|
||||
otLogDebgPlat(sInstance, "Radio set default TX power: %d", aPower);
|
||||
otLogDebgPlat("Radio set default TX power: %d", aPower);
|
||||
|
||||
setTxPower(aPower);
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ openthread_headers = \
|
||||
joiner.h \
|
||||
link.h \
|
||||
link_raw.h \
|
||||
logging.h \
|
||||
message.h \
|
||||
ncp.h \
|
||||
netdata.h \
|
||||
|
||||
@@ -356,29 +356,6 @@ OTAPI void OTCALL otInstanceFactoryReset(otInstance *aInstance);
|
||||
*/
|
||||
otError otInstanceErasePersistentInfo(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function returns the current dynamic log level.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
*
|
||||
* @returns the currently set dynamic log level.
|
||||
*
|
||||
*/
|
||||
otLogLevel otGetDynamicLogLevel(otInstance *aInstance);
|
||||
|
||||
/**
|
||||
* This function sets the dynamic log level.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aLogLevel The dynamic log level.
|
||||
*
|
||||
* @retval OT_ERROR_NONE The log level was changed successfully.
|
||||
* @retval OT_ERROR_DISABLED_FEATURE The dynamic log level feature is disabled.
|
||||
* (see `OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL` configuration option).
|
||||
*
|
||||
*/
|
||||
otError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel);
|
||||
|
||||
/**
|
||||
* This function gets the OpenThread version string.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @brief
|
||||
* This file includes OpenThread logging related definitions.
|
||||
*/
|
||||
|
||||
#ifndef OPENTHREAD_LOGGING_H_
|
||||
#define OPENTHREAD_LOGGING_H_
|
||||
|
||||
#include <openthread/error.h>
|
||||
#include <openthread/platform/logging.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @addtogroup api-logging
|
||||
*
|
||||
* @brief
|
||||
* This module includes OpenThread logging related definitions.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This function returns the current log level.
|
||||
*
|
||||
* If dynamic log level feature `OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL` is enabled, this function returns the
|
||||
* currently set dynamic log level. Otherwise, this function returns the build-time configured log level.
|
||||
*
|
||||
* @returns The log level.
|
||||
*
|
||||
*/
|
||||
otLogLevel otLoggingGetLevel(void);
|
||||
|
||||
/**
|
||||
* This function sets the log level.
|
||||
*
|
||||
* @param[in] aLogLevel The log level.
|
||||
*
|
||||
* @retval OT_ERROR_NONE The log level was changed successfully.
|
||||
* @retval OT_ERROR_DISABLED_FEATURE The dynamic log level feature is not supported.
|
||||
* (see `OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL` configuration option).
|
||||
*
|
||||
*/
|
||||
otError otLoggingSetLevel(otLogLevel aLogLevel);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_LOGGING_H_
|
||||
@@ -158,358 +158,358 @@
|
||||
// ==API==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritApi, "[%p]API%!SPACE!", &CTX);
|
||||
// otLogCritApi{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_API}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritApi, "API%!SPACE!");
|
||||
// otLogCritApi{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_API}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnApi, "[%p]API%!SPACE!", &CTX);
|
||||
// otLogWarnApi{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_API}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnApi, "API%!SPACE!");
|
||||
// otLogWarnApi{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_API}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteApi, "[%p]API%!SPACE!", &CTX);
|
||||
// otLogNoteApi{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_API}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteApi, "API%!SPACE!");
|
||||
// otLogNoteApi{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_API}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoApi, "[%p]API%!SPACE!", &CTX);
|
||||
// otLogInfoApi{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_API}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoApi, "API%!SPACE!");
|
||||
// otLogInfoApi{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_API}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgApi, "[%p]API%!SPACE!", &CTX);
|
||||
// otLogDebgApi{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_API}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgApi, "API%!SPACE!");
|
||||
// otLogDebgApi{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_API}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==NCP==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritNcp, "[%p]NCP%!SPACE!", &CTX);
|
||||
// otLogCritNcp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NCP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritNcp, "NCP%!SPACE!");
|
||||
// otLogCritNcp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NCP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnNcp, "[%p]NCP%!SPACE!", &CTX);
|
||||
// otLogWarnNcp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NCP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnNcp, "NCP%!SPACE!");
|
||||
// otLogWarnNcp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NCP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteNcp, "[%p]NCP%!SPACE!", &CTX);
|
||||
// otLogNoteNcp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NCP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteNcp, "NCP%!SPACE!");
|
||||
// otLogNoteNcp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NCP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoNcp, "[%p]NCP%!SPACE!", &CTX);
|
||||
// otLogInfoNcp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NCP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoNcp, "NCP%!SPACE!");
|
||||
// otLogInfoNcp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NCP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgNcp, "[%p]NCP%!SPACE!", &CTX);
|
||||
// otLogDebgNcp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NCP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgNcp, "NCP%!SPACE!");
|
||||
// otLogDebgNcp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NCP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==MESHCOP==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogCritMeshCoP{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogCritMeshCoP{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogWarnMeshCoP{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogWarnMeshCoP{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogNoteMeshCoP{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogNoteMeshCoP{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogInfoMeshCoP{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogInfoMeshCoP{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogDebgMeshCoP{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogDebgMeshCoP{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCertMeshCoP, "[%p]MESHCOP%!SPACE!", &CTX);
|
||||
// otLogCertMeshCoP{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MESHCOP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCertMeshCoP, "MESHCOP%!SPACE!");
|
||||
// otLogCertMeshCoP{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MESHCOP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==MBEDTLS==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritMbedTls, "[%p]MBED%!SPACE!", &CTX);
|
||||
// otLogCritMbedTls{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MBEDTLS}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritMbedTls, "MBED%!SPACE!");
|
||||
// otLogCritMbedTls{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MBEDTLS}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMbedTls, "[%p]MBED%!SPACE!", &CTX);
|
||||
// otLogWarnMbedTls{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MBEDTLS}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMbedTls, "MBED%!SPACE!");
|
||||
// otLogWarnMbedTls{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MBEDTLS}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteMbedTls, "[%p]MBED%!SPACE!", &CTX);
|
||||
// otLogNoteMbedTls{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MBEDTLS}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteMbedTls, "MBED%!SPACE!");
|
||||
// otLogNoteMbedTls{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MBEDTLS}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoMbedTls, "[%p]MBED%!SPACE!", &CTX);
|
||||
// otLogInfoMbedTls{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MBEDTLS}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoMbedTls, "MBED%!SPACE!");
|
||||
// otLogInfoMbedTls{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MBEDTLS}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMbedTls, "[%p]MBED%!SPACE!", &CTX);
|
||||
// otLogDebgMbedTls{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MBEDTLS}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMbedTls, "MBED%!SPACE!");
|
||||
// otLogDebgMbedTls{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MBEDTLS}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==MLE==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritMle, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogCritMle{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MLE}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritMle, "MLE%!SPACE!");
|
||||
// otLogCritMle{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MLE}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMle, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogWarnMle{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MLE}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMle, "MLE%!SPACE!");
|
||||
// otLogWarnMle{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MLE}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMleErr, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogWarnMleErr{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MLE}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMleErr, "MLE%!SPACE!");
|
||||
// otLogWarnMleErr{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MLE}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogWarnMleErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteMle, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogNoteMle{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MLE}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteMle, "MLE%!SPACE!");
|
||||
// otLogNoteMle{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MLE}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoMle, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogInfoMle{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MLE}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoMle, "MLE%!SPACE!");
|
||||
// otLogInfoMle{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MLE}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMle, "[%p]MLE%!SPACE!", &CTX);
|
||||
// otLogDebgMle{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MLE}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMle, "MLE%!SPACE!");
|
||||
// otLogDebgMle{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MLE}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==ARP==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritArp, "[%p]ARP%!SPACE!", &CTX);
|
||||
// otLogCritArp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_ARP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritArp, "ARP%!SPACE!");
|
||||
// otLogCritArp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_ARP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnArp, "[%p]ARP%!SPACE!", &CTX);
|
||||
// otLogWarnArp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_ARP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnArp, "ARP%!SPACE!");
|
||||
// otLogWarnArp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_ARP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteArp, "[%p]ARP%!SPACE!", &CTX);
|
||||
// otLogNoteArp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ARP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteArp, "ARP%!SPACE!");
|
||||
// otLogNoteArp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ARP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoArp, "[%p]ARP%!SPACE!", &CTX);
|
||||
// otLogInfoArp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ARP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoArp, "ARP%!SPACE!");
|
||||
// otLogInfoArp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ARP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgArp, "[%p]ARP%!SPACE!", &CTX);
|
||||
// otLogDebgArp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_ARP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgArp, "ARP%!SPACE!");
|
||||
// otLogDebgArp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_ARP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==NETD==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritNetData, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogCritNetData{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NETD}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritNetData, "NETD%!SPACE!");
|
||||
// otLogCritNetData{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NETD}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnNetData, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogWarnNetData{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NETD}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnNetData, "NETD%!SPACE!");
|
||||
// otLogWarnNetData{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NETD}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteNetData, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogNoteNetData{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NETD}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteNetData, "NETD%!SPACE!");
|
||||
// otLogNoteNetData{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NETD}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoNetData, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogInfoNetData{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NETD}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoNetData, "NETD%!SPACE!");
|
||||
// otLogInfoNetData{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NETD}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgNetData, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogDebgNetData{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NETD}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgNetData, "NETD%!SPACE!");
|
||||
// otLogDebgNetData{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NETD}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==ICMP==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritIcmp, "[%p]ICMP%!SPACE!", &CTX);
|
||||
// otLogCritIcmp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_ICMP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritIcmp, "ICMP%!SPACE!");
|
||||
// otLogCritIcmp{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_ICMP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnIcmp, "[%p]ICMP%!SPACE!", &CTX);
|
||||
// otLogWarnIcmp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_ICMP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnIcmp, "ICMP%!SPACE!");
|
||||
// otLogWarnIcmp{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_ICMP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteIcmp, "[%p]ICMP%!SPACE!", &CTX);
|
||||
// otLogNoteIcmp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ICMP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteIcmp, "ICMP%!SPACE!");
|
||||
// otLogNoteIcmp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ICMP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoIcmp, "[%p]ICMP%!SPACE!", &CTX);
|
||||
// otLogInfoIcmp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ICMP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoIcmp, "ICMP%!SPACE!");
|
||||
// otLogInfoIcmp{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_ICMP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgIcmp, "[%p]ICMP%!SPACE!", &CTX);
|
||||
// otLogDebgIcmp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_ICMP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgIcmp, "ICMP%!SPACE!");
|
||||
// otLogDebgIcmp{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_ICMP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==IPV6==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritIp6, "[%p]IP6%!SPACE!", &CTX);
|
||||
// otLogCritIp6{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_IPV6}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritIp6, "IP6%!SPACE!");
|
||||
// otLogCritIp6{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_IPV6}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnIp6, "[%p]IP6%!SPACE!", &CTX);
|
||||
// otLogWarnIp6{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_IPV6}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnIp6, "IP6%!SPACE!");
|
||||
// otLogWarnIp6{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_IPV6}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteIp6, "[%p]IP6%!SPACE!", &CTX);
|
||||
// otLogNoteIp6{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_IPV6}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteIp6, "IP6%!SPACE!");
|
||||
// otLogNoteIp6{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_IPV6}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoIp6, "[%p]IP6%!SPACE!", &CTX);
|
||||
// otLogInfoIp6{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_IPV6}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoIp6, "IP6%!SPACE!");
|
||||
// otLogInfoIp6{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_IPV6}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgIp6, "[%p]IP6%!SPACE!", &CTX);
|
||||
// otLogDebgIp6{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_IPV6}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgIp6, "IP6%!SPACE!");
|
||||
// otLogDebgIp6{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_IPV6}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==MAC==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogCritMac{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritMac, "MAC%!SPACE!");
|
||||
// otLogCritMac{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogWarnMac{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMac, "MAC%!SPACE!");
|
||||
// otLogWarnMac{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogNoteMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteMac, "MAC%!SPACE!");
|
||||
// otLogNoteMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogInfoMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoMac, "MAC%!SPACE!");
|
||||
// otLogInfoMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogDebgMac{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMac, "MAC%!SPACE!");
|
||||
// otLogDebgMac{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMacErr, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogDebgMacErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMacErr, "MAC%!SPACE!");
|
||||
// otLogDebgMacErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogDebgMacErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogMac, "[%p]MAC%!SPACE!", &CTX);
|
||||
// otLogMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogMac, "MAC%!SPACE!");
|
||||
// otLogMac{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(EXP, MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==CORE==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritCore, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogCritCore{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritCore, "CORE%!SPACE!");
|
||||
// otLogCritCore{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnCore, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogWarnCore{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnCore, "CORE%!SPACE!");
|
||||
// otLogWarnCore{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteCore, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogNoteCore{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteCore, "CORE%!SPACE!");
|
||||
// otLogNoteCore{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoCore, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogInfoCore{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoCore, "CORE%!SPACE!");
|
||||
// otLogInfoCore{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgCore, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogDebgCore{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgCore, "CORE%!SPACE!");
|
||||
// otLogDebgCore{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgCoreErr, "[%p]CORE%!SPACE!", &CTX);
|
||||
// otLogDebgCoreErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogDebgCoreErr, "CORE%!SPACE!");
|
||||
// otLogDebgCoreErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogDebgCoreErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
// ==UTIL==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritUtil, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogCritUtil{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritUtil, "UTIL%!SPACE!");
|
||||
// otLogCritUtil{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnUtil, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogWarnUtil{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnUtil, "UTIL%!SPACE!");
|
||||
// otLogWarnUtil{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteUtil, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogNoteUtil{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteUtil, "UTIL%!SPACE!");
|
||||
// otLogNoteUtil{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoUtil, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogInfoUtil{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoUtil, "UTIL%!SPACE!");
|
||||
// otLogInfoUtil{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgUtil, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogDebgUtil{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgUtil, "UTIL%!SPACE!");
|
||||
// otLogDebgUtil{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgUtilErr, "[%p]UTIL%!SPACE!", &CTX);
|
||||
// otLogDebgUtilErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogDebgUtilErr, "UTIL%!SPACE!");
|
||||
// otLogDebgUtilErr{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MAC}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogDebgUtilErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
@@ -517,28 +517,28 @@
|
||||
// ==MEM==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritMem, "[%p]MEM%!SPACE!", &CTX);
|
||||
// otLogCritMem{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MEM}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritMem, "MEM%!SPACE!");
|
||||
// otLogCritMem{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_MEM}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnMem, "[%p]MEM%!SPACE!", &CTX);
|
||||
// otLogWarnMem{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MEM}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnMem, "MEM%!SPACE!");
|
||||
// otLogWarnMem{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_MEM}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteMem, "[%p]MEM%!SPACE!", &CTX);
|
||||
// otLogNoteMem{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MEM}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteMem, "MEM%!SPACE!");
|
||||
// otLogNoteMem{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MEM}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoMem, "[%p]MEM%!SPACE!", &CTX);
|
||||
// otLogInfoMem{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MEM}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoMem, "MEM%!SPACE!");
|
||||
// otLogInfoMem{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_MEM}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgMem, "[%p]MEM%!SPACE!", &CTX);
|
||||
// otLogDebgMem{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MEM}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgMem, "MEM%!SPACE!");
|
||||
// otLogDebgMem{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_MEM}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==DUMP==
|
||||
@@ -550,94 +550,94 @@
|
||||
// ==MEM==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritNetDiag, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogCritNetDiag{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NDIAG}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritNetDiag, "NETD%!SPACE!");
|
||||
// otLogCritNetDiag{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_NDIAG}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnNetDiag, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogWarnNetDiag{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NDIAG}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnNetDiag, "NETD%!SPACE!");
|
||||
// otLogWarnNetDiag{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_NDIAG}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteNetDiag, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogNoteNetDiag{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NDIAG}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteNetDiag, "NETD%!SPACE!");
|
||||
// otLogNoteNetDiag{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NDIAG}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoNetDiag, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogInfoNetDiag{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NDIAG}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoNetDiag, "NETD%!SPACE!");
|
||||
// otLogInfoNetDiag{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_NDIAG}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgNetDiag, "[%p]NETD%!SPACE!", &CTX);
|
||||
// otLogDebgNetDiag{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NDIAG}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgNetDiag, "NETD%!SPACE!");
|
||||
// otLogDebgNetDiag{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_NDIAG}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==COAP==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritCoap, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogCritCoap{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritCoap, "COAP%!SPACE!");
|
||||
// otLogCritCoap{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnCoap, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogWarnCoap{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnCoap, "COAP%!SPACE!");
|
||||
// otLogWarnCoap{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteCoap, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogNoteCoap{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteCoap, "COAP%!SPACE!");
|
||||
// otLogNoteCoap{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoCoap, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogInfoCoap{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoCoap, "COAP%!SPACE!");
|
||||
// otLogInfoCoap{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoCoapErr, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogInfoCoapErr{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogInfoCoapErr, "COAP%!SPACE!");
|
||||
// otLogInfoCoapErr{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogInfoCoapErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgCoap, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogDebgCoap{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgCoap, "COAP%!SPACE!");
|
||||
// otLogDebgCoap{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==CLI==
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogCritCli, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogCritCli{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogCritCli, "COAP%!SPACE!");
|
||||
// otLogCritCli{LEVEL=TRACE_LEVEL_ERROR,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogWarnCli, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogWarnCli{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogWarnCli, "COAP%!SPACE!");
|
||||
// otLogWarnCli{LEVEL=TRACE_LEVEL_WARNING,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogNoteCli, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogNoteCli{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogNoteCli, "COAP%!SPACE!");
|
||||
// otLogNoteCli{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoCli, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogInfoCli{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogInfoCli, "COAP%!SPACE!");
|
||||
// otLogInfoCli{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogInfoCliErr, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogInfoCliErr{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(CTX, EXP, MSG, ...);
|
||||
// USEPREFIX (otLogInfoCliErr, "COAP%!SPACE!");
|
||||
// otLogInfoCliErr{LEVEL=TRACE_LEVEL_INFORMATION,FLAGS=OT_COAP}(EXP, MSG, ...);
|
||||
// USESUFFIX(otLogInfoCliErr, ", %!otError!", EXP);
|
||||
// end_wpp
|
||||
|
||||
// begin_wpp config
|
||||
// USEPREFIX (otLogDebgCli, "[%p]COAP%!SPACE!", &CTX);
|
||||
// otLogDebgCli{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_COAP}(CTX, MSG, ...);
|
||||
// USEPREFIX (otLogDebgCli, "COAP%!SPACE!");
|
||||
// otLogDebgCli{LEVEL=TRACE_LEVEL_VERBOSE,FLAGS=OT_COAP}(MSG, ...);
|
||||
// end_wpp
|
||||
|
||||
// ==FUNC==
|
||||
|
||||
@@ -200,7 +200,7 @@ otError Uart::ProcessCommand(void)
|
||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||
/* TODO: how exactly do we get the instance here? */
|
||||
#else
|
||||
otLogInfoCli(Instance::Get(), "execute command: %s", mRxBuffer);
|
||||
otLogInfoCli("execute command: %s", mRxBuffer);
|
||||
#endif
|
||||
#endif
|
||||
mInterpreter.ProcessLine(mRxBuffer, mRxLength, *this);
|
||||
|
||||
@@ -121,6 +121,7 @@ SOURCES_COMMON = \
|
||||
api/joiner_api.cpp \
|
||||
api/link_api.cpp \
|
||||
api/link_raw_api.cpp \
|
||||
api/logging_api.cpp \
|
||||
api/message_api.cpp \
|
||||
api/netdata_api.cpp \
|
||||
api/network_time_api.cpp \
|
||||
@@ -226,6 +227,7 @@ EXTRA_DIST = \
|
||||
libopenthread_radio_a_SOURCES = \
|
||||
api/instance_api.cpp \
|
||||
api/link_raw_api.cpp \
|
||||
api/logging_api.cpp \
|
||||
api/message_api.cpp \
|
||||
api/tasklet_api.cpp \
|
||||
common/instance.cpp \
|
||||
|
||||
@@ -51,7 +51,7 @@ otInstance *otInstanceInit(void *aInstanceBuffer, size_t *aInstanceBufferSize)
|
||||
Instance *instance;
|
||||
|
||||
instance = Instance::Init(aInstanceBuffer, aInstanceBufferSize);
|
||||
otLogInfoApi(*instance, "otInstance Initialized");
|
||||
otLogInfoApi("otInstance Initialized");
|
||||
|
||||
return instance;
|
||||
}
|
||||
@@ -117,39 +117,6 @@ otError otInstanceErasePersistentInfo(otInstance *aInstance)
|
||||
}
|
||||
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
|
||||
otLogLevel otGetDynamicLogLevel(otInstance *aInstance)
|
||||
{
|
||||
otLogLevel logLevel;
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
|
||||
logLevel = instance.GetDynamicLogLevel();
|
||||
#else
|
||||
logLevel = static_cast<otLogLevel>(OPENTHREAD_CONFIG_LOG_LEVEL);
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
#endif
|
||||
|
||||
return logLevel;
|
||||
}
|
||||
|
||||
otError otSetDynamicLogLevel(otInstance *aInstance, otLogLevel aLogLevel)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
|
||||
instance.SetDynamicLogLevel(aLogLevel);
|
||||
#else
|
||||
error = OT_ERROR_DISABLED_FEATURE;
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
#endif
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
const char *otGetVersionString(void)
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -75,7 +75,7 @@ otError otLinkRawSetPromiscuous(otInstance *aInstance, bool aEnable)
|
||||
|
||||
VerifyOrExit(static_cast<Instance *>(aInstance)->GetLinkRaw().IsEnabled(), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogInfoPlat(aInstance, "LinkRaw Promiscuous=%d", aEnable ? 1 : 0);
|
||||
otLogInfoPlat("LinkRaw Promiscuous=%d", aEnable ? 1 : 0);
|
||||
|
||||
otPlatRadioSetPromiscuous(aInstance, aEnable);
|
||||
|
||||
@@ -89,7 +89,7 @@ otError otLinkRawSleep(otInstance *aInstance)
|
||||
|
||||
VerifyOrExit(static_cast<Instance *>(aInstance)->GetLinkRaw().IsEnabled(), error = OT_ERROR_INVALID_STATE);
|
||||
|
||||
otLogInfoPlat(aInstance, "LinkRaw Sleep");
|
||||
otLogInfoPlat("LinkRaw Sleep");
|
||||
|
||||
error = otPlatRadioSleep(aInstance);
|
||||
|
||||
@@ -99,7 +99,7 @@ exit:
|
||||
|
||||
otError otLinkRawReceive(otInstance *aInstance, otLinkRawReceiveDone aCallback)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "LinkRaw Recv");
|
||||
otLogInfoPlat("LinkRaw Recv");
|
||||
return static_cast<Instance *>(aInstance)->GetLinkRaw().Receive(aCallback);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ exit:
|
||||
|
||||
otError otLinkRawTransmit(otInstance *aInstance, otRadioFrame *aFrame, otLinkRawTransmitDone aCallback)
|
||||
{
|
||||
otLogInfoPlat(aInstance, "LinkRaw Transmit (%d bytes on channel %d)", aFrame->mLength, aFrame->mChannel);
|
||||
otLogInfoPlat("LinkRaw Transmit (%d bytes on channel %d)", aFrame->mLength, aFrame->mChannel);
|
||||
return static_cast<Instance *>(aInstance)->GetLinkRaw().Transmit(aFrame, aCallback);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright (c) 2018, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file implements the OpenThread logging related APIs.
|
||||
*/
|
||||
|
||||
#define WPP_NAME "logging_api.tmh"
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#include <openthread/logging.h>
|
||||
#include "common/instance.hpp"
|
||||
|
||||
using namespace ot;
|
||||
|
||||
otLogLevel otLoggingGetLevel(void)
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL && !OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||
{
|
||||
return Instance::Get().GetLogLevel();
|
||||
}
|
||||
#else
|
||||
{
|
||||
return static_cast<otLogLevel>(OPENTHREAD_CONFIG_LOG_LEVEL);
|
||||
}
|
||||
#endif
|
||||
|
||||
otError otLoggingSetLevel(otLogLevel aLogLevel)
|
||||
{
|
||||
otError error = OT_ERROR_DISABLED_FEATURE;
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
#if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES
|
||||
#warning "Dynamic log level is not supported along with multiple OT instance feature (`ENABLE_MULTIPLE_INSTANCES`)"
|
||||
#else
|
||||
Instance::Get().SetLogLevel(aLogLevel);
|
||||
error = OT_ERROR_NONE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogLevel);
|
||||
return error;
|
||||
}
|
||||
@@ -550,7 +550,7 @@ exit:
|
||||
|
||||
if (error)
|
||||
{
|
||||
otLogInfoCoapErr(GetNetif().GetInstance(), error, "Receive failed");
|
||||
otLogInfoCoapErr(error, "Receive failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,7 +709,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoCoapErr(GetNetif().GetInstance(), error, "Failed to process request");
|
||||
otLogInfoCoapErr(error, "Failed to process request");
|
||||
|
||||
if (error == OT_ERROR_NOT_FOUND)
|
||||
{
|
||||
|
||||
@@ -180,24 +180,6 @@ public:
|
||||
*/
|
||||
TaskletScheduler &GetTaskletScheduler(void) { return mTaskletScheduler; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
/**
|
||||
* This method returns the current dynamic log level.
|
||||
*
|
||||
* @returns the currently set dynamic log level.
|
||||
*
|
||||
*/
|
||||
otLogLevel GetDynamicLogLevel(void) const { return mLogLevel; }
|
||||
|
||||
/**
|
||||
* This method sets the dynamic log level.
|
||||
*
|
||||
* @param[in] aLogLevel The dynamic log level.
|
||||
*
|
||||
*/
|
||||
void SetDynamicLogLevel(otLogLevel aLogLevel) { mLogLevel = aLogLevel; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This method returns the active log level.
|
||||
*
|
||||
@@ -207,7 +189,7 @@ public:
|
||||
otLogLevel GetLogLevel(void) const
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
{
|
||||
return GetDynamicLogLevel();
|
||||
return mLogLevel;
|
||||
}
|
||||
#else
|
||||
{
|
||||
@@ -215,6 +197,16 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
/**
|
||||
* This method sets the log level.
|
||||
*
|
||||
* @param[in] aLogLevel A log level.
|
||||
*
|
||||
*/
|
||||
void SetLogLevel(otLogLevel aLogLevel) { mLogLevel = aLogLevel; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This method finalizes the OpenThread instance.
|
||||
*
|
||||
@@ -470,6 +462,7 @@ private:
|
||||
#if OPENTHREAD_RADIO || OPENTHREAD_ENABLE_RAW_LINK_API
|
||||
LinkRaw mLinkRaw;
|
||||
#endif // OPENTHREAD_RADIO || OPENTHREAD_ENABLE_RAW_LINK_API
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_DYNAMIC_LOG_LEVEL
|
||||
otLogLevel mLogLevel;
|
||||
#endif
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
#ifndef WINDOWS_LOGGING
|
||||
#define otLogDump(aFormat, ...) \
|
||||
_otDynamicLog(aInstance, aLogLevel, aLogRegion, aFormat OPENTHREAD_CONFIG_LOG_SUFFIX, ##__VA_ARGS__)
|
||||
_otDynamicLog(aLogLevel, aLogRegion, aFormat OPENTHREAD_CONFIG_LOG_SUFFIX, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -65,11 +65,7 @@ extern "C" {
|
||||
* @param[in] aLength Number of bytes in the buffer.
|
||||
*
|
||||
*/
|
||||
static void DumpLine(otInstance * aInstance,
|
||||
otLogLevel aLogLevel,
|
||||
otLogRegion aLogRegion,
|
||||
const void * aBuf,
|
||||
const size_t aLength)
|
||||
static void DumpLine(otLogLevel aLogLevel, otLogRegion aLogRegion, const void *aBuf, const size_t aLength)
|
||||
{
|
||||
char buf[80];
|
||||
char *cur = buf;
|
||||
@@ -117,16 +113,9 @@ static void DumpLine(otInstance * aInstance,
|
||||
}
|
||||
|
||||
otLogDump("%s", buf);
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
void otDump(otInstance * aInstance,
|
||||
otLogLevel aLogLevel,
|
||||
otLogRegion aLogRegion,
|
||||
const char * aId,
|
||||
const void * aBuf,
|
||||
const size_t aLength)
|
||||
void otDump(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aId, const void *aBuf, const size_t aLength)
|
||||
{
|
||||
size_t idlen = strlen(aId);
|
||||
const size_t width = 72;
|
||||
@@ -152,7 +141,7 @@ void otDump(otInstance * aInstance,
|
||||
|
||||
for (size_t i = 0; i < aLength; i += 16)
|
||||
{
|
||||
DumpLine(aInstance, aLogLevel, aLogRegion, (uint8_t *)(aBuf) + i, (aLength - i) < 16 ? (aLength - i) : 16);
|
||||
DumpLine(aLogLevel, aLogRegion, (uint8_t *)(aBuf) + i, (aLength - i) < 16 ? (aLength - i) : 16);
|
||||
}
|
||||
|
||||
cur = buf;
|
||||
@@ -166,7 +155,7 @@ void otDump(otInstance * aInstance,
|
||||
otLogDump("%s", buf);
|
||||
}
|
||||
#else // OPENTHREAD_CONFIG_LOG_PKT_DUMP
|
||||
void otDump(otInstance *, otLogLevel, otLogRegion, const char *, const void *, const size_t)
|
||||
void otDump(otLogLevel, otLogRegion, const char *, const void *, const size_t)
|
||||
{
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_LOG_PKT_DUMP
|
||||
|
||||
+318
-523
File diff suppressed because it is too large
Load Diff
@@ -124,7 +124,7 @@ Buffer *MessagePool::NewBuffer(uint8_t aPriority)
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
otLogInfoMem(GetInstance(), "No available message buffer");
|
||||
otLogInfoMem("No available message buffer");
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -223,7 +223,7 @@ void Notifier::LogChangedFlags(otChangedFlags aFlags) const
|
||||
}
|
||||
|
||||
exit:
|
||||
otLogInfoCore(GetInstance(), "Notifier: StateChanged (0x%04x) [%s] ", aFlags, string.AsCString());
|
||||
otLogInfoCore("Notifier: StateChanged (0x%04x) [%s] ", aFlags, string.AsCString());
|
||||
}
|
||||
|
||||
const char *Notifier::FlagToString(otChangedFlags aFlag) const
|
||||
|
||||
@@ -50,14 +50,12 @@ namespace ot {
|
||||
|
||||
void SettingsBase::LogNetworkInfo(const char *aAction, const NetworkInfo &aNetworkInfo) const
|
||||
{
|
||||
otLogInfoCore(GetInstance(),
|
||||
"Non-volatile: %s NetworkInfo {rloc:0x%04x, extaddr:%s, role:%s, mode:0x%02x, keyseq:0x%x, ...",
|
||||
otLogInfoCore("Non-volatile: %s NetworkInfo {rloc:0x%04x, extaddr:%s, role:%s, mode:0x%02x, keyseq:0x%x, ...",
|
||||
aAction, aNetworkInfo.mRloc16, aNetworkInfo.mExtAddress.ToString().AsCString(),
|
||||
Mle::Mle::RoleToString(static_cast<otDeviceRole>(aNetworkInfo.mRole)), aNetworkInfo.mDeviceMode,
|
||||
aNetworkInfo.mKeySequence);
|
||||
|
||||
otLogInfoCore(GetInstance(),
|
||||
"Non-volatile: ... pid:0x%x, mlecntr:0x%x, maccntr:0x%x, mliid:%02x%02x%02x%02x%02x%02x%02x%02x}",
|
||||
otLogInfoCore("Non-volatile: ... pid:0x%x, mlecntr:0x%x, maccntr:0x%x, mliid:%02x%02x%02x%02x%02x%02x%02x%02x}",
|
||||
aNetworkInfo.mPreviousPartitionId, aNetworkInfo.mMleFrameCounter, aNetworkInfo.mMacFrameCounter,
|
||||
aNetworkInfo.mMlIid[0], aNetworkInfo.mMlIid[1], aNetworkInfo.mMlIid[2], aNetworkInfo.mMlIid[3],
|
||||
aNetworkInfo.mMlIid[4], aNetworkInfo.mMlIid[5], aNetworkInfo.mMlIid[6], aNetworkInfo.mMlIid[7]);
|
||||
@@ -65,14 +63,13 @@ void SettingsBase::LogNetworkInfo(const char *aAction, const NetworkInfo &aNetwo
|
||||
|
||||
void SettingsBase::LogParentInfo(const char *aAction, const ParentInfo &aParentInfo) const
|
||||
{
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: %s ParentInfo {extaddr:%s}", aAction,
|
||||
aParentInfo.mExtAddress.ToString().AsCString());
|
||||
otLogInfoCore("Non-volatile: %s ParentInfo {extaddr:%s}", aAction, aParentInfo.mExtAddress.ToString().AsCString());
|
||||
}
|
||||
|
||||
void SettingsBase::LogChildInfo(const char *aAction, const ChildInfo &aChildInfo) const
|
||||
{
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: %s ChildInfo {rloc:0x%04x, extaddr:%s, timeout:%u, mode:0x%02x}",
|
||||
aAction, aChildInfo.mRloc16, aChildInfo.mExtAddress.ToString().AsCString(), aChildInfo.mTimeout,
|
||||
otLogInfoCore("Non-volatile: %s ChildInfo {rloc:0x%04x, extaddr:%s, timeout:%u, mode:0x%02x}", aAction,
|
||||
aChildInfo.mRloc16, aChildInfo.mExtAddress.ToString().AsCString(), aChildInfo.mTimeout,
|
||||
aChildInfo.mMode);
|
||||
}
|
||||
|
||||
@@ -84,7 +81,7 @@ void SettingsBase::LogFailure(otError error, const char *aText, bool aIsDelete)
|
||||
{
|
||||
if ((error != OT_ERROR_NONE) && (!aIsDelete || (error != OT_ERROR_NOT_FOUND)))
|
||||
{
|
||||
otLogWarnCore(GetInstance(), "Non-volatile: Error %s %s", otThreadErrorToString(error), aText);
|
||||
otLogWarnCore("Non-volatile: Error %s %s", otThreadErrorToString(error), aText);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +96,7 @@ void Settings::Init(void)
|
||||
void Settings::Wipe(void)
|
||||
{
|
||||
otPlatSettingsWipe(&GetInstance());
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: Wiped all info");
|
||||
otLogInfoCore("Non-volatile: Wiped all info");
|
||||
}
|
||||
|
||||
otError Settings::SaveOperationalDataset(bool aIsActive, const MeshCoP::Dataset &aDataset)
|
||||
@@ -160,7 +157,7 @@ otError Settings::DeleteNetworkInfo(void)
|
||||
otError error;
|
||||
|
||||
SuccessOrExit(error = Delete(kKeyNetworkInfo));
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: Deleted NetworkInfo");
|
||||
otLogInfoCore("Non-volatile: Deleted NetworkInfo");
|
||||
|
||||
exit:
|
||||
LogFailure(error, "deleting NetworkInfo", true);
|
||||
@@ -195,7 +192,7 @@ otError Settings::DeleteParentInfo(void)
|
||||
otError error;
|
||||
|
||||
SuccessOrExit(error = Delete(kKeyParentInfo));
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: Deleted ParentInfo");
|
||||
otLogInfoCore("Non-volatile: Deleted ParentInfo");
|
||||
|
||||
exit:
|
||||
LogFailure(error, "deleting ParentInfo", true);
|
||||
@@ -219,7 +216,7 @@ otError Settings::DeleteChildInfo(void)
|
||||
otError error;
|
||||
|
||||
SuccessOrExit(error = Delete(kKeyChildInfo));
|
||||
otLogInfoCore(GetInstance(), "Non-volatile: Deleted all ChildInfo");
|
||||
otLogInfoCore("Non-volatile: Deleted all ChildInfo");
|
||||
|
||||
exit:
|
||||
LogFailure(error, "deleting all ChildInfo", true);
|
||||
|
||||
@@ -77,7 +77,7 @@ otError LinkRaw::SetEnabled(bool aEnabled)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
|
||||
otLogInfoPlat(&mInstance, "LinkRaw Enabled=%d", aEnabled ? 1 : 0);
|
||||
otLogInfoPlat("LinkRaw Enabled=%d", aEnabled ? 1 : 0);
|
||||
|
||||
#if OPENTHREAD_MTD || OPENTHREAD_FTD
|
||||
VerifyOrExit(!static_cast<Instance &>(mInstance).GetThreadNetif().IsUp(), error = OT_ERROR_INVALID_STATE);
|
||||
@@ -214,12 +214,12 @@ void LinkRaw::InvokeReceiveDone(otRadioFrame *aFrame, otError aError)
|
||||
{
|
||||
if (aError == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoPlat(&mInstance, "LinkRaw Invoke Receive Done (%d bytes)", aFrame->mLength);
|
||||
otLogInfoPlat("LinkRaw Invoke Receive Done (%d bytes)", aFrame->mLength);
|
||||
mReceiveDoneCallback(&mInstance, aFrame, aError);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnPlat(&mInstance, "LinkRaw Invoke Receive Done (err=0x%x)", aError);
|
||||
otLogWarnPlat("LinkRaw Invoke Receive Done (err=0x%x)", aError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ otError LinkRaw::Transmit(otRadioFrame *aFrame, otLinkRawTransmitDone aCallback)
|
||||
|
||||
void LinkRaw::InvokeTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError)
|
||||
{
|
||||
otLogDebgPlat(&mInstance, "LinkRaw Transmit Done (err=0x%x)", aError);
|
||||
otLogDebgPlat("LinkRaw Transmit Done (err=0x%x)", aError);
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_SOFTWARE_ACK_TIMEOUT
|
||||
mTimer.Stop();
|
||||
@@ -320,11 +320,11 @@ void LinkRaw::InvokeTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame,
|
||||
{
|
||||
if (aError == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoPlat(&mInstance, "LinkRaw Invoke Transmit Done");
|
||||
otLogInfoPlat("LinkRaw Invoke Transmit Done");
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnPlat(&mInstance, "LinkRaw Invoke Transmit Failed (err=0x%x)", aError);
|
||||
otLogWarnPlat("LinkRaw Invoke Transmit Failed (err=0x%x)", aError);
|
||||
}
|
||||
|
||||
mTransmitDoneCallback(&mInstance, aFrame, aAckFrame, aError);
|
||||
@@ -390,7 +390,7 @@ void LinkRaw::TransmitStarted(otRadioFrame *aFrame)
|
||||
if (static_cast<Mac::Frame *>(aFrame)->GetAckRequest() &&
|
||||
!(otPlatRadioGetCaps(&mInstance) & OT_RADIO_CAPS_ACK_TIMEOUT))
|
||||
{
|
||||
otLogDebgPlat(&mInstance, "LinkRaw Starting AckTimeout Timer");
|
||||
otLogDebgPlat("LinkRaw Starting AckTimeout Timer");
|
||||
mTimerReason = kTimerReasonAckTimeout;
|
||||
mTimer.Start(Mac::kAckTimeout);
|
||||
}
|
||||
@@ -492,7 +492,7 @@ void LinkRaw::StartCsmaBackoff(void)
|
||||
backoff = Random::GetUint32InRange(0, 1U << backoffExponent);
|
||||
backoff *= (static_cast<uint32_t>(Mac::kUnitBackoffPeriod) * OT_RADIO_SYMBOL_TIME);
|
||||
|
||||
otLogDebgPlat(&mInstance, "LinkRaw Starting RetransmitTimeout Timer (%d ms)", backoff);
|
||||
otLogDebgPlat("LinkRaw Starting RetransmitTimeout Timer (%d ms)", backoff);
|
||||
mTimerReason = kTimerReasonCsmaBackoffComplete;
|
||||
|
||||
#if OPENTHREAD_CONFIG_ENABLE_PLATFORM_USEC_TIMER
|
||||
|
||||
+25
-25
@@ -697,7 +697,7 @@ void Mac::UpdateIdleMode(void)
|
||||
{
|
||||
if (RadioSleep() != OT_ERROR_INVALID_STATE)
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Idle mode: Radio sleeping");
|
||||
otLogDebgMac("Idle mode: Radio sleeping");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -706,7 +706,7 @@ void Mac::UpdateIdleMode(void)
|
||||
// the radio in receive mode.
|
||||
}
|
||||
|
||||
otLogDebgMac(GetInstance(), "Idle mode: Radio receiving on channel %d", mRadioChannel);
|
||||
otLogDebgMac("Idle mode: Radio receiving on channel %d", mRadioChannel);
|
||||
RadioReceive(mRadioChannel);
|
||||
|
||||
exit:
|
||||
@@ -717,7 +717,7 @@ void Mac::StartOperation(Operation aOperation)
|
||||
{
|
||||
if (aOperation != kOperationIdle)
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Request to start operation \"%s\"", OperationToString(aOperation));
|
||||
otLogDebgMac("Request to start operation \"%s\"", OperationToString(aOperation));
|
||||
}
|
||||
|
||||
switch (aOperation)
|
||||
@@ -843,7 +843,7 @@ void Mac::PerformOperation(void)
|
||||
|
||||
if (mOperation != kOperationIdle)
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Starting operation \"%s\"", OperationToString(mOperation));
|
||||
otLogDebgMac("Starting operation \"%s\"", OperationToString(mOperation));
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -854,7 +854,7 @@ void Mac::FinishOperation(void)
|
||||
{
|
||||
// Clear the current operation and start any pending ones.
|
||||
|
||||
otLogDebgMac(GetInstance(), "Finishing operation \"%s\"", OperationToString(mOperation));
|
||||
otLogDebgMac("Finishing operation \"%s\"", OperationToString(mOperation));
|
||||
|
||||
mOperation = kOperationIdle;
|
||||
|
||||
@@ -895,7 +895,7 @@ void Mac::SendBeaconRequest(Frame &aFrame)
|
||||
aFrame.SetDstPanId(kShortAddrBroadcast);
|
||||
aFrame.SetDstAddr(kShortAddrBroadcast);
|
||||
aFrame.SetCommandId(Frame::kMacCmdBeaconRequest);
|
||||
otLogInfoMac(GetInstance(), "Sending Beacon Request");
|
||||
otLogInfoMac("Sending Beacon Request");
|
||||
}
|
||||
|
||||
void Mac::SendBeacon(Frame &aFrame)
|
||||
@@ -1289,7 +1289,7 @@ void Mac::HandleTransmitStarted(otRadioFrame *aFrame)
|
||||
if (frame->GetAckRequest() && !(otPlatRadioGetCaps(&GetInstance()) & OT_RADIO_CAPS_ACK_TIMEOUT))
|
||||
{
|
||||
mMacTimer.Start(kAckTimeout);
|
||||
otLogDebgMac(GetInstance(), "Ack timer start");
|
||||
otLogDebgMac("Ack timer start");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1417,7 +1417,7 @@ void Mac::HandleTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame, otEr
|
||||
{
|
||||
LogFrameTxFailure(sendFrame, aError);
|
||||
|
||||
otDumpDebgMac(GetInstance(), "TX ERR", sendFrame.GetHeader(), 16);
|
||||
otDumpDebgMac("TX ERR", sendFrame.GetHeader(), 16);
|
||||
|
||||
if (mEnabled && !RadioSupportsRetries() && mTransmitRetries < sendFrame.GetMaxFrameRetries())
|
||||
{
|
||||
@@ -1534,7 +1534,7 @@ void Mac::HandleTransmitDone(otRadioFrame *aFrame, otRadioFrame *aAckFrame, otEr
|
||||
mDataSequence++;
|
||||
}
|
||||
|
||||
otDumpDebgMac(GetInstance(), "TX", sendFrame.GetHeader(), sendFrame.GetLength());
|
||||
otDumpDebgMac("TX", sendFrame.GetHeader(), sendFrame.GetLength());
|
||||
sender->HandleSentFrame(sendFrame, aError);
|
||||
FinishOperation();
|
||||
break;
|
||||
@@ -1577,7 +1577,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMac(GetInstance(), "otPlatRadioTransmit() failed with error %s", otThreadErrorToString(error));
|
||||
otLogWarnMac("otPlatRadioTransmit() failed with error %s", otThreadErrorToString(error));
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -1603,7 +1603,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMac(GetInstance(), "otPlatRadioReceive() failed with error %s", otThreadErrorToString(error));
|
||||
otLogWarnMac("otPlatRadioReceive() failed with error %s", otThreadErrorToString(error));
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -1617,7 +1617,7 @@ otError Mac::RadioSleep(void)
|
||||
|
||||
if (mDelaySleep)
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Delaying sleep waiting for frame rx/tx");
|
||||
otLogDebgMac("Delaying sleep waiting for frame rx/tx");
|
||||
|
||||
mReceiveTimer.Start(kSleepDelay);
|
||||
mDelaySleep = false;
|
||||
@@ -1634,7 +1634,7 @@ otError Mac::RadioSleep(void)
|
||||
error = otPlatRadioSleep(&GetInstance());
|
||||
VerifyOrExit(error != OT_ERROR_NONE);
|
||||
|
||||
otLogWarnMac(GetInstance(), "otPlatRadioSleep() failed with error %s", otThreadErrorToString(error));
|
||||
otLogWarnMac("otPlatRadioSleep() failed with error %s", otThreadErrorToString(error));
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -1659,7 +1659,7 @@ void Mac::HandleMacTimer(void)
|
||||
break;
|
||||
|
||||
case kOperationTransmitData:
|
||||
otLogDebgMac(GetInstance(), "Ack timer fired");
|
||||
otLogDebgMac("Ack timer fired");
|
||||
RadioReceive(mTxFrame->mChannel);
|
||||
HandleTransmitDone(mTxFrame, NULL, OT_ERROR_NO_ACK);
|
||||
break;
|
||||
@@ -1685,7 +1685,7 @@ void Mac::HandleReceiveTimer(void)
|
||||
|
||||
if (mOperation == kOperationWaitingForData)
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Data poll timeout");
|
||||
otLogDebgMac("Data poll timeout");
|
||||
|
||||
FinishOperation();
|
||||
|
||||
@@ -1696,7 +1696,7 @@ void Mac::HandleReceiveTimer(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "Sleep delay timeout expired");
|
||||
otLogDebgMac("Sleep delay timeout expired");
|
||||
|
||||
UpdateIdleMode();
|
||||
}
|
||||
@@ -1725,7 +1725,7 @@ otError Mac::ProcessReceiveSecurity(Frame &aFrame, const Address &aSrcAddr, Neig
|
||||
|
||||
aFrame.GetSecurityLevel(securityLevel);
|
||||
aFrame.GetFrameCounter(frameCounter);
|
||||
otLogDebgMac(GetInstance(), "Frame counter %u", frameCounter);
|
||||
otLogDebgMac("Frame counter %u", frameCounter);
|
||||
|
||||
aFrame.GetKeyIdMode(keyIdMode);
|
||||
|
||||
@@ -1935,7 +1935,7 @@ void Mac::HandleReceivedFrame(Frame *aFrame, otError aError)
|
||||
break;
|
||||
|
||||
case Address::kTypeShort:
|
||||
otLogDebgMac(GetInstance(), "Received frame from short address 0x%04x", srcaddr.GetShort());
|
||||
otLogDebgMac("Received frame from short address 0x%04x", srcaddr.GetShort());
|
||||
|
||||
if (neighbor == NULL)
|
||||
{
|
||||
@@ -2130,7 +2130,7 @@ void Mac::HandleReceivedFrame(Frame *aFrame, otError aError)
|
||||
|
||||
if (receive)
|
||||
{
|
||||
otDumpDebgMac(GetInstance(), "RX", aFrame->GetHeader(), aFrame->GetLength());
|
||||
otDumpDebgMac("RX", aFrame->GetHeader(), aFrame->GetLength());
|
||||
|
||||
for (Receiver *receiver = mReceiveHead; receiver; receiver = receiver->mNext)
|
||||
{
|
||||
@@ -2196,7 +2196,7 @@ otError Mac::HandleMacCommand(Frame &aFrame)
|
||||
{
|
||||
case Frame::kMacCmdBeaconRequest:
|
||||
mCounters.mRxBeaconRequest++;
|
||||
otLogInfoMac(GetInstance(), "Received Beacon Request");
|
||||
otLogInfoMac("Received Beacon Request");
|
||||
|
||||
if (mEnabled && (mBeaconsEnabled
|
||||
#if OPENTHREAD_CONFIG_ENABLE_BEACON_RSP_WHEN_JOINABLE
|
||||
@@ -2354,24 +2354,24 @@ void Mac::LogFrameRxFailure(const Frame *aFrame, otError aError) const
|
||||
{
|
||||
if (aFrame == NULL)
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "Frame rx failed, error:%s", otThreadErrorToString(aError));
|
||||
otLogInfoMac("Frame rx failed, error:%s", otThreadErrorToString(aError));
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "Frame rx failed, error:%s, %s", otThreadErrorToString(aError),
|
||||
otLogInfoMac("Frame rx failed, error:%s, %s", otThreadErrorToString(aError),
|
||||
aFrame->ToInfoString().AsCString());
|
||||
}
|
||||
}
|
||||
|
||||
void Mac::LogFrameTxFailure(const Frame &aFrame, otError aError) const
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "Frame tx failed, error:%s, retries:%d/%d, %s", otThreadErrorToString(aError),
|
||||
mTransmitRetries, aFrame.GetMaxFrameRetries(), aFrame.ToInfoString().AsCString());
|
||||
otLogInfoMac("Frame tx failed, error:%s, retries:%d/%d, %s", otThreadErrorToString(aError), mTransmitRetries,
|
||||
aFrame.GetMaxFrameRetries(), aFrame.ToInfoString().AsCString());
|
||||
}
|
||||
|
||||
void Mac::LogBeacon(const char *aActionText, const BeaconPayload &aBeaconPayload) const
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "%s Beacon, %s", aActionText, aBeaconPayload.ToInfoString().AsCString());
|
||||
otLogInfoMac("%s Beacon, %s", aActionText, aBeaconPayload.ToInfoString().AsCString());
|
||||
}
|
||||
|
||||
#else // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
|
||||
|
||||
@@ -104,7 +104,7 @@ otError AnnounceBeginClient::SendRequest(uint32_t aChannelMask,
|
||||
|
||||
SuccessOrExit(error = GetNetif().GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent announce begin query");
|
||||
otLogInfoMeshCoP("sent announce begin query");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ exit:
|
||||
message->Free();
|
||||
}
|
||||
|
||||
otLogWarnMeshCoP(GetInstance(), "Failed to send CoAP message: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Failed to send CoAP message: %s", otThreadErrorToString(error));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void BorderAgent::HandleCoapResponse(void * aContext,
|
||||
exit:
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Commissioner request[%hu] failed: %s", forwardContext.GetMessageId(),
|
||||
otLogWarnMeshCoP("Commissioner request[%hu] failed: %s", forwardContext.GetMessageId(),
|
||||
otThreadErrorToString(aResult));
|
||||
forwardContext.ToHeader(header, CoapCodeFromError(error));
|
||||
borderAgent.SendErrorMessage(header);
|
||||
@@ -350,12 +350,12 @@ void BorderAgent::HandleProxyTransmit(const Coap::Header &aHeader, const Message
|
||||
}
|
||||
|
||||
SuccessOrExit(error = GetInstance().GetIp6().GetUdp().SendDatagram(*message, messageInfo, Ip6::kProtoUdp));
|
||||
otLogInfoMeshCoP(GetInstance(), "Proxy transmit sent");
|
||||
otLogInfoMeshCoP("Proxy transmit sent");
|
||||
|
||||
exit:
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Failed to send proxy stream: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Failed to send proxy stream: %s", otThreadErrorToString(error));
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
@@ -408,12 +408,12 @@ bool BorderAgent::HandleProxyReceive(const Message &aMessage, const Ip6::Message
|
||||
|
||||
SuccessOrExit(error = netif.GetCoapSecure().SendMessage(*message, netif.GetCoapSecure().GetPeerMessageInfo()));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent to commissioner on %s", OT_URI_PATH_PROXY_RX);
|
||||
otLogInfoMeshCoP("Sent to commissioner on %s", OT_URI_PATH_PROXY_RX);
|
||||
|
||||
exit:
|
||||
if (message != NULL && error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Failed notify commissioner on %s", OT_URI_PATH_PROXY_RX);
|
||||
otLogWarnMeshCoP("Failed notify commissioner on %s", OT_URI_PATH_PROXY_RX);
|
||||
message->Free();
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ void BorderAgent::HandleRelayReceive(const Coap::Header &aHeader, const Message
|
||||
}
|
||||
|
||||
SuccessOrExit(ForwardToCommissioner(header, aMessage));
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent to commissioner on %s", OT_URI_PATH_RELAY_RX);
|
||||
otLogInfoMeshCoP("Sent to commissioner on %s", OT_URI_PATH_RELAY_RX);
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -456,12 +456,12 @@ otError BorderAgent::ForwardToCommissioner(const Coap::Header &aHeader, const Me
|
||||
|
||||
SuccessOrExit(error = netif.GetCoapSecure().SendMessage(*message, netif.GetCoapSecure().GetPeerMessageInfo()));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent to commissioner");
|
||||
otLogInfoMeshCoP("Sent to commissioner");
|
||||
|
||||
exit:
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Failed to send to commissioner: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Failed to send to commissioner: %s", otThreadErrorToString(error));
|
||||
if (message != NULL)
|
||||
{
|
||||
message->Free();
|
||||
@@ -519,13 +519,12 @@ void BorderAgent::HandleRelayTransmit(const Coap::Header &aHeader, const Message
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(borderAgent->GetInstance(), "Sent to joiner router request on %s", OT_URI_PATH_RELAY_TX);
|
||||
otLogInfoMeshCoP("Sent to joiner router request on %s", OT_URI_PATH_RELAY_TX);
|
||||
|
||||
exit:
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(borderAgent->GetInstance(),
|
||||
"Failed to sent to joiner router request " OT_URI_PATH_RELAY_TX " %s",
|
||||
otLogWarnMeshCoP("Failed to sent to joiner router request " OT_URI_PATH_RELAY_TX " %s",
|
||||
otThreadErrorToString(error));
|
||||
if (message != NULL)
|
||||
{
|
||||
@@ -585,12 +584,12 @@ otError BorderAgent::ForwardToLeader(const Coap::Header & aHeader,
|
||||
// HandleCoapResponse is responsible to free this forward context.
|
||||
forwardContext = NULL;
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Forwarded request to leader on %s", aPath);
|
||||
otLogInfoMeshCoP("Forwarded request to leader on %s", aPath);
|
||||
|
||||
exit:
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Failed to forward to leader: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Failed to forward to leader: %s", otThreadErrorToString(error));
|
||||
|
||||
if (forwardContext != NULL)
|
||||
{
|
||||
@@ -624,7 +623,7 @@ void BorderAgent::HandleConnected(bool aConnected)
|
||||
{
|
||||
if (aConnected)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Commissioner connected");
|
||||
otLogInfoMeshCoP("Commissioner connected");
|
||||
SetState(OT_BORDER_AGENT_STATE_ACTIVE);
|
||||
mTimer.Start(kKeepAliveTimeout);
|
||||
}
|
||||
@@ -633,7 +632,7 @@ void BorderAgent::HandleConnected(bool aConnected)
|
||||
ThreadNetif & netif = GetNetif();
|
||||
Coap::CoapSecure &coaps = netif.GetCoapSecure();
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Commissioner disconnected");
|
||||
otLogInfoMeshCoP("Commissioner disconnected");
|
||||
netif.GetIp6().GetUdp().RemoveReceiver(mProxyReceiver);
|
||||
netif.RemoveUnicastAddress(mCommissionerAloc);
|
||||
coaps.Stop();
|
||||
@@ -700,12 +699,12 @@ void BorderAgent::HandleTimeout(void)
|
||||
if (coaps.IsConnected())
|
||||
{
|
||||
error = coaps.Stop();
|
||||
otLogWarnMeshCoP(GetInstance(), "Reset commissioner session: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Reset commissioner session: %s", otThreadErrorToString(error));
|
||||
}
|
||||
else if (!coaps.IsConnectionActive())
|
||||
{
|
||||
error = StartCoaps();
|
||||
otLogWarnMeshCoP(GetInstance(), "Restart border agent secure CoAP service: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Restart border agent secure CoAP service: %s", otThreadErrorToString(error));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -237,11 +237,11 @@ exit:
|
||||
{
|
||||
if (aEui64)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Added Joiner (%s, %s)", aEui64->ToString().AsCString(), aPSKd);
|
||||
otLogInfoMeshCoP("Added Joiner (%s, %s)", aEui64->ToString().AsCString(), aPSKd);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Added Joiner (*, %s)", aPSKd);
|
||||
otLogInfoMeshCoP("Added Joiner (*, %s)", aPSKd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -299,11 +299,11 @@ exit:
|
||||
{
|
||||
if (aEui64)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Removed Joiner (%s)", aEui64->ToString().AsCString());
|
||||
otLogInfoMeshCoP("Removed Joiner (%s)", aEui64->ToString().AsCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Removed Joiner (*)");
|
||||
otLogInfoMeshCoP("Removed Joiner (*)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ void Commissioner::HandleJoinerExpirationTimer(void)
|
||||
|
||||
if (static_cast<int32_t>(now - mJoiners[i].mExpirationTime) >= 0)
|
||||
{
|
||||
otLogDebgMeshCoP(GetInstance(), "removing joiner due to timeout or successfully joined");
|
||||
otLogDebgMeshCoP("removing joiner due to timeout or successfully joined");
|
||||
RemoveJoiner(&mJoiners[i].mEui64, 0); // remove immediately
|
||||
}
|
||||
}
|
||||
@@ -450,7 +450,7 @@ otError Commissioner::SendMgmtCommissionerGetRequest(const uint8_t *aTlvs, uint8
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo,
|
||||
Commissioner::HandleMgmtCommissionerGetResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent MGMT_COMMISSIONER_GET.req to leader");
|
||||
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_GET.req to leader");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -482,7 +482,7 @@ void Commissioner::HandleMgmtCommissisonerGetResponse(Coap::Header * aH
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED);
|
||||
otLogInfoMeshCoP(GetInstance(), "received MGMT_COMMISSIONER_GET response");
|
||||
otLogInfoMeshCoP("received MGMT_COMMISSIONER_GET response");
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -555,7 +555,7 @@ otError Commissioner::SendMgmtCommissionerSetRequest(const otCommissioningDatase
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo,
|
||||
Commissioner::HandleMgmtCommissionerSetResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent MGMT_COMMISSIONER_SET.req to leader");
|
||||
otLogInfoMeshCoP("sent MGMT_COMMISSIONER_SET.req to leader");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -587,7 +587,7 @@ void Commissioner::HandleMgmtCommissisonerSetResponse(Coap::Header * aH
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED);
|
||||
otLogInfoMeshCoP(GetInstance(), "received MGMT_COMMISSIONER_SET response");
|
||||
otLogInfoMeshCoP("received MGMT_COMMISSIONER_SET response");
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -622,7 +622,7 @@ otError Commissioner::SendPetition(void)
|
||||
SuccessOrExit(
|
||||
error = netif.GetCoap().SendMessage(*message, messageInfo, Commissioner::HandleLeaderPetitionResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent petition");
|
||||
otLogInfoMeshCoP("sent petition");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -660,7 +660,7 @@ void Commissioner::HandleLeaderPetitionResponse(Coap::Header * aHeader,
|
||||
VerifyOrExit(mState == OT_COMMISSIONER_STATE_PETITION, mState = OT_COMMISSIONER_STATE_DISABLED);
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED, retransmit = true);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received Leader Petition response");
|
||||
otLogInfoMeshCoP("received Leader Petition response");
|
||||
|
||||
SuccessOrExit(Tlv::GetTlv(*aMessage, Tlv::kState, sizeof(state), state));
|
||||
VerifyOrExit(state.IsValid());
|
||||
@@ -728,7 +728,7 @@ otError Commissioner::SendKeepAlive(void)
|
||||
SuccessOrExit(
|
||||
error = netif.GetCoap().SendMessage(*message, messageInfo, Commissioner::HandleLeaderKeepAliveResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent keep alive");
|
||||
otLogInfoMeshCoP("sent keep alive");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -764,7 +764,7 @@ void Commissioner::HandleLeaderKeepAliveResponse(Coap::Header * aHeader
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE && aHeader->GetCode() == OT_COAP_CODE_CHANGED,
|
||||
mState = OT_COMMISSIONER_STATE_DISABLED);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received Leader keep-alive response");
|
||||
otLogInfoMeshCoP("received Leader keep-alive response");
|
||||
|
||||
SuccessOrExit(Tlv::GetTlv(*aMessage, Tlv::kState, sizeof(state), state));
|
||||
VerifyOrExit(state.IsValid());
|
||||
@@ -840,7 +840,7 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage,
|
||||
error = netif.GetCoapSecure().SetPsk(reinterpret_cast<const uint8_t *>(mJoiners[i].mPsk),
|
||||
static_cast<uint8_t>(strlen(mJoiners[i].mPsk)));
|
||||
SuccessOrExit(error);
|
||||
otLogInfoMeshCoP(GetInstance(), "found joiner, starting new session");
|
||||
otLogInfoMeshCoP("found joiner, starting new session");
|
||||
enableJoiner = true;
|
||||
break;
|
||||
}
|
||||
@@ -858,9 +858,9 @@ void Commissioner::HandleRelayReceive(Coap::Header &aHeader, Message &aMessage,
|
||||
mJoinerPort = joinerPort.GetUdpPort();
|
||||
mJoinerRloc = joinerRloc.GetJoinerRouterLocator();
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Remove Relay Receive (%02x%02x%02x%02x%02x%02x%02x%02x, 0x%04x)", mJoinerIid[0],
|
||||
mJoinerIid[1], mJoinerIid[2], mJoinerIid[3], mJoinerIid[4], mJoinerIid[5], mJoinerIid[6],
|
||||
mJoinerIid[7], mJoinerRloc);
|
||||
otLogInfoMeshCoP("Remove Relay Receive (%02x%02x%02x%02x%02x%02x%02x%02x, 0x%04x)", mJoinerIid[0], mJoinerIid[1],
|
||||
mJoinerIid[2], mJoinerIid[3], mJoinerIid[4], mJoinerIid[5], mJoinerIid[6], mJoinerIid[7],
|
||||
mJoinerRloc);
|
||||
|
||||
aMessage.SetOffset(offset);
|
||||
SuccessOrExit(error = aMessage.SetLength(offset + length));
|
||||
@@ -891,12 +891,12 @@ void Commissioner::HandleDatasetChanged(Coap::Header &aHeader, Message &aMessage
|
||||
{
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received dataset changed");
|
||||
otLogInfoMeshCoP("received dataset changed");
|
||||
OT_UNUSED_VARIABLE(aMessage);
|
||||
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset changed acknowledgment");
|
||||
otLogInfoMeshCoP("sent dataset changed acknowledgment");
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -918,7 +918,7 @@ void Commissioner::HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage
|
||||
StateTlv::State state = StateTlv::kAccept;
|
||||
ProvisioningUrlTlv provisioningUrl;
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received joiner finalize");
|
||||
otLogInfoMeshCoP("received joiner finalize");
|
||||
|
||||
if (Tlv::GetTlv(aMessage, Tlv::kProvisioningUrl, sizeof(provisioningUrl), provisioningUrl) == OT_ERROR_NONE)
|
||||
{
|
||||
@@ -934,8 +934,7 @@ void Commissioner::HandleJoinerFinalize(Coap::Header &aHeader, Message &aMessage
|
||||
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
|
||||
VerifyOrExit(aMessage.GetLength() <= sizeof(buf));
|
||||
aMessage.Read(aHeader.GetLength(), aMessage.GetLength() - aHeader.GetLength(), buf);
|
||||
otDumpCertMeshCoP(GetInstance(), "[THCI] direction=recv | type=JOIN_FIN.req |", buf,
|
||||
aMessage.GetLength() - aHeader.GetLength());
|
||||
otDumpCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.req |", buf, aMessage.GetLength() - aHeader.GetLength());
|
||||
|
||||
exit:
|
||||
#endif
|
||||
@@ -973,7 +972,7 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader,
|
||||
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
|
||||
VerifyOrExit(message->GetLength() <= sizeof(buf));
|
||||
message->Read(responseHeader.GetLength(), message->GetLength() - responseHeader.GetLength(), buf);
|
||||
otDumpCertMeshCoP(GetInstance(), "[THCI] direction=send | type=JOIN_FIN.rsp |", buf,
|
||||
otDumpCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.rsp |", buf,
|
||||
message->GetLength() - responseHeader.GetLength());
|
||||
#endif
|
||||
|
||||
@@ -983,7 +982,7 @@ void Commissioner::SendJoinFinalizeResponse(const Coap::Header &aRequestHeader,
|
||||
extAddr.SetLocal(!extAddr.IsLocal());
|
||||
RemoveJoiner(&extAddr, kRemoveJoinerDelay); // remove after kRemoveJoinerDelay (seconds)
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent joiner finalize response");
|
||||
otLogInfoMeshCoP("sent joiner finalize response");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -545,8 +545,8 @@ otError Dataset::ApplyConfiguration(Instance &aInstance, bool *aIsMasterKeyUpdat
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(aInstance, "DatasetManager::ApplyConfiguration() Failed to set channel to %d (%s)",
|
||||
channel, otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("DatasetManager::ApplyConfiguration() Failed to set channel to %d (%s)", channel,
|
||||
otThreadErrorToString(error));
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
|
||||
@@ -169,12 +169,12 @@ otError DatasetLocal::Set(const Dataset &aDataset)
|
||||
if (aDataset.GetSize() == 0)
|
||||
{
|
||||
error = GetInstance().GetSettings().DeleteOperationalDataset(IsActive());
|
||||
otLogInfoMeshCoP(GetInstance(), "%s dataset deleted", mType == Tlv::kActiveTimestamp ? "Active" : "Pending");
|
||||
otLogInfoMeshCoP("%s dataset deleted", mType == Tlv::kActiveTimestamp ? "Active" : "Pending");
|
||||
}
|
||||
else
|
||||
{
|
||||
error = GetInstance().GetSettings().SaveOperationalDataset(IsActive(), aDataset);
|
||||
otLogInfoMeshCoP(GetInstance(), "%s dataset set", mType == Tlv::kActiveTimestamp ? "Active" : "Pending");
|
||||
otLogInfoMeshCoP("%s dataset set", mType == Tlv::kActiveTimestamp ? "Active" : "Pending");
|
||||
}
|
||||
|
||||
SuccessOrExit(error);
|
||||
|
||||
@@ -241,7 +241,7 @@ otError DatasetManager::Register(void)
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset to leader");
|
||||
otLogInfoMeshCoP("sent dataset to leader");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -359,7 +359,7 @@ void DatasetManager::SendGetResponse(const Coap::Header & aRequestHeader,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset get response");
|
||||
otLogInfoMeshCoP("sent dataset get response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -490,7 +490,7 @@ void PendingDataset::StartDelayTimer(void)
|
||||
}
|
||||
|
||||
mDelayTimer.StartAt(dataset.GetUpdateTime(), delay);
|
||||
otLogInfoMeshCoP(GetInstance(), "delay timer started %d", delay);
|
||||
otLogInfoMeshCoP("delay timer started %d", delay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ void PendingDataset::HandleDelayTimer(void)
|
||||
}
|
||||
}
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "pending delay timer expired");
|
||||
otLogInfoMeshCoP("pending delay timer expired");
|
||||
|
||||
dataset.ConvertToActive();
|
||||
GetNetif().GetActiveDataset().Set(dataset);
|
||||
|
||||
@@ -459,7 +459,7 @@ otError DatasetManager::SendSetRequest(const otOperationalDataset &aDataset, con
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset set request to leader");
|
||||
otLogInfoMeshCoP("sent dataset set request to leader");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -588,7 +588,7 @@ otError DatasetManager::SendGetRequest(const otOperationalDatasetComponents &aDa
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset get request");
|
||||
otLogInfoMeshCoP("sent dataset get request");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -621,7 +621,7 @@ void DatasetManager::SendSetResponse(const Coap::Header & aRequestHeader,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset set response");
|
||||
otLogInfoMeshCoP("sent dataset set response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -742,7 +742,7 @@ otError ActiveDataset::GenerateLocal(void)
|
||||
SuccessOrExit(error = mLocal.Set(dataset));
|
||||
Restore();
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Generated local dataset");
|
||||
otLogInfoMeshCoP("Generated local dataset");
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
+21
-21
@@ -228,12 +228,12 @@ otError Dtls::Start(bool aClient,
|
||||
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "DTLS started");
|
||||
otLogInfoMeshCoP("DTLS started");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "Application Coap Secure DTLS started");
|
||||
otLogInfoCoap("Application Coap Secure DTLS started");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -281,7 +281,7 @@ int Dtls::SetApplicationCoapSecureKeys(void)
|
||||
break;
|
||||
|
||||
default:
|
||||
otLogCritCoap(GetInstance(), "Application Coap Secure DTLS: Not supported cipher.");
|
||||
otLogCritCoap("Application Coap Secure DTLS: Not supported cipher.");
|
||||
rval = MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
|
||||
ExitNow();
|
||||
break;
|
||||
@@ -506,12 +506,12 @@ int Dtls::HandleMbedtlsTransmit(const unsigned char *aBuf, size_t aLength)
|
||||
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Dtls::HandleMbedtlsTransmit");
|
||||
otLogInfoMeshCoP("Dtls::HandleMbedtlsTransmit");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "Dtls::ApplicationCoapSecure HandleMbedtlsTransmit");
|
||||
otLogInfoCoap("Dtls::ApplicationCoapSecure HandleMbedtlsTransmit");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -549,12 +549,12 @@ int Dtls::HandleMbedtlsReceive(unsigned char *aBuf, size_t aLength)
|
||||
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Dtls::HandleMbedtlsReceive");
|
||||
otLogInfoMeshCoP("Dtls::HandleMbedtlsReceive");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "Dtls:: ApplicationCoapSecure HandleMbedtlsReceive");
|
||||
otLogInfoCoap("Dtls:: ApplicationCoapSecure HandleMbedtlsReceive");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -584,12 +584,12 @@ int Dtls::HandleMbedtlsGetTimer(void)
|
||||
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Dtls::HandleMbedtlsGetTimer");
|
||||
otLogInfoMeshCoP("Dtls::HandleMbedtlsGetTimer");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "Dtls:: ApplicationCoapSecure HandleMbedtlsGetTimer");
|
||||
otLogInfoCoap("Dtls:: ApplicationCoapSecure HandleMbedtlsGetTimer");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -622,12 +622,12 @@ void Dtls::HandleMbedtlsSetTimer(uint32_t aIntermediate, uint32_t aFinish)
|
||||
{
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Dtls::SetTimer");
|
||||
otLogInfoMeshCoP("Dtls::SetTimer");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "Dtls::ApplicationCoapSecure SetTimer");
|
||||
otLogInfoCoap("Dtls::ApplicationCoapSecure SetTimer");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -672,12 +672,12 @@ int Dtls::HandleMbedtlsExportKeys(const unsigned char *aMasterSecret,
|
||||
|
||||
if (mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Generated KEK");
|
||||
otLogInfoMeshCoP("Generated KEK");
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
else
|
||||
{
|
||||
otLogInfoCoap(GetInstance(), "ApplicationCoapSecure Generated KEK");
|
||||
otLogInfoCoap("ApplicationCoapSecure Generated KEK");
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
|
||||
|
||||
@@ -876,20 +876,20 @@ void Dtls::HandleMbedtlsDebug(void *ctx, int level, const char *, int, const cha
|
||||
switch (level)
|
||||
{
|
||||
case 1:
|
||||
otLogCritMbedTls(pThis->GetInstance(), "%s", str);
|
||||
otLogCritMbedTls("%s", str);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
otLogWarnMbedTls(pThis->GetInstance(), "%s", str);
|
||||
otLogWarnMbedTls("%s", str);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
otLogInfoMbedTls(pThis->GetInstance(), "%s", str);
|
||||
otLogInfoMbedTls("%s", str);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
default:
|
||||
otLogDebgMbedTls(pThis->GetInstance(), "%s", str);
|
||||
otLogDebgMbedTls("%s", str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -899,17 +899,17 @@ void Dtls::HandleMbedtlsDebug(void *ctx, int level, const char *, int, const cha
|
||||
switch (level)
|
||||
{
|
||||
case 1:
|
||||
otLogCritCoap(pThis->GetInstance(), "ApplicationCoapSecure Mbedtls: %s", str);
|
||||
otLogCritCoap("ApplicationCoapSecure Mbedtls: %s", str);
|
||||
break;
|
||||
case 2:
|
||||
otLogWarnCoap(pThis->GetInstance(), "ApplicationCoapSecure Mbedtls: %s", str);
|
||||
otLogWarnCoap("ApplicationCoapSecure Mbedtls: %s", str);
|
||||
break;
|
||||
case 3:
|
||||
otLogInfoCoap(pThis->GetInstance(), "ApplicationCoapSecure Mbedtls: %s", str);
|
||||
otLogInfoCoap("ApplicationCoapSecure Mbedtls: %s", str);
|
||||
break;
|
||||
case 4:
|
||||
default:
|
||||
otLogDebgCoap(pThis->GetInstance(), "ApplicationCoapSecure Mbedtls: %s", str);
|
||||
otLogDebgCoap("ApplicationCoapSecure Mbedtls: %s", str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ otError EnergyScanClient::SendQuery(uint32_t aChannelM
|
||||
messageInfo.SetInterfaceId(netif.GetInterfaceId());
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent energy scan query");
|
||||
otLogInfoMeshCoP("sent energy scan query");
|
||||
|
||||
mCallback = aCallback;
|
||||
mContext = aContext;
|
||||
@@ -158,7 +158,7 @@ void EnergyScanClient::HandleReport(Coap::Header &aHeader, Message &aMessage, co
|
||||
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received energy scan report");
|
||||
otLogInfoMeshCoP("received energy scan report");
|
||||
|
||||
SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kChannelMask, sizeof(channelMask), channelMask));
|
||||
VerifyOrExit(channelMask.IsValid());
|
||||
@@ -173,7 +173,7 @@ void EnergyScanClient::HandleReport(Coap::Header &aHeader, Message &aMessage, co
|
||||
|
||||
SuccessOrExit(netif.GetCoap().SendEmptyAck(aHeader, responseInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent energy scan report response");
|
||||
otLogInfoMeshCoP("sent energy scan report response");
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
+15
-17
@@ -196,13 +196,13 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
|
||||
{
|
||||
JoinerRouter joinerRouter;
|
||||
|
||||
otLogDebgMeshCoP(GetInstance(), "Received Discovery Response (%s)",
|
||||
otLogDebgMeshCoP("Received Discovery Response (%s)",
|
||||
static_cast<Mac::ExtAddress &>(aResult->mExtAddress).ToString().AsCString());
|
||||
|
||||
// Joining is disabled if the Steering Data is not included
|
||||
if (aResult->mSteeringData.mLength == 0)
|
||||
{
|
||||
otLogDebgMeshCoP(GetInstance(), "No steering data, joining disabled");
|
||||
otLogDebgMeshCoP("No steering data, joining disabled");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ void Joiner::HandleDiscoverResult(otActiveScanResult *aResult)
|
||||
if (!steeringData.GetBit(mCcitt % steeringData.GetNumBits()) ||
|
||||
!steeringData.GetBit(mAnsi % steeringData.GetNumBits()))
|
||||
{
|
||||
otLogDebgMeshCoP(GetInstance(), "Steering data does not include this device");
|
||||
otLogDebgMeshCoP("Steering data does not include this device");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ otError Joiner::TryNextJoin()
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogDebgMeshCoP(GetInstance(), "No joinable networks remaining to try");
|
||||
otLogDebgMeshCoP("No joinable networks remaining to try");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -396,13 +396,12 @@ void Joiner::SendJoinerFinalize(void)
|
||||
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
|
||||
VerifyOrExit(message->GetLength() <= sizeof(buf));
|
||||
message->Read(header.GetLength(), message->GetLength() - header.GetLength(), buf);
|
||||
otDumpCertMeshCoP(GetInstance(), "[THCI] direction=send | type=JOIN_FIN.req |", buf,
|
||||
message->GetLength() - header.GetLength());
|
||||
otDumpCertMeshCoP("[THCI] direction=send | type=JOIN_FIN.req |", buf, message->GetLength() - header.GetLength());
|
||||
#endif
|
||||
|
||||
SuccessOrExit(error = netif.GetCoapSecure().SendMessage(*message, Joiner::HandleJoinerFinalizeResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent joiner finalize");
|
||||
otLogInfoMeshCoP("Sent joiner finalize");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -440,13 +439,12 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Header * aHeader,
|
||||
mState = OT_JOINER_STATE_ENTRUST;
|
||||
mTimer.Start(kTimeout);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received joiner finalize response %d", static_cast<uint8_t>(state.GetState()));
|
||||
otLogInfoMeshCoP("received joiner finalize response %d", static_cast<uint8_t>(state.GetState()));
|
||||
#if OPENTHREAD_ENABLE_CERT_LOG
|
||||
uint8_t buf[OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE];
|
||||
VerifyOrExit(aMessage->GetLength() <= sizeof(buf));
|
||||
aMessage->Read(aHeader->GetLength(), aMessage->GetLength() - aHeader->GetLength(), buf);
|
||||
otDumpCertMeshCoP(GetInstance(), "[THCI] direction=recv | type=JOIN_FIN.rsp |", buf,
|
||||
aMessage->GetLength() - aHeader->GetLength());
|
||||
otDumpCertMeshCoP("[THCI] direction=recv | type=JOIN_FIN.rsp |", buf, aMessage->GetLength() - aHeader->GetLength());
|
||||
#endif
|
||||
|
||||
exit:
|
||||
@@ -478,8 +476,8 @@ void Joiner::HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const
|
||||
aHeader.GetCode() == OT_COAP_CODE_POST,
|
||||
error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Received joiner entrust");
|
||||
otLogCertMeshCoP(GetInstance(), "[THCI] direction=recv | type=JOIN_ENT.ntf");
|
||||
otLogInfoMeshCoP("Received joiner entrust");
|
||||
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_ENT.ntf");
|
||||
|
||||
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kNetworkMasterKey, sizeof(masterKey), masterKey));
|
||||
VerifyOrExit(masterKey.IsValid(), error = OT_ERROR_PARSE);
|
||||
@@ -511,7 +509,7 @@ void Joiner::HandleJoinerEntrust(Coap::Header &aHeader, Message &aMessage, const
|
||||
netif.GetMac().SetNetworkName(name.m8);
|
||||
}
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "join success!");
|
||||
otLogInfoMeshCoP("join success!");
|
||||
|
||||
// Send dummy response.
|
||||
SendJoinerEntrustResponse(aHeader, aMessageInfo);
|
||||
@@ -523,7 +521,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMeshCoP(GetInstance(), "Error while processing joiner entrust: %s", otThreadErrorToString(error));
|
||||
otLogWarnMeshCoP("Error while processing joiner entrust: %s", otThreadErrorToString(error));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,10 +543,10 @@ void Joiner::SendJoinerEntrustResponse(const Coap::Header &aRequestHeader, const
|
||||
|
||||
mState = OT_JOINER_STATE_JOINED;
|
||||
|
||||
otLogInfoArp(GetInstance(), "Sent Joiner Entrust response");
|
||||
otLogInfoArp("Sent Joiner Entrust response");
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent joiner entrust response length = %d", message->GetLength());
|
||||
otLogCertMeshCoP(GetInstance(), "[THCI] direction=send | type=JOIN_ENT.rsp");
|
||||
otLogInfoMeshCoP("Sent joiner entrust response length = %d", message->GetLength());
|
||||
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_ENT.rsp");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ void JoinerRouter::HandleStateChanged(otChangedFlags aFlags)
|
||||
mSocket.Open(&JoinerRouter::HandleUdpReceive, this);
|
||||
mSocket.Bind(sockaddr);
|
||||
netif.GetIp6Filter().AddUnsecurePort(sockaddr.mPort);
|
||||
otLogInfoMeshCoP(GetInstance(), "Joiner Router: start");
|
||||
otLogInfoMeshCoP("Joiner Router: start");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -149,7 +149,7 @@ void JoinerRouter::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
|
||||
ExtendedTlv tlv;
|
||||
uint16_t borderAgentRloc;
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "JoinerRouter::HandleUdpReceive");
|
||||
otLogInfoMeshCoP("JoinerRouter::HandleUdpReceive");
|
||||
|
||||
SuccessOrExit(error = GetBorderAgentRloc(GetNetif(), borderAgentRloc));
|
||||
|
||||
@@ -199,7 +199,7 @@ void JoinerRouter::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &a
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent relay rx");
|
||||
otLogInfoMeshCoP("Sent relay rx");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -233,7 +233,7 @@ void JoinerRouter::HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage,
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_NON_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST,
|
||||
error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Received relay transmit");
|
||||
otLogInfoMeshCoP("Received relay transmit");
|
||||
|
||||
SuccessOrExit(error = Tlv::GetTlv(aMessage, Tlv::kJoinerUdpPort, sizeof(joinerPort), joinerPort));
|
||||
VerifyOrExit(joinerPort.IsValid(), error = OT_ERROR_PARSE);
|
||||
@@ -274,7 +274,7 @@ void JoinerRouter::HandleRelayTransmit(Coap::Header &aHeader, Message &aMessage,
|
||||
|
||||
if (Tlv::GetTlv(aMessage, Tlv::kJoinerRouterKek, sizeof(kek), kek) == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoMeshCoP(GetInstance(), "Received kek");
|
||||
otLogInfoMeshCoP("Received kek");
|
||||
|
||||
DelaySendingJoinerEntrust(messageInfo, kek);
|
||||
}
|
||||
@@ -462,12 +462,12 @@ otError JoinerRouter::SendJoinerEntrust(Message &aMessage, const Ip6::MessageInf
|
||||
|
||||
netif.GetCoap().AbortTransaction(&JoinerRouter::HandleJoinerEntrustResponse, this);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sending JOIN_ENT.ntf");
|
||||
otLogInfoMeshCoP("Sending JOIN_ENT.ntf");
|
||||
SuccessOrExit(
|
||||
error = netif.GetCoap().SendMessage(aMessage, aMessageInfo, &JoinerRouter::HandleJoinerEntrustResponse, this));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Sent joiner entrust length = %d", aMessage.GetLength());
|
||||
otLogCertMeshCoP(GetInstance(), "[THCI] direction=send | type=JOIN_ENT.ntf");
|
||||
otLogInfoMeshCoP("Sent joiner entrust length = %d", aMessage.GetLength());
|
||||
otLogCertMeshCoP("[THCI] direction=send | type=JOIN_ENT.ntf");
|
||||
|
||||
mExpectJoinEntRsp = true;
|
||||
|
||||
@@ -500,8 +500,8 @@ void JoinerRouter::HandleJoinerEntrustResponse(Coap::Header * aHeader,
|
||||
|
||||
VerifyOrExit(aHeader->GetCode() == OT_COAP_CODE_CHANGED);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "Receive joiner entrust response");
|
||||
otLogCertMeshCoP(GetInstance(), "[THCI] direction=recv | type=JOIN_ENT.rsp");
|
||||
otLogInfoMeshCoP("Receive joiner entrust response");
|
||||
otLogCertMeshCoP("[THCI] direction=recv | type=JOIN_ENT.rsp");
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
@@ -83,7 +83,7 @@ void Leader::HandlePetition(Coap::Header &aHeader, Message &aMessage, const Ip6:
|
||||
CommissionerIdTlv commissionerId;
|
||||
StateTlv::State state = StateTlv::kReject;
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received petition");
|
||||
otLogInfoMeshCoP("received petition");
|
||||
|
||||
VerifyOrExit(GetNetif().GetMle().IsRoutingLocator(aMessageInfo.GetPeerAddr()));
|
||||
SuccessOrExit(Tlv::GetTlv(aMessage, Tlv::kCommissionerId, sizeof(commissionerId), commissionerId));
|
||||
@@ -155,7 +155,7 @@ otError Leader::SendPetitionResponse(const Coap::Header & aRequestHeader,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent petition response");
|
||||
otLogInfoMeshCoP("sent petition response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -185,7 +185,7 @@ void Leader::HandleKeepAlive(Coap::Header &aHeader, Message &aMessage, const Ip6
|
||||
BorderAgentLocatorTlv * borderAgentLocator;
|
||||
StateTlv::State responseState;
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received keep alive");
|
||||
otLogInfoMeshCoP("received keep alive");
|
||||
|
||||
SuccessOrExit(Tlv::GetTlv(aMessage, Tlv::kState, sizeof(state), state));
|
||||
VerifyOrExit(state.IsValid());
|
||||
@@ -246,7 +246,7 @@ otError Leader::SendKeepAliveResponse(const Coap::Header & aRequestHeader,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent keep alive response");
|
||||
otLogInfoMeshCoP("sent keep alive response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -277,7 +277,7 @@ otError Leader::SendDatasetChanged(const Ip6::Address &aAddress)
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent dataset changed");
|
||||
otLogInfoMeshCoP("sent dataset changed");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -336,7 +336,7 @@ void Leader::ResignCommissioner(void)
|
||||
mTimer.Stop();
|
||||
SetEmptyCommissionerData();
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "commissioner inactive");
|
||||
otLogInfoMeshCoP("commissioner inactive");
|
||||
}
|
||||
|
||||
} // namespace MeshCoP
|
||||
|
||||
@@ -102,7 +102,7 @@ otError PanIdQueryClient::SendQuery(uint16_t aPanId,
|
||||
messageInfo.SetInterfaceId(netif.GetInterfaceId());
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent panid query");
|
||||
otLogInfoMeshCoP("sent panid query");
|
||||
|
||||
mCallback = aCallback;
|
||||
mContext = aContext;
|
||||
@@ -136,7 +136,7 @@ void PanIdQueryClient::HandleConflict(Coap::Header &aHeader, Message &aMessage,
|
||||
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST);
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "received panid conflict");
|
||||
otLogInfoMeshCoP("received panid conflict");
|
||||
|
||||
SuccessOrExit(MeshCoP::Tlv::GetTlv(aMessage, MeshCoP::Tlv::kPanId, sizeof(panId), panId));
|
||||
VerifyOrExit(panId.IsValid());
|
||||
@@ -151,7 +151,7 @@ void PanIdQueryClient::HandleConflict(Coap::Header &aHeader, Message &aMessage,
|
||||
|
||||
SuccessOrExit(netif.GetCoap().SendEmptyAck(aHeader, responseInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent panid query conflict response");
|
||||
otLogInfoMeshCoP("sent panid query conflict response");
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
@@ -395,7 +395,7 @@ otError Dhcp6Client::Solicit(uint16_t aRloc16)
|
||||
messageInfo.mInterfaceId = netif.GetInterfaceId();
|
||||
|
||||
SuccessOrExit(error = mSocket.SendTo(*message, messageInfo));
|
||||
otLogInfoIp6(GetInstance(), "solicit");
|
||||
otLogInfoIp6("solicit");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ otError Icmp::SendEchoRequest(Message &aMessage, const MessageInfo &aMessageInfo
|
||||
aMessage.SetOffset(0);
|
||||
SuccessOrExit(error = GetIp6().SendDatagram(aMessage, messageInfoLocal, kProtoIcmp6));
|
||||
|
||||
otLogInfoIcmp(GetInstance(), "Sent echo request: (seq = %d)", icmpHeader.GetSequence());
|
||||
otLogInfoIcmp("Sent echo request: (seq = %d)", icmpHeader.GetSequence());
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -128,7 +128,7 @@ otError Icmp::SendError(IcmpHeader::Type aType,
|
||||
|
||||
SuccessOrExit(error = GetIp6().SendDatagram(*message, messageInfoLocal, kProtoIcmp6));
|
||||
|
||||
otLogInfoIcmp(GetInstance(), "Sent ICMPv6 Error");
|
||||
otLogInfoIcmp("Sent ICMPv6 Error");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -208,14 +208,14 @@ otError Icmp::HandleEchoRequest(Message &aRequestMessage, const MessageInfo &aMe
|
||||
VerifyOrExit(ShouldHandleEchoRequest(aMessageInfo) || aMessageInfo.GetSockAddr().IsRoutingLocator() ||
|
||||
aMessageInfo.GetSockAddr().IsAnycastRoutingLocator());
|
||||
|
||||
otLogInfoIcmp(GetInstance(), "Received Echo Request");
|
||||
otLogInfoIcmp("Received Echo Request");
|
||||
|
||||
icmp6Header.Init();
|
||||
icmp6Header.SetType(IcmpHeader::kTypeEchoReply);
|
||||
|
||||
if ((replyMessage = GetIp6().NewMessage(0)) == NULL)
|
||||
{
|
||||
otLogDebgIcmp(GetInstance(), "Failed to allocate a new message");
|
||||
otLogDebgIcmp("Failed to allocate a new message");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ otError Icmp::HandleEchoRequest(Message &aRequestMessage, const MessageInfo &aMe
|
||||
SuccessOrExit(error = GetIp6().SendDatagram(*replyMessage, replyMessageInfo, kProtoIcmp6));
|
||||
|
||||
replyMessage->Read(replyMessage->GetOffset(), sizeof(icmp6Header), &icmp6Header);
|
||||
otLogInfoIcmp(GetInstance(), "Sent Echo Reply (seq = %d)", icmp6Header.GetSequence());
|
||||
otLogInfoIcmp("Sent Echo Reply (seq = %d)", icmp6Header.GetSequence());
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
+6
-10
@@ -217,12 +217,11 @@ otError Ip6::InsertMplOption(Message &aMessage, Header &aIp6Header, MessageInfo
|
||||
if ((messageCopy = aMessage.Clone()) != NULL)
|
||||
{
|
||||
HandleDatagram(*messageCopy, NULL, aMessageInfo.GetInterfaceId(), NULL, true);
|
||||
otLogInfoIp6(GetInstance(), "Message copy for indirect transmission to sleepy children");
|
||||
otLogInfoIp6("Message copy for indirect transmission to sleepy children");
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnIp6(GetInstance(),
|
||||
"No enough buffer for message copy for indirect transmission to sleepy children");
|
||||
otLogWarnIp6("No enough buffer for message copy for indirect transmission to sleepy children");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,14 +411,13 @@ otError Ip6::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, IpProto
|
||||
|
||||
if ((messageCopy = aMessage.Clone()) != NULL)
|
||||
{
|
||||
otLogInfoIp6(GetInstance(), "Message copy for indirect transmission to sleepy children");
|
||||
otLogInfoIp6("Message copy for indirect transmission to sleepy children");
|
||||
messageCopy->SetInterfaceId(aMessageInfo.GetInterfaceId());
|
||||
EnqueueDatagram(*messageCopy);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnIp6(GetInstance(),
|
||||
"No enough buffer for message copy for indirect transmission to sleepy children");
|
||||
otLogWarnIp6("No enough buffer for message copy for indirect transmission to sleepy children");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -684,13 +682,11 @@ exit:
|
||||
switch (error)
|
||||
{
|
||||
case OT_ERROR_NO_BUFS:
|
||||
otLogWarnIp6(GetInstance(), "Failed to pass up message (len: %d) to host - out of message buffer.",
|
||||
aMessage.GetLength());
|
||||
otLogWarnIp6("Failed to pass up message (len: %d) to host - out of message buffer.", aMessage.GetLength());
|
||||
break;
|
||||
|
||||
case OT_ERROR_DROP:
|
||||
otLogNoteIp6(GetInstance(), "Dropping message (len: %d) from local host since next hop is the host.",
|
||||
aMessage.GetLength());
|
||||
otLogNoteIp6("Dropping message (len: %d) from local host since next hop is the host.", aMessage.GetLength());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -196,12 +196,12 @@ void AddressResolver::InvalidateCacheEntry(Cache &aEntry, InvalidationReason aRe
|
||||
switch (aEntry.mState)
|
||||
{
|
||||
case Cache::kStateCached:
|
||||
otLogNoteArp(GetInstance(), "Cache entry removed: %s, 0x%04x - %s", aEntry.mTarget.ToString().AsCString(),
|
||||
aEntry.mRloc16, ConvertInvalidationReasonToString(aReason));
|
||||
otLogNoteArp("Cache entry removed: %s, 0x%04x - %s", aEntry.mTarget.ToString().AsCString(), aEntry.mRloc16,
|
||||
ConvertInvalidationReasonToString(aReason));
|
||||
break;
|
||||
|
||||
case Cache::kStateQuery:
|
||||
otLogNoteArp(GetInstance(), "Cache entry (query mode) removed: %s, timeout:%d, retry:%d - %s",
|
||||
otLogNoteArp("Cache entry (query mode) removed: %s, timeout:%d, retry:%d - %s",
|
||||
aEntry.mTarget.ToString().AsCString(), aEntry.mTimeout, aEntry.mRetryTimeout,
|
||||
ConvertInvalidationReasonToString(aReason));
|
||||
break;
|
||||
@@ -241,8 +241,7 @@ void AddressResolver::UpdateCacheEntry(const Ip6::Address &aEid, Mac::ShortAddre
|
||||
GetNetif().GetMeshForwarder().HandleResolved(aEid, OT_ERROR_NONE);
|
||||
}
|
||||
|
||||
otLogNoteArp(GetInstance(), "Cache entry updated (snoop): %s, 0x%04x", aEid.ToString().AsCString(),
|
||||
aRloc16);
|
||||
otLogNoteArp("Cache entry updated (snoop): %s, 0x%04x", aEid.ToString().AsCString(), aRloc16);
|
||||
}
|
||||
|
||||
ExitNow();
|
||||
@@ -344,7 +343,7 @@ otError AddressResolver::SendAddressQuery(const Ip6::Address &aEid)
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoArp(GetInstance(), "Sending address query for %s", aEid.ToString().AsCString());
|
||||
otLogInfoArp("Sending address query for %s", aEid.ToString().AsCString());
|
||||
|
||||
exit:
|
||||
|
||||
@@ -402,7 +401,7 @@ void AddressResolver::HandleAddressNotification(Coap::Header & aHeader,
|
||||
lastTransactionTime = lastTransactionTimeTlv.GetTime();
|
||||
}
|
||||
|
||||
otLogInfoArp(GetInstance(), "Received address notification from 0x%04x for %s to 0x%04x",
|
||||
otLogInfoArp("Received address notification from 0x%04x for %s to 0x%04x",
|
||||
HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]), targetTlv.GetTarget().ToString().AsCString(),
|
||||
rloc16Tlv.GetRloc16());
|
||||
|
||||
@@ -445,12 +444,12 @@ void AddressResolver::HandleAddressNotification(Coap::Header & aHeader,
|
||||
mCache[i].mState = Cache::kStateCached;
|
||||
MarkCacheEntryAsUsed(mCache[i]);
|
||||
|
||||
otLogNoteArp(GetInstance(), "Cache entry updated (notification): %s, 0x%04x, lastTrans:%d",
|
||||
otLogNoteArp("Cache entry updated (notification): %s, 0x%04x, lastTrans:%d",
|
||||
targetTlv.GetTarget().ToString().AsCString(), rloc16Tlv.GetRloc16(), lastTransactionTime);
|
||||
|
||||
if (netif.GetCoap().SendEmptyAck(aHeader, aMessageInfo) == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoArp(GetInstance(), "Sending address notification acknowledgment");
|
||||
otLogInfoArp("Sending address notification acknowledgment");
|
||||
}
|
||||
|
||||
netif.GetMeshForwarder().HandleResolved(targetTlv.GetTarget(), OT_ERROR_NONE);
|
||||
@@ -497,7 +496,7 @@ otError AddressResolver::SendAddressError(const ThreadTargetTlv & aTarget,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoArp(GetInstance(), "Sending address error for target %s", aTarget.GetTarget().ToString().AsCString());
|
||||
otLogInfoArp("Sending address error for target %s", aTarget.GetTarget().ToString().AsCString());
|
||||
|
||||
exit:
|
||||
|
||||
@@ -531,13 +530,13 @@ void AddressResolver::HandleAddressError(Coap::Header &aHeader, Message &aMessag
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST,
|
||||
error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoArp(GetInstance(), "Received address error notification");
|
||||
otLogInfoArp("Received address error notification");
|
||||
|
||||
if (aHeader.IsConfirmable() && !aMessageInfo.GetSockAddr().IsMulticast())
|
||||
{
|
||||
if (netif.GetCoap().SendEmptyAck(aHeader, aMessageInfo) == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoArp(GetInstance(), "Sent address error notification acknowledgment");
|
||||
otLogInfoArp("Sent address error notification acknowledgment");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,8 +590,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnArp(GetInstance(), "Error while processing address error notification: %s",
|
||||
otThreadErrorToString(error));
|
||||
otLogWarnArp("Error while processing address error notification: %s", otThreadErrorToString(error));
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -624,7 +622,7 @@ void AddressResolver::HandleAddressQuery(Coap::Header &aHeader, Message &aMessag
|
||||
|
||||
lastTransactionTimeTlv.Init();
|
||||
|
||||
otLogInfoArp(GetInstance(), "Received address query from 0x%04x for target %s",
|
||||
otLogInfoArp("Received address query from 0x%04x for target %s",
|
||||
HostSwap16(aMessageInfo.GetPeerAddr().mFields.m16[7]), targetTlv.GetTarget().ToString().AsCString());
|
||||
|
||||
if (netif.IsUnicastAddress(targetTlv.GetTarget()))
|
||||
@@ -692,8 +690,7 @@ void AddressResolver::SendAddressQueryResponse(const ThreadTargetTlv &
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoArp(GetInstance(), "Sending address notification for target %s",
|
||||
aTargetTlv.GetTarget().ToString().AsCString());
|
||||
otLogInfoArp("Sending address notification for target %s", aTargetTlv.GetTarget().ToString().AsCString());
|
||||
|
||||
exit:
|
||||
|
||||
@@ -739,7 +736,7 @@ void AddressResolver::HandleTimer(void)
|
||||
mCache[i].mRetryTimeout = kAddressQueryMaxRetryDelay;
|
||||
}
|
||||
|
||||
otLogInfoArp(GetInstance(), "Timed out waiting for address notification for %s, retry: %d",
|
||||
otLogInfoArp("Timed out waiting for address notification for %s, retry: %d",
|
||||
mCache[i].mTarget.ToString().AsCString(), mCache[i].mRetryTimeout);
|
||||
|
||||
GetNetif().GetMeshForwarder().HandleResolved(mCache[i].mTarget, OT_ERROR_DROP);
|
||||
|
||||
@@ -101,7 +101,7 @@ void AnnounceBeginServer::HandleRequest(Coap::Header &aHeader, Message &aMessage
|
||||
if (aHeader.IsConfirmable() && !aMessageInfo.GetSockAddr().IsMulticast())
|
||||
{
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, responseInfo));
|
||||
otLogInfoMeshCoP(GetInstance(), "sent announce begin response");
|
||||
otLogInfoMeshCoP("sent announce begin response");
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -183,7 +183,7 @@ void AnnounceSender::CheckState(void)
|
||||
|
||||
SendAnnounce(channelMask, 0, period, kMaxJitter);
|
||||
|
||||
otLogInfoMle(GetInstance(), "Starting periodic MLE Announcements tx, period %u, mask %s", period,
|
||||
otLogInfoMle("Starting periodic MLE Announcements tx, period %u, mask %s", period,
|
||||
channelMask.ToString().AsCString());
|
||||
|
||||
exit:
|
||||
@@ -193,7 +193,7 @@ exit:
|
||||
void AnnounceSender::Stop(void)
|
||||
{
|
||||
AnnounceSenderBase::Stop();
|
||||
otLogInfoMle(GetInstance(), "Stopping periodic MLE Announcements tx");
|
||||
otLogInfoMle("Stopping periodic MLE Announcements tx");
|
||||
}
|
||||
|
||||
void AnnounceSender::HandleStateChanged(Notifier::Callback &aCallback, otChangedFlags aFlags)
|
||||
|
||||
@@ -127,7 +127,7 @@ exit:
|
||||
switch (error)
|
||||
{
|
||||
case OT_ERROR_NONE:
|
||||
otLogDebgMac(GetInstance(), "Sending data poll");
|
||||
otLogDebgMac("Sending data poll");
|
||||
|
||||
if (mNoBufferRetxMode == true)
|
||||
{
|
||||
@@ -142,12 +142,12 @@ exit:
|
||||
break;
|
||||
|
||||
case OT_ERROR_INVALID_STATE:
|
||||
otLogWarnMac(GetInstance(), "Data poll tx requested while data polling was not enabled!");
|
||||
otLogWarnMac("Data poll tx requested while data polling was not enabled!");
|
||||
StopPolling();
|
||||
break;
|
||||
|
||||
case OT_ERROR_ALREADY:
|
||||
otLogDebgMac(GetInstance(), "Data poll tx requested when a previous data request still in send queue.");
|
||||
otLogDebgMac("Data poll tx requested when a previous data request still in send queue.");
|
||||
ScheduleNextPoll(kUsePreviousPollPeriod);
|
||||
break;
|
||||
|
||||
@@ -213,7 +213,7 @@ void DataPollManager::HandlePollSent(otError aError)
|
||||
shouldRecalculatePollPeriod = true;
|
||||
}
|
||||
|
||||
otLogInfoMac(GetInstance(), "Sent data poll");
|
||||
otLogInfoMac("Sent data poll");
|
||||
|
||||
break;
|
||||
|
||||
@@ -226,7 +226,7 @@ void DataPollManager::HandlePollSent(otError aError)
|
||||
default:
|
||||
mPollTxFailureCounter++;
|
||||
|
||||
otLogInfoMac(GetInstance(), "Failed to send data poll, error:%s, retx:%d/%d", otThreadErrorToString(aError),
|
||||
otLogInfoMac("Failed to send data poll, error:%s, retx:%d/%d", otThreadErrorToString(aError),
|
||||
mPollTxFailureCounter, kMaxPollRetxAttempts);
|
||||
|
||||
if (mPollTxFailureCounter < kMaxPollRetxAttempts)
|
||||
@@ -266,7 +266,7 @@ void DataPollManager::HandlePollTimeout(void)
|
||||
|
||||
mPollTimeoutCounter++;
|
||||
|
||||
otLogInfoMac(GetInstance(), "Data poll timeout, retry:%d/%d", mPollTimeoutCounter, kQuickPollsAfterTimeout);
|
||||
otLogInfoMac("Data poll timeout, retry:%d/%d", mPollTimeoutCounter, kQuickPollsAfterTimeout);
|
||||
|
||||
if (mPollTimeoutCounter < kQuickPollsAfterTimeout)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,7 @@ void EnergyScanServer::HandleRequest(Coap::Header &aHeader, Message &aMessage, c
|
||||
if (aHeader.IsConfirmable() && !aMessageInfo.GetSockAddr().IsMulticast())
|
||||
{
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, responseInfo));
|
||||
otLogInfoMeshCoP(GetInstance(), "sent energy scan query response");
|
||||
otLogInfoMeshCoP("sent energy scan query response");
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -213,7 +213,7 @@ otError EnergyScanServer::SendReport(void)
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = GetNetif().GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent scan results");
|
||||
otLogInfoMeshCoP("sent scan results");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -1691,21 +1691,20 @@ void MeshForwarder::LogIp6SourceDestAddresses(Ip6::Header &aIp6Header,
|
||||
{
|
||||
if (aSourcePort != 0)
|
||||
{
|
||||
otLogMac(GetInstance(), aLogLevel, "\tsrc:[%s]:%d", aIp6Header.GetSource().ToString().AsCString(), aSourcePort);
|
||||
otLogMac(aLogLevel, "\tsrc:[%s]:%d", aIp6Header.GetSource().ToString().AsCString(), aSourcePort);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogMac(GetInstance(), aLogLevel, "\tsrc:[%s]", aIp6Header.GetSource().ToString().AsCString());
|
||||
otLogMac(aLogLevel, "\tsrc:[%s]", aIp6Header.GetSource().ToString().AsCString());
|
||||
}
|
||||
|
||||
if (aDestPort != 0)
|
||||
{
|
||||
otLogMac(GetInstance(), aLogLevel, "\tdst:[%s]:%d", aIp6Header.GetDestination().ToString().AsCString(),
|
||||
aDestPort);
|
||||
otLogMac(aLogLevel, "\tdst:[%s]:%d", aIp6Header.GetDestination().ToString().AsCString(), aDestPort);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogMac(GetInstance(), aLogLevel, "\tdst:[%s]", aIp6Header.GetDestination().ToString().AsCString());
|
||||
otLogMac(aLogLevel, "\tdst:[%s]", aIp6Header.GetDestination().ToString().AsCString());
|
||||
}
|
||||
}
|
||||
#else
|
||||
@@ -1730,7 +1729,7 @@ void MeshForwarder::LogIp6Message(MessageAction aAction,
|
||||
|
||||
shouldLogRss = (aAction == kMessageReceive) || (aAction == kMessageReassemblyDrop);
|
||||
|
||||
otLogMac(GetInstance(), aLogLevel, "%s IPv6 %s msg, len:%d, chksum:%04x%s%s, sec:%s%s%s, prio:%s%s%s",
|
||||
otLogMac(aLogLevel, "%s IPv6 %s msg, len:%d, chksum:%04x%s%s, sec:%s%s%s, prio:%s%s%s",
|
||||
MessageActionToString(aAction, aError), Ip6::Ip6::IpProtoToString(ip6Header.GetNextHeader()),
|
||||
aMessage.GetLength(), checksum,
|
||||
(aMacAddress == NULL) ? "" : ((aAction == kMessageReceive) ? ", from:" : ", to:"),
|
||||
@@ -1796,12 +1795,12 @@ void MeshForwarder::LogFrame(const char *aActionText, const Mac::Frame &aFrame,
|
||||
{
|
||||
if (aError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogNoteMac(GetInstance(), "%s, aError:%s, %s", aActionText, otThreadErrorToString(aError),
|
||||
otLogNoteMac("%s, aError:%s, %s", aActionText, otThreadErrorToString(aError),
|
||||
aFrame.ToInfoString().AsCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "%s, %s", aActionText, aFrame.ToInfoString().AsCString());
|
||||
otLogInfoMac("%s, %s", aActionText, aFrame.ToInfoString().AsCString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1812,8 +1811,7 @@ void MeshForwarder::LogFragmentFrameDrop(otError aError,
|
||||
const Lowpan::FragmentHeader &aFragmentHeader,
|
||||
bool aIsSecure)
|
||||
{
|
||||
otLogNoteMac(GetInstance(),
|
||||
"Dropping rx frag frame, error:%s, len:%d, src:%s, dst:%s, tag:%d, offset:%d, dglen:%d, sec:%s",
|
||||
otLogNoteMac("Dropping rx frag frame, error:%s, len:%d, src:%s, dst:%s, tag:%d, offset:%d, dglen:%d, sec:%s",
|
||||
otThreadErrorToString(aError), aFrameLength, aMacSource.ToString().AsCString(),
|
||||
aMacDest.ToString().AsCString(), aFragmentHeader.GetDatagramTag(), aFragmentHeader.GetDatagramOffset(),
|
||||
aFragmentHeader.GetDatagramSize(), aIsSecure ? "yes" : "no");
|
||||
@@ -1825,9 +1823,9 @@ void MeshForwarder::LogLowpanHcFrameDrop(otError aError,
|
||||
const Mac::Address &aMacDest,
|
||||
bool aIsSecure)
|
||||
{
|
||||
otLogNoteMac(GetInstance(), "Dropping rx lowpan HC frame, error:%s, len:%d, src:%s, dst:%s, sec:%s",
|
||||
otThreadErrorToString(aError), aFrameLength, aMacSource.ToString().AsCString(),
|
||||
aMacDest.ToString().AsCString(), aIsSecure ? "yes" : "no");
|
||||
otLogNoteMac("Dropping rx lowpan HC frame, error:%s, len:%d, src:%s, dst:%s, sec:%s", otThreadErrorToString(aError),
|
||||
aFrameLength, aMacSource.ToString().AsCString(), aMacDest.ToString().AsCString(),
|
||||
aIsSecure ? "yes" : "no");
|
||||
}
|
||||
|
||||
#else // #if (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO) && (OPENTHREAD_CONFIG_LOG_MAC == 1)
|
||||
|
||||
@@ -579,8 +579,7 @@ void MeshForwarder::HandleDataRequest(const Mac::Address &aMacSource, const otTh
|
||||
|
||||
mScheduleTransmissionTask.Post();
|
||||
|
||||
otLogInfoMac(GetInstance(), "Rx data poll, src:0x%04x, qed_msgs:%d, rss:%d", child->GetRloc16(), indirectMsgCount,
|
||||
aLinkInfo.mRss);
|
||||
otLogInfoMac("Rx data poll, src:0x%04x, qed_msgs:%d, rss:%d", child->GetRloc16(), indirectMsgCount, aLinkInfo.mRss);
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -624,7 +623,7 @@ void MeshForwarder::HandleSentFrameToChild(const Mac::Frame &aFrame, otError aEr
|
||||
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
|
||||
case OT_ERROR_ABORT:
|
||||
|
||||
otLogInfoMac(GetInstance(), "Indirect tx to child %04x failed, attempt %d/%d, error:%s", child->GetRloc16(),
|
||||
otLogInfoMac("Indirect tx to child %04x failed, attempt %d/%d, error:%s", child->GetRloc16(),
|
||||
child->GetIndirectTxAttempts(), kMaxPollTriggeredTxAttempts, otThreadErrorToString(aError));
|
||||
|
||||
if (child->GetIndirectTxAttempts() < kMaxPollTriggeredTxAttempts)
|
||||
@@ -985,9 +984,8 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoMac(GetInstance(), "Dropping rx mesh frame, error:%s, len:%d, src:%s, sec:%s",
|
||||
otThreadErrorToString(error), aFrameLength, aMacSource.ToString().AsCString(),
|
||||
aLinkInfo.mLinkSecurity ? "yes" : "no");
|
||||
otLogInfoMac("Dropping rx mesh frame, error:%s, len:%d, src:%s, sec:%s", otThreadErrorToString(error),
|
||||
aFrameLength, aMacSource.ToString().AsCString(), aLinkInfo.mLinkSecurity ? "yes" : "no");
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
@@ -1117,7 +1115,7 @@ otError MeshForwarder::LogMeshFragmentHeader(MessageAction aAction,
|
||||
shouldLogRss = (aAction == kMessageReceive) || (aAction == kMessageReassemblyDrop);
|
||||
|
||||
otLogMac(
|
||||
GetInstance(), aLogLevel, "%s mesh frame, len:%d%s%s, msrc:%s, mdst:%s, hops:%d, frag:%s, sec:%s%s%s%s%s",
|
||||
aLogLevel, "%s mesh frame, len:%d%s%s, msrc:%s, mdst:%s, hops:%d, frag:%s, sec:%s%s%s%s%s",
|
||||
MessageActionToString(aAction, aError), aMessage.GetLength(),
|
||||
(aMacAddress == NULL) ? "" : ((aAction == kMessageReceive) ? ", from:" : ", to:"),
|
||||
(aMacAddress == NULL) ? "" : aMacAddress->ToString().AsCString(), aMeshSource.ToString().AsCString(),
|
||||
@@ -1128,7 +1126,7 @@ otError MeshForwarder::LogMeshFragmentHeader(MessageAction aAction,
|
||||
|
||||
if (hasFragmentHeader)
|
||||
{
|
||||
otLogMac(GetInstance(), aLogLevel, "\tFrag tag:%04x, offset:%d, size:%d", fragmentHeader.GetDatagramTag(),
|
||||
otLogMac(aLogLevel, "\tFrag tag:%04x, offset:%d, size:%d", fragmentHeader.GetDatagramTag(),
|
||||
fragmentHeader.GetDatagramOffset(), fragmentHeader.GetDatagramSize());
|
||||
|
||||
VerifyOrExit(fragmentHeader.GetDatagramOffset() == 0);
|
||||
@@ -1227,8 +1225,8 @@ void MeshForwarder::LogMeshIpHeader(const Message & aMessage,
|
||||
SuccessOrExit(DecompressIp6UdpTcpHeader(aMessage, aOffset, aMeshSource, aMeshDest, ip6Header, checksum, sourcePort,
|
||||
destPort));
|
||||
|
||||
otLogMac(GetInstance(), aLogLevel, "\tIPv6 %s msg, chksum:%04x, prio:%s",
|
||||
Ip6::Ip6::IpProtoToString(ip6Header.GetNextHeader()), checksum, MessagePriorityToString(aMessage));
|
||||
otLogMac(aLogLevel, "\tIPv6 %s msg, chksum:%04x, prio:%s", Ip6::Ip6::IpProtoToString(ip6Header.GetNextHeader()),
|
||||
checksum, MessagePriorityToString(aMessage));
|
||||
|
||||
LogIp6SourceDestAddresses(ip6Header, sourcePort, destPort, aLogLevel);
|
||||
|
||||
|
||||
+33
-34
@@ -303,7 +303,7 @@ void Mle::SetRole(otDeviceRole aRole)
|
||||
{
|
||||
VerifyOrExit(aRole != mRole, GetNotifier().SignalIfFirst(OT_CHANGED_THREAD_ROLE));
|
||||
|
||||
otLogNoteMle(GetInstance(), "Role %s -> %s", RoleToString(mRole), RoleToString(aRole));
|
||||
otLogNoteMle("Role %s -> %s", RoleToString(mRole), RoleToString(aRole));
|
||||
|
||||
mRole = aRole;
|
||||
GetNotifier().Signal(OT_CHANGED_THREAD_ROLE);
|
||||
@@ -346,7 +346,7 @@ exit:
|
||||
void Mle::SetAttachState(AttachState aState)
|
||||
{
|
||||
VerifyOrExit(aState != mAttachState);
|
||||
otLogInfoMle(GetInstance(), "AttachState %s -> %s", AttachStateToString(mAttachState), AttachStateToString(aState));
|
||||
otLogInfoMle("AttachState %s -> %s", AttachStateToString(mAttachState), AttachStateToString(aState));
|
||||
mAttachState = aState;
|
||||
|
||||
exit:
|
||||
@@ -406,7 +406,7 @@ otError Mle::Restore(void)
|
||||
// setting by skipping the re-attach ("Child Update Request"
|
||||
// exchange) and going through the full attach process.
|
||||
|
||||
otLogWarnMle(GetInstance(), "Invalid settings - no saved parent info with valid end-device RLOC16 0x%04x",
|
||||
otLogWarnMle("Invalid settings - no saved parent info with valid end-device RLOC16 0x%04x",
|
||||
networkInfo.mRloc16);
|
||||
ExitNow();
|
||||
}
|
||||
@@ -481,7 +481,7 @@ otError Mle::Store(void)
|
||||
netif.GetKeyManager().SetStoredMleFrameCounter(networkInfo.mMleFrameCounter);
|
||||
netif.GetKeyManager().SetStoredMacFrameCounter(networkInfo.mMacFrameCounter);
|
||||
|
||||
otLogDebgMle(GetInstance(), "Store Network Information");
|
||||
otLogDebgMle("Store Network Information");
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -683,8 +683,8 @@ uint32_t Mle::GetAttachStartDelay(void) const
|
||||
delay += jitter;
|
||||
}
|
||||
|
||||
otLogNoteMle(GetInstance(), "Attach attempt %d unsuccessful, will try again in %u.%03u seconds", mAttachCounter,
|
||||
delay / 1000, delay % 1000);
|
||||
otLogNoteMle("Attach attempt %d unsuccessful, will try again in %u.%03u seconds", mAttachCounter, delay / 1000,
|
||||
delay % 1000);
|
||||
|
||||
exit:
|
||||
return delay;
|
||||
@@ -813,8 +813,8 @@ otError Mle::SetDeviceMode(uint8_t aDeviceMode)
|
||||
error = OT_ERROR_INVALID_ARGS);
|
||||
VerifyOrExit(mDeviceMode != aDeviceMode);
|
||||
|
||||
otLogNoteMle(GetInstance(), "Mode 0x%02x -> 0x%02x [rx-on:%s, sec-data-req:%s, ftd:%s, full-netdata:%s]",
|
||||
mDeviceMode, aDeviceMode, (aDeviceMode & ModeTlv::kModeRxOnWhenIdle) ? "yes" : " no",
|
||||
otLogNoteMle("Mode 0x%02x -> 0x%02x [rx-on:%s, sec-data-req:%s, ftd:%s, full-netdata:%s]", mDeviceMode, aDeviceMode,
|
||||
(aDeviceMode & ModeTlv::kModeRxOnWhenIdle) ? "yes" : " no",
|
||||
(aDeviceMode & ModeTlv::kModeSecureDataRequest) ? "yes" : " no",
|
||||
(aDeviceMode & ModeTlv::kModeFullThreadDevice) ? "yes" : "no",
|
||||
(aDeviceMode & ModeTlv::kModeFullNetworkData) ? "yes" : "no");
|
||||
@@ -1609,12 +1609,12 @@ void Mle::HandleAttachTimer(void)
|
||||
case kAttachStateStart:
|
||||
if (mAttachCounter > 0)
|
||||
{
|
||||
otLogNoteMle(GetInstance(), "Attempt to attach - attempt %d, %s %s", mAttachCounter,
|
||||
otLogNoteMle("Attempt to attach - attempt %d, %s %s", mAttachCounter,
|
||||
AttachModeToString(mParentRequestMode), ReattachStateToString(mReattachState));
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogNoteMle(GetInstance(), "Attempt to attach - %s %s", AttachModeToString(mParentRequestMode),
|
||||
otLogNoteMle("Attempt to attach - %s %s", AttachModeToString(mParentRequestMode),
|
||||
ReattachStateToString(mReattachState));
|
||||
}
|
||||
|
||||
@@ -1944,7 +1944,7 @@ otError Mle::SendChildIdRequest(void)
|
||||
{
|
||||
if (mRole == OT_DEVICE_ROLE_CHILD)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Already attached to candidate parent");
|
||||
otLogInfoMle("Already attached to candidate parent");
|
||||
ExitNow(error = OT_ERROR_ALREADY);
|
||||
}
|
||||
else
|
||||
@@ -2173,7 +2173,7 @@ otError Mle::SendChildUpdateRequest(void)
|
||||
|
||||
if (!mParent.IsStateValidOrRestoring())
|
||||
{
|
||||
otLogWarnMle(GetInstance(), "No valid parent when sending Child Update Request");
|
||||
otLogWarnMle("No valid parent when sending Child Update Request");
|
||||
BecomeDetached();
|
||||
ExitNow();
|
||||
}
|
||||
@@ -2347,7 +2347,7 @@ otError Mle::SendAnnounce(uint8_t aChannel, bool aOrphanAnnounce, const Ip6::Add
|
||||
SuccessOrExit(error = message->Append(&panid, sizeof(panid)));
|
||||
SuccessOrExit(error = SendMessage(*message, aDestination));
|
||||
|
||||
otLogInfoMle(GetInstance(), "Send Announce on channel %d", aChannel);
|
||||
otLogInfoMle("Send Announce on channel %d", aChannel);
|
||||
|
||||
exit:
|
||||
|
||||
@@ -2630,7 +2630,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
{
|
||||
if (frameCounter < neighbor->GetMleFrameCounter())
|
||||
{
|
||||
otLogDebgMle(GetInstance(), "mle frame reject 1");
|
||||
otLogDebgMle("mle frame reject 1");
|
||||
ExitNow();
|
||||
}
|
||||
}
|
||||
@@ -2638,7 +2638,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
{
|
||||
if (keySequence <= neighbor->GetKeySequence())
|
||||
{
|
||||
otLogDebgMle(GetInstance(), "mle frame reject 2");
|
||||
otLogDebgMle("mle frame reject 2");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -2656,7 +2656,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
command == Header::kCommandChildIdRequest || command == Header::kCommandChildUpdateRequest ||
|
||||
command == Header::kCommandChildUpdateResponse || command == Header::kCommandAnnounce))
|
||||
{
|
||||
otLogDebgMle(GetInstance(), "mle sequence unknown! %d", command);
|
||||
otLogDebgMle("mle sequence unknown! %d", command);
|
||||
ExitNow();
|
||||
}
|
||||
}
|
||||
@@ -2852,7 +2852,7 @@ otError Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageInfo
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Data Response");
|
||||
otLogWarnMleErr(error, "Failed to process Data Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -3266,7 +3266,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Parent Response");
|
||||
otLogWarnMleErr(error, "Failed to process Parent Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -3388,7 +3388,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Child ID Response");
|
||||
otLogWarnMleErr(error, "Failed to process Child ID Response");
|
||||
}
|
||||
|
||||
OT_UNUSED_VARIABLE(aMessageInfo);
|
||||
@@ -3565,7 +3565,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Child Update Response");
|
||||
otLogWarnMleErr(error, "Failed to process Child Update Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -3618,7 +3618,7 @@ otError Mle::HandleAnnounce(const Message &aMessage, const Ip6::MessageInfo &aMe
|
||||
SetAttachState(kAttachStateProcessAnnounce);
|
||||
mAttachTimer.Start(kAnnounceProcessTimeout);
|
||||
|
||||
otLogNoteMle(GetInstance(), "Delay processing Announce - channel %d, panid 0x%02x", channel, panId);
|
||||
otLogNoteMle("Delay processing Announce - channel %d, panid 0x%02x", channel, panId);
|
||||
}
|
||||
else if (localTimestamp->Compare(timestamp) < 0)
|
||||
{
|
||||
@@ -3649,7 +3649,7 @@ void Mle::ProcessAnnounce(void)
|
||||
|
||||
assert(mAttachState == kAttachStateProcessAnnounce);
|
||||
|
||||
otLogNoteMle(GetInstance(), "Processing Announce - channel %d, panid 0x%02x", newChannel, newPanId);
|
||||
otLogNoteMle("Processing Announce - channel %d, panid 0x%02x", newChannel, newPanId);
|
||||
|
||||
Stop(/* aClearNetworkDatasets */ false);
|
||||
|
||||
@@ -3780,7 +3780,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Discovery Response");
|
||||
otLogWarnMleErr(error, "Failed to process Discovery Response");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -3934,13 +3934,13 @@ otError Mle::InformPreviousParent(void)
|
||||
|
||||
SuccessOrExit(error = netif.GetIp6().SendDatagram(*message, messageInfo, Ip6::kProtoNone));
|
||||
|
||||
otLogNoteMle(GetInstance(), "Sending message to inform previous parent 0x%04x", mPreviousParentRloc);
|
||||
otLogNoteMle("Sending message to inform previous parent 0x%04x", mPreviousParentRloc);
|
||||
|
||||
exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMle(GetInstance(), "Failed to inform previous parent, error:%s", otThreadErrorToString(error));
|
||||
otLogWarnMle("Failed to inform previous parent, error:%s", otThreadErrorToString(error));
|
||||
|
||||
if (message != NULL)
|
||||
{
|
||||
@@ -3962,8 +3962,7 @@ void Mle::HandleParentSearchTimer(void)
|
||||
{
|
||||
int8_t parentRss;
|
||||
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: %s interval passed",
|
||||
mParentSearchIsInBackoff ? "Backoff" : "Check");
|
||||
otLogInfoMle("PeriodicParentSearch: %s interval passed", mParentSearchIsInBackoff ? "Backoff" : "Check");
|
||||
|
||||
if (mParentSearchBackoffWasCanceled)
|
||||
{
|
||||
@@ -3974,7 +3973,7 @@ void Mle::HandleParentSearchTimer(void)
|
||||
if (TimerMilli::GetNow() - mParentSearchBackoffCancelTime >= kParentSearchBackoffInterval)
|
||||
{
|
||||
mParentSearchBackoffWasCanceled = false;
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: Backoff cancellation is allowed on parent switch");
|
||||
otLogInfoMle("PeriodicParentSearch: Backoff cancellation is allowed on parent switch");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3983,12 +3982,12 @@ void Mle::HandleParentSearchTimer(void)
|
||||
VerifyOrExit(mRole == OT_DEVICE_ROLE_CHILD);
|
||||
|
||||
parentRss = GetParent()->GetLinkInfo().GetAverageRss();
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: Parent RSS %d", parentRss);
|
||||
otLogInfoMle("PeriodicParentSearch: Parent RSS %d", parentRss);
|
||||
VerifyOrExit(parentRss != OT_RADIO_RSSI_INVALID);
|
||||
|
||||
if (parentRss < kParentSearchRssThreadhold)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: Parent RSS less than %d, searching for new parents",
|
||||
otLogInfoMle("PeriodicParentSearch: Parent RSS less than %d, searching for new parents",
|
||||
kParentSearchRssThreadhold);
|
||||
mParentSearchIsInBackoff = true;
|
||||
BecomeChild(kAttachAny);
|
||||
@@ -4015,7 +4014,7 @@ void Mle::StartParentSearchTimer(void)
|
||||
|
||||
mParentSearchTimer.Start(interval);
|
||||
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: (Re)starting timer for %s interval",
|
||||
otLogInfoMle("PeriodicParentSearch: (Re)starting timer for %s interval",
|
||||
mParentSearchIsInBackoff ? "backoff" : "check");
|
||||
}
|
||||
|
||||
@@ -4045,7 +4044,7 @@ void Mle::UpdateParentSearchState(void)
|
||||
mParentSearchIsInBackoff = false;
|
||||
mParentSearchBackoffWasCanceled = true;
|
||||
mParentSearchBackoffCancelTime = TimerMilli::GetNow();
|
||||
otLogInfoMle(GetInstance(), "PeriodicParentSearch: Canceling backoff on switching to a new parent");
|
||||
otLogInfoMle("PeriodicParentSearch: Canceling backoff on switching to a new parent");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4062,7 +4061,7 @@ void Mle::UpdateParentSearchState(void)
|
||||
|
||||
void Mle::LogMleMessage(const char *aLogString, const Ip6::Address &aAddress) const
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "%s (%s)", aLogString, aAddress.ToString().AsCString());
|
||||
otLogInfoMle("%s (%s)", aLogString, aAddress.ToString().AsCString());
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogString);
|
||||
OT_UNUSED_VARIABLE(aAddress);
|
||||
@@ -4070,7 +4069,7 @@ void Mle::LogMleMessage(const char *aLogString, const Ip6::Address &aAddress) co
|
||||
|
||||
void Mle::LogMleMessage(const char *aLogString, const Ip6::Address &aAddress, uint16_t aRloc) const
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "%s (%s,0x%04x)", aLogString, aAddress.ToString().AsCString(), aRloc);
|
||||
otLogInfoMle("%s (%s,0x%04x)", aLogString, aAddress.ToString().AsCString(), aRloc);
|
||||
|
||||
OT_UNUSED_VARIABLE(aLogString);
|
||||
OT_UNUSED_VARIABLE(aAddress);
|
||||
|
||||
@@ -140,7 +140,7 @@ otError MleRouter::BecomeRouter(ThreadStatusTlv::Status aStatus)
|
||||
VerifyOrExit(mRole != OT_DEVICE_ROLE_ROUTER, error = OT_ERROR_NONE);
|
||||
VerifyOrExit(IsRouterRoleEnabled(), error = OT_ERROR_NOT_CAPABLE);
|
||||
|
||||
otLogInfoMle(GetInstance(), "Attempt to become router");
|
||||
otLogInfoMle("Attempt to become router");
|
||||
|
||||
netif.GetMeshForwarder().SetRxOnWhenIdle(true);
|
||||
mRouterSelectionJitterTimeout = 0;
|
||||
@@ -374,7 +374,7 @@ otError MleRouter::SetStateLeader(uint16_t aRloc16)
|
||||
}
|
||||
}
|
||||
|
||||
otLogNoteMle(GetInstance(), "Leader partition id 0x%x", mLeaderData.GetPartitionId());
|
||||
otLogNoteMle("Leader partition id 0x%x", mLeaderData.GetPartitionId());
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
@@ -1203,7 +1203,7 @@ otError MleRouter::HandleAdvertisement(const Message &aMessage, const Ip6::Messa
|
||||
|
||||
if (partitionId != mLeaderData.GetPartitionId())
|
||||
{
|
||||
otLogNoteMle(GetInstance(), "Different partition (peer:%d, local:%d)", leaderData.GetPartitionId(),
|
||||
otLogNoteMle("Different partition (peer:%d, local:%d)", leaderData.GetPartitionId(),
|
||||
mLeaderData.GetPartitionId());
|
||||
|
||||
VerifyOrExit(linkMargin >= OPENTHREAD_CONFIG_MLE_PARTITION_MERGE_MARGIN_MIN, error = OT_ERROR_LINK_MARGIN_LOW);
|
||||
@@ -1236,7 +1236,7 @@ otError MleRouter::HandleAdvertisement(const Message &aMessage, const Ip6::Messa
|
||||
{
|
||||
if (mRole != OT_DEVICE_ROLE_CHILD)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Leader ID mismatch");
|
||||
otLogInfoMle("Leader ID mismatch");
|
||||
BecomeDetached();
|
||||
error = OT_ERROR_DROP;
|
||||
}
|
||||
@@ -1550,13 +1550,13 @@ void MleRouter::UpdateRoutes(const RouteTlv &aRoute, uint8_t aRouterId)
|
||||
#if (OPENTHREAD_CONFIG_LOG_MLE && (OPENTHREAD_CONFIG_LOG_LEVEL >= OT_LOG_LEVEL_INFO))
|
||||
|
||||
VerifyOrExit(changed);
|
||||
otLogInfoMle(GetInstance(), "Route table updated");
|
||||
otLogInfoMle("Route table updated");
|
||||
|
||||
for (RouterTable::Iterator iter(GetInstance()); !iter.IsDone(); iter++)
|
||||
{
|
||||
Router &router = *iter.GetRouter();
|
||||
|
||||
otLogInfoMle(GetInstance(), "\t%04x -> %04x, cost:%d %d, lqin:%d, lqout:%d", router.GetRloc16(),
|
||||
otLogInfoMle("\t%04x -> %04x, cost:%d %d, lqin:%d, lqout:%d", router.GetRloc16(),
|
||||
GetRloc16(router.GetNextHop()), router.GetCost(), mRouterTable.GetLinkCost(router),
|
||||
router.GetLinkInfo().GetLinkQuality(), router.GetLinkQualityOut());
|
||||
}
|
||||
@@ -1754,18 +1754,18 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
|
||||
case OT_DEVICE_ROLE_ROUTER:
|
||||
// verify path to leader
|
||||
otLogDebgMle(GetInstance(), "network id timeout = %d", mRouterTable.GetLeaderAge());
|
||||
otLogDebgMle("network id timeout = %d", mRouterTable.GetLeaderAge());
|
||||
|
||||
if ((mRouterTable.GetActiveRouterCount() > 0) && (mRouterTable.GetLeaderAge() >= mNetworkIdTimeout))
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Router ID Sequence timeout");
|
||||
otLogInfoMle("Router ID Sequence timeout");
|
||||
BecomeChild(kAttachSame1);
|
||||
}
|
||||
|
||||
if (routerStateUpdate && mRouterTable.GetActiveRouterCount() > mRouterDowngradeThreshold)
|
||||
{
|
||||
// downgrade to REED
|
||||
otLogNoteMle(GetInstance(), "Downgrade to REED");
|
||||
otLogNoteMle("Downgrade to REED");
|
||||
BecomeChild(kAttachSameDowngrade);
|
||||
}
|
||||
|
||||
@@ -1802,7 +1802,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
|
||||
if ((TimerMilli::GetNow() - child.GetLastHeard()) >= timeout)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Child timeout expired");
|
||||
otLogInfoMle("Child timeout expired");
|
||||
RemoveNeighbor(child);
|
||||
}
|
||||
else if ((mRole == OT_DEVICE_ROLE_ROUTER || mRole == OT_DEVICE_ROLE_LEADER) &&
|
||||
@@ -1832,7 +1832,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
|
||||
if (age >= TimerMilli::SecToMsec(kMaxNeighborAge))
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Router timeout expired");
|
||||
otLogInfoMle("Router timeout expired");
|
||||
RemoveNeighbor(router);
|
||||
continue;
|
||||
}
|
||||
@@ -1843,7 +1843,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
{
|
||||
if (age < TimerMilli::SecToMsec(kMaxNeighborAge) + kMaxTransmissionCount * kUnicastRetransmissionDelay)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Router timeout expired");
|
||||
otLogInfoMle("Router timeout expired");
|
||||
SendLinkRequest(&router);
|
||||
}
|
||||
else
|
||||
@@ -1859,7 +1859,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
{
|
||||
if (age >= kMaxLinkRequestTimeout)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Link Request timeout expired");
|
||||
otLogInfoMle("Link Request timeout expired");
|
||||
RemoveNeighbor(router);
|
||||
continue;
|
||||
}
|
||||
@@ -1871,7 +1871,7 @@ void MleRouter::HandleStateUpdateTimer(void)
|
||||
mRouterTable.GetLinkCost(router) >= kMaxRouteCost &&
|
||||
age >= TimerMilli::SecToMsec(kMaxLeaderToRouterTimeout))
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Router ID timeout expired (no route)");
|
||||
otLogInfoMle("Router ID timeout expired (no route)");
|
||||
mRouterTable.Release(router.GetRouterId());
|
||||
}
|
||||
}
|
||||
@@ -1988,8 +1988,8 @@ otError MleRouter::UpdateChildAddresses(const Message &aMessage, uint16_t aOffse
|
||||
{
|
||||
if (GetNetif().GetNetworkDataLeader().GetContext(entry.GetContextId(), context) != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMle(GetInstance(), "Failed to get context %d for compressed address from child 0x%04x",
|
||||
entry.GetContextId(), aChild.GetRloc16());
|
||||
otLogWarnMle("Failed to get context %d for compressed address from child 0x%04x", entry.GetContextId(),
|
||||
aChild.GetRloc16());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2009,12 +2009,12 @@ otError MleRouter::UpdateChildAddresses(const Message &aMessage, uint16_t aOffse
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
storedCount++;
|
||||
otLogInfoMle(GetInstance(), "Child 0x%04x IPv6 address[%d]=%s", aChild.GetRloc16(), storedCount,
|
||||
otLogInfoMle("Child 0x%04x IPv6 address[%d]=%s", aChild.GetRloc16(), storedCount,
|
||||
address.ToString().AsCString());
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnMle(GetInstance(), "Error %s adding IPv6 address %s to child 0x%04x", otThreadErrorToString(error),
|
||||
otLogWarnMle("Error %s adding IPv6 address %s to child 0x%04x", otThreadErrorToString(error),
|
||||
address.ToString().AsCString(), aChild.GetRloc16());
|
||||
}
|
||||
|
||||
@@ -2046,13 +2046,12 @@ otError MleRouter::UpdateChildAddresses(const Message &aMessage, uint16_t aOffse
|
||||
|
||||
if (registeredCount == 0)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Child 0x%04x has no registered IPv6 address", aChild.GetRloc16());
|
||||
otLogInfoMle("Child 0x%04x has no registered IPv6 address", aChild.GetRloc16());
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Child 0x%04x has %d registered IPv6 address%s, %d address%s stored",
|
||||
aChild.GetRloc16(), registeredCount, (registeredCount == 1) ? "" : "es", storedCount,
|
||||
(storedCount == 1) ? "" : "es");
|
||||
otLogInfoMle("Child 0x%04x has %d registered IPv6 address%s, %d address%s stored", aChild.GetRloc16(),
|
||||
registeredCount, (registeredCount == 1) ? "" : "es", storedCount, (storedCount == 1) ? "" : "es");
|
||||
}
|
||||
|
||||
error = OT_ERROR_NONE;
|
||||
@@ -2273,8 +2272,7 @@ otError MleRouter::HandleChildUpdateRequest(const Message & aMessage,
|
||||
|
||||
if (child->GetDeviceMode() != mode.GetMode())
|
||||
{
|
||||
otLogNoteMle(GetInstance(),
|
||||
"Child 0x%04x mode change 0x%02x -> 0x%02x [rx-on:%s, sec-data-req:%s, ftd:%s, full-netdata:%s]",
|
||||
otLogNoteMle("Child 0x%04x mode change 0x%02x -> 0x%02x [rx-on:%s, sec-data-req:%s, ftd:%s, full-netdata:%s]",
|
||||
child->GetRloc16(), child->GetDeviceMode(), mode.GetMode(),
|
||||
(mode.GetMode() & ModeTlv::kModeRxOnWhenIdle) ? "yes" : " no",
|
||||
(mode.GetMode() & ModeTlv::kModeSecureDataRequest) ? "yes" : " no",
|
||||
@@ -2702,7 +2700,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnMleErr(GetInstance(), error, "Failed to process Discovery Request");
|
||||
otLogWarnMleErr(error, "Failed to process Discovery Request");
|
||||
}
|
||||
|
||||
return error;
|
||||
@@ -3063,7 +3061,7 @@ otError MleRouter::SendDataResponse(const Ip6::Address &aDestination,
|
||||
|
||||
if (mRetrieveNewNetworkData)
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "Suppressing Data Response - waiting for new network data");
|
||||
otLogInfoMle("Suppressing Data Response - waiting for new network data");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -4098,7 +4096,7 @@ void MleRouter::HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, c
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "router id requested and provided!");
|
||||
otLogInfoMle("router id requested and provided!");
|
||||
}
|
||||
|
||||
if (router != NULL)
|
||||
@@ -4107,7 +4105,7 @@ void MleRouter::HandleAddressSolicit(Coap::Header &aHeader, Message &aMessage, c
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoMle(GetInstance(), "router address unavailable!");
|
||||
otLogInfoMle("router address unavailable!");
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
@@ -566,7 +566,7 @@ void NetworkData::RemoveTemporaryData(uint8_t *aData, uint8_t &aDataLength)
|
||||
continue;
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove prefix done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove prefix done", mTlvs, mLength);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ void NetworkData::RemoveTemporaryData(uint8_t *aData, uint8_t &aDataLength)
|
||||
continue;
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove service done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove service done", mTlvs, mLength);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ void NetworkData::RemoveTemporaryData(uint8_t *aData, uint8_t &aDataLength)
|
||||
cur = cur->GetNext();
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove done", aData, aDataLength);
|
||||
otDumpDebgNetData("remove done", aData, aDataLength);
|
||||
}
|
||||
|
||||
void NetworkData::RemoveTemporaryData(uint8_t *aData, uint8_t &aDataLength, PrefixTlv &aPrefix)
|
||||
@@ -1041,7 +1041,7 @@ otError NetworkData::SendServerDataNotification(uint16_t aRloc16)
|
||||
mLastAttemptWait = true;
|
||||
}
|
||||
|
||||
otLogInfoNetData(GetInstance(), "Sent server data notification");
|
||||
otLogInfoNetData("Sent server data notification");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -429,7 +429,7 @@ otError LeaderBase::SetNetworkData(uint8_t aVersion,
|
||||
RemoveTemporaryData(mTlvs, mLength);
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "set network data", mTlvs, mLength);
|
||||
otDumpDebgNetData("set network data", mTlvs, mLength);
|
||||
|
||||
GetNotifier().Signal(OT_CHANGED_THREAD_NETDATA);
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void Leader::HandleServerData(Coap::Header &aHeader, Message &aMessage, const Ip
|
||||
ThreadNetworkDataTlv networkData;
|
||||
ThreadRloc16Tlv rloc16;
|
||||
|
||||
otLogInfoNetData(GetInstance(), "Received network data registration");
|
||||
otLogInfoNetData("Received network data registration");
|
||||
|
||||
if (ThreadTlv::GetTlv(aMessage, ThreadTlv::kRloc16, sizeof(rloc16), rloc16) == OT_ERROR_NONE)
|
||||
{
|
||||
@@ -180,7 +180,7 @@ void Leader::HandleServerData(Coap::Header &aHeader, Message &aMessage, const Ip
|
||||
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, aMessageInfo));
|
||||
|
||||
otLogInfoNetData(GetInstance(), "Sent network data registration acknowledgment");
|
||||
otLogInfoNetData("Sent network data registration acknowledgment");
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -391,7 +391,7 @@ void Leader::SendCommissioningGetResponse(const Coap::Header & aRequestHeader
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent commissioning dataset get response");
|
||||
otLogInfoMeshCoP("sent commissioning dataset get response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -423,7 +423,7 @@ void Leader::SendCommissioningSetResponse(const Coap::Header & aRequestHeade
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, aMessageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent commissioning dataset set response");
|
||||
otLogInfoMeshCoP("sent commissioning dataset set response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -831,14 +831,14 @@ otError Leader::AddNetworkData(uint8_t *aTlvs, uint8_t aTlvsLength, uint8_t *aOl
|
||||
{
|
||||
case NetworkDataTlv::kTypePrefix:
|
||||
SuccessOrExit(error = AddPrefix(*static_cast<PrefixTlv *>(cur)));
|
||||
otDumpDebgNetData(GetInstance(), "add prefix done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add prefix done", mTlvs, mLength);
|
||||
break;
|
||||
|
||||
#if OPENTHREAD_ENABLE_SERVICE
|
||||
|
||||
case NetworkDataTlv::kTypeService:
|
||||
SuccessOrExit(error = AddService(*static_cast<ServiceTlv *>(cur), aOldTlvs, aOldTlvsLength));
|
||||
otDumpDebgNetData(GetInstance(), "add service done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add service done", mTlvs, mLength);
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -854,7 +854,7 @@ otError Leader::AddNetworkData(uint8_t *aTlvs, uint8_t aTlvsLength, uint8_t *aOl
|
||||
OT_UNUSED_VARIABLE(aOldTlvsLength);
|
||||
#endif
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "add done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add done", mTlvs, mLength);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -1043,7 +1043,7 @@ otError Leader::AddServer(ServiceTlv &aService, ServerTlv &aServer, uint8_t *aOl
|
||||
}
|
||||
}
|
||||
|
||||
otLogInfoNetData(GetInstance(), "Allocated Service ID = %d", i);
|
||||
otLogInfoNetData("Allocated Service ID = %d", i);
|
||||
|
||||
VerifyOrExit(i <= Mle::kServiceMaxId, error = OT_ERROR_NO_BUFS);
|
||||
}
|
||||
@@ -1204,7 +1204,7 @@ int Leader::AllocateContext(void)
|
||||
{
|
||||
mContextUsed |= 1 << i;
|
||||
rval = i;
|
||||
otLogInfoNetData(GetInstance(), "Allocated Context ID = %d", rval);
|
||||
otLogInfoNetData("Allocated Context ID = %d", rval);
|
||||
ExitNow();
|
||||
}
|
||||
}
|
||||
@@ -1215,7 +1215,7 @@ exit:
|
||||
|
||||
otError Leader::FreeContext(uint8_t aContextId)
|
||||
{
|
||||
otLogInfoNetData(GetInstance(), "Free Context Id = %d", aContextId);
|
||||
otLogInfoNetData("Free Context Id = %d", aContextId);
|
||||
RemoveContext(aContextId);
|
||||
mContextUsed &= ~(1 << aContextId);
|
||||
mVersion++;
|
||||
@@ -1271,7 +1271,7 @@ otError Leader::RemoveRloc(uint16_t aRloc16, MatchMode aMatchMode)
|
||||
continue;
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove prefix done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove prefix done", mTlvs, mLength);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1288,7 +1288,7 @@ otError Leader::RemoveRloc(uint16_t aRloc16, MatchMode aMatchMode)
|
||||
continue;
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove service done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove service done", mTlvs, mLength);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1302,7 +1302,7 @@ otError Leader::RemoveRloc(uint16_t aRloc16, MatchMode aMatchMode)
|
||||
cur = cur->GetNext();
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove done", mTlvs, mLength);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
@@ -1492,7 +1492,7 @@ otError Leader::RemoveContext(uint8_t aContextId)
|
||||
continue;
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove prefix done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove prefix done", mTlvs, mLength);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1503,7 +1503,7 @@ otError Leader::RemoveContext(uint8_t aContextId)
|
||||
cur = cur->GetNext();
|
||||
}
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "remove done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove done", mTlvs, mLength);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ otError Local::AddOnMeshPrefix(const uint8_t *aPrefix, uint8_t aPrefixLength, in
|
||||
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "add prefix done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add prefix done", mTlvs, mLength);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -101,7 +101,7 @@ otError Local::RemoveOnMeshPrefix(const uint8_t *aPrefix, uint8_t aPrefixLength)
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
exit:
|
||||
otDumpDebgNetData(GetInstance(), "remove done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove done", mTlvs, mLength);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ otError Local::AddHasRoutePrefix(const uint8_t *aPrefix, uint8_t aPrefixLength,
|
||||
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "add route done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add route done", mTlvs, mLength);
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ otError Local::RemoveHasRoutePrefix(const uint8_t *aPrefix, uint8_t aPrefixLengt
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
exit:
|
||||
otDumpDebgNetData(GetInstance(), "remove done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove done", mTlvs, mLength);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ otError Local::AddService(uint32_t aEnterpriseNumber,
|
||||
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
otDumpDebgNetData(GetInstance(), "add service done", mTlvs, mLength);
|
||||
otDumpDebgNetData("add service done", mTlvs, mLength);
|
||||
|
||||
// exit:
|
||||
return error;
|
||||
@@ -211,7 +211,7 @@ otError Local::RemoveService(uint32_t aEnterpriseNumber, const uint8_t *aService
|
||||
ClearResubmitDelayTimer();
|
||||
|
||||
exit:
|
||||
otDumpDebgNetData(GetInstance(), "remove service done", mTlvs, mLength);
|
||||
otDumpDebgNetData("remove service done", mTlvs, mLength);
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -129,7 +129,7 @@ otError NetworkDiagnostic::SendDiagnosticGet(const Ip6::Address &aDestination,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo, handler, this));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic get");
|
||||
otLogInfoNetDiag("Sent diagnostic get");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -160,7 +160,7 @@ void NetworkDiagnostic::HandleDiagnosticGetResponse(Coap::Header & aHea
|
||||
VerifyOrExit(aResult == OT_ERROR_NONE);
|
||||
VerifyOrExit(aHeader.GetCode() == OT_COAP_CODE_CHANGED);
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic get response");
|
||||
otLogInfoNetDiag("Received diagnostic get response");
|
||||
|
||||
if (mReceiveDiagnosticGetCallback)
|
||||
{
|
||||
@@ -187,7 +187,7 @@ void NetworkDiagnostic::HandleDiagnosticGetAnswer(Coap::Header & aHeade
|
||||
{
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST);
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Diagnostic get answer received");
|
||||
otLogInfoNetDiag("Diagnostic get answer received");
|
||||
|
||||
if (mReceiveDiagnosticGetCallback)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ void NetworkDiagnostic::HandleDiagnosticGetAnswer(Coap::Header & aHeade
|
||||
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, aMessageInfo));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic answer acknowledgment");
|
||||
otLogInfoNetDiag("Sent diagnostic answer acknowledgment");
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -284,7 +284,7 @@ otError NetworkDiagnostic::FillRequestedTlvs(Message & aRequest,
|
||||
{
|
||||
VerifyOrExit(aRequest.Read(offset, sizeof(type), &type) == sizeof(type), error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Type %d", type);
|
||||
otLogInfoNetDiag("Type %d", type);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -468,7 +468,7 @@ void NetworkDiagnostic::HandleDiagnosticGetQuery(Coap::Header & aHeader
|
||||
|
||||
VerifyOrExit(aHeader.GetCode() == OT_COAP_CODE_POST, error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic get query");
|
||||
otLogInfoNetDiag("Received diagnostic get query");
|
||||
|
||||
VerifyOrExit((aMessage.Read(aMessage.GetOffset(), sizeof(NetworkDiagnosticTlv), &networkDiagnosticTlv) ==
|
||||
sizeof(NetworkDiagnosticTlv)),
|
||||
@@ -483,7 +483,7 @@ void NetworkDiagnostic::HandleDiagnosticGetQuery(Coap::Header & aHeader
|
||||
{
|
||||
if (netif.GetCoap().SendEmptyAck(aHeader, aMessageInfo) == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic get query acknowledgment");
|
||||
otLogInfoNetDiag("Sent diagnostic get query acknowledgment");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,7 +512,7 @@ void NetworkDiagnostic::HandleDiagnosticGetQuery(Coap::Header & aHeader
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo, NULL, this));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic get answer");
|
||||
otLogInfoNetDiag("Sent diagnostic get answer");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -546,7 +546,7 @@ void NetworkDiagnostic::HandleDiagnosticGetRequest(Coap::Header & aHead
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST,
|
||||
error = OT_ERROR_DROP);
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic get request");
|
||||
otLogInfoNetDiag("Received diagnostic get request");
|
||||
|
||||
VerifyOrExit((aMessage.Read(aMessage.GetOffset(), sizeof(NetworkDiagnosticTlv), &networkDiagnosticTlv) ==
|
||||
sizeof(NetworkDiagnosticTlv)),
|
||||
@@ -571,7 +571,7 @@ void NetworkDiagnostic::HandleDiagnosticGetRequest(Coap::Header & aHead
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic get response");
|
||||
otLogInfoNetDiag("Sent diagnostic get response");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -618,7 +618,7 @@ otError NetworkDiagnostic::SendDiagnosticReset(const Ip6::Address &aDestination,
|
||||
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent network diagnostic reset");
|
||||
otLogInfoNetDiag("Sent network diagnostic reset");
|
||||
|
||||
exit:
|
||||
|
||||
@@ -649,7 +649,7 @@ void NetworkDiagnostic::HandleDiagnosticReset(Coap::Header & aHeader,
|
||||
uint8_t type;
|
||||
NetworkDiagnosticTlv networkDiagnosticTlv;
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic reset request");
|
||||
otLogInfoNetDiag("Received diagnostic reset request");
|
||||
|
||||
VerifyOrExit(aHeader.GetType() == OT_COAP_TYPE_CONFIRMABLE && aHeader.GetCode() == OT_COAP_CODE_POST);
|
||||
|
||||
@@ -670,18 +670,18 @@ void NetworkDiagnostic::HandleDiagnosticReset(Coap::Header & aHeader,
|
||||
{
|
||||
case NetworkDiagnosticTlv::kMacCounters:
|
||||
netif.GetMac().ResetCounters();
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic reset type kMacCounters(9)");
|
||||
otLogInfoNetDiag("Received diagnostic reset type kMacCounters(9)");
|
||||
break;
|
||||
|
||||
default:
|
||||
otLogInfoNetDiag(GetInstance(), "Received diagnostic reset other type %d not resetable", type);
|
||||
otLogInfoNetDiag("Received diagnostic reset other type %d not resetable", type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
SuccessOrExit(netif.GetCoap().SendEmptyAck(aHeader, aMessageInfo));
|
||||
|
||||
otLogInfoNetDiag(GetInstance(), "Sent diagnostic reset acknowledgment");
|
||||
otLogInfoNetDiag("Sent diagnostic reset acknowledgment");
|
||||
|
||||
exit:
|
||||
return;
|
||||
|
||||
@@ -92,7 +92,7 @@ void PanIdQueryServer::HandleQuery(Coap::Header &aHeader, Message &aMessage, con
|
||||
if (aHeader.IsConfirmable() && !aMessageInfo.GetSockAddr().IsMulticast())
|
||||
{
|
||||
SuccessOrExit(GetNetif().GetCoap().SendEmptyAck(aHeader, responseInfo));
|
||||
otLogInfoMeshCoP(GetInstance(), "sent panid query response");
|
||||
otLogInfoMeshCoP("sent panid query response");
|
||||
}
|
||||
|
||||
exit:
|
||||
@@ -153,7 +153,7 @@ otError PanIdQueryServer::SendConflict(void)
|
||||
messageInfo.SetPeerPort(kCoapUdpPort);
|
||||
SuccessOrExit(error = netif.GetCoap().SendMessage(*message, messageInfo));
|
||||
|
||||
otLogInfoMeshCoP(GetInstance(), "sent panid conflict");
|
||||
otLogInfoMeshCoP("sent panid conflict");
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ Router *RouterTable::Allocate(uint8_t aRouterId)
|
||||
mRouterIdSequenceLastUpdated = TimerMilli::GetNow();
|
||||
GetNetif().GetMle().ResetAdvertiseInterval();
|
||||
|
||||
otLogNoteMle(GetInstance(), "Allocate router id %d", aRouterId);
|
||||
otLogNoteMle("Allocate router id %d", aRouterId);
|
||||
|
||||
exit:
|
||||
return rval;
|
||||
@@ -292,7 +292,7 @@ otError RouterTable::Release(uint8_t aRouterId)
|
||||
netif.GetNetworkDataLeader().RemoveBorderRouter(rloc16, NetworkData::Leader::kMatchModeRouterId);
|
||||
netif.GetMle().ResetAdvertiseInterval();
|
||||
|
||||
otLogNoteMle(GetInstance(), "Release router id %d", aRouterId);
|
||||
otLogNoteMle("Release router id %d", aRouterId);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -65,8 +65,7 @@ void SourceMatchController::DecrementMessageCount(Child &aChild)
|
||||
{
|
||||
if (aChild.GetIndirectMessageCount() == 0)
|
||||
{
|
||||
otLogWarnMac(GetInstance(), "DecrementMessageCount(child 0x%04x) called when already at zero count.",
|
||||
aChild.GetRloc16());
|
||||
otLogWarnMac("DecrementMessageCount(child 0x%04x) called when already at zero count.", aChild.GetRloc16());
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -110,14 +109,14 @@ void SourceMatchController::ClearTable(void)
|
||||
{
|
||||
otPlatRadioClearSrcMatchShortEntries(&GetInstance());
|
||||
otPlatRadioClearSrcMatchExtEntries(&GetInstance());
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Cleared all entries");
|
||||
otLogDebgMac("SrcAddrMatch - Cleared all entries");
|
||||
}
|
||||
|
||||
void SourceMatchController::Enable(bool aEnable)
|
||||
{
|
||||
mEnabled = aEnable;
|
||||
otPlatRadioEnableSrcMatch(&GetInstance(), mEnabled);
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - %sabling", mEnabled ? "En" : "Dis");
|
||||
otLogDebgMac("SrcAddrMatch - %sabling", mEnabled ? "En" : "Dis");
|
||||
}
|
||||
|
||||
void SourceMatchController::AddEntry(Child &aChild)
|
||||
@@ -147,7 +146,7 @@ otError SourceMatchController::AddAddress(const Child &aChild)
|
||||
{
|
||||
error = otPlatRadioAddSrcMatchShortEntry(&GetInstance(), aChild.GetRloc16());
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Adding short addr: 0x%04x -- %s (%d)", aChild.GetRloc16(),
|
||||
otLogDebgMac("SrcAddrMatch - Adding short addr: 0x%04x -- %s (%d)", aChild.GetRloc16(),
|
||||
otThreadErrorToString(error), error);
|
||||
}
|
||||
else
|
||||
@@ -161,8 +160,8 @@ otError SourceMatchController::AddAddress(const Child &aChild)
|
||||
|
||||
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],
|
||||
otLogDebgMac("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);
|
||||
}
|
||||
|
||||
@@ -175,7 +174,7 @@ void SourceMatchController::ClearEntry(Child &aChild)
|
||||
|
||||
if (aChild.IsIndirectSourceMatchPending())
|
||||
{
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing pending flag for 0x%04x", aChild.GetRloc16());
|
||||
otLogDebgMac("SrcAddrMatch - Clearing pending flag for 0x%04x", aChild.GetRloc16());
|
||||
aChild.SetIndirectSourceMatchPending(false);
|
||||
ExitNow();
|
||||
}
|
||||
@@ -184,7 +183,7 @@ void SourceMatchController::ClearEntry(Child &aChild)
|
||||
{
|
||||
error = otPlatRadioClearSrcMatchShortEntry(&GetInstance(), aChild.GetRloc16());
|
||||
|
||||
otLogDebgMac(GetInstance(), "SrcAddrMatch - Clearing short address: 0x%04x -- %s (%d)", aChild.GetRloc16(),
|
||||
otLogDebgMac("SrcAddrMatch - Clearing short address: 0x%04x -- %s (%d)", aChild.GetRloc16(),
|
||||
otThreadErrorToString(error), error);
|
||||
}
|
||||
else
|
||||
@@ -198,8 +197,8 @@ void SourceMatchController::ClearEntry(Child &aChild)
|
||||
|
||||
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],
|
||||
otLogDebgMac("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);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ ChannelManager::ChannelManager(Instance &aInstance)
|
||||
|
||||
void ChannelManager::RequestChannelChange(uint8_t aChannel)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Request to change to channel %d with delay %d sec", aChannel, mDelay);
|
||||
otLogInfoUtil("ChannelManager: Request to change to channel %d with delay %d sec", aChannel, mDelay);
|
||||
|
||||
if (aChannel == GetInstance().Get<Mac::Mac>().GetPanChannel())
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Already operating on the requested channel %d", aChannel);
|
||||
otLogInfoUtil("ChannelManager: Already operating on the requested channel %d", aChannel);
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -149,8 +149,7 @@ void ChannelManager::PreparePendingDataset(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Request to change to channel %d failed. Device is disabled",
|
||||
mChannel);
|
||||
otLogInfoUtil("ChannelManager: Request to change to channel %d failed. Device is disabled", mChannel);
|
||||
|
||||
mState = kStateIdle;
|
||||
StartAutoSelectTimer();
|
||||
@@ -169,7 +168,7 @@ void ChannelManager::PreparePendingDataset(void)
|
||||
{
|
||||
if (dataset.mActiveTimestamp < pendingActiveTimestamp)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Pending Dataset is valid for change channel to %d", mChannel);
|
||||
otLogInfoUtil("ChannelManager: Pending Dataset is valid for change channel to %d", mChannel);
|
||||
mState = kStateSentMgmtPendingDataset;
|
||||
mTimer.Start(delayInMs + kChangeCheckWaitInterval);
|
||||
ExitNow();
|
||||
@@ -188,8 +187,7 @@ void ChannelManager::PreparePendingDataset(void)
|
||||
{
|
||||
if (dataset.mActiveTimestamp >= mActiveTimestamp)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(),
|
||||
"ChannelManager: Canceling channel change to %d since current ActiveDataset is more recent",
|
||||
otLogInfoUtil("ChannelManager: Canceling channel change to %d since current ActiveDataset is more recent",
|
||||
mChannel);
|
||||
|
||||
ExitNow();
|
||||
@@ -213,14 +211,14 @@ void ChannelManager::PreparePendingDataset(void)
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Sent PendingDatasetSet to change channel to %d", mChannel);
|
||||
otLogInfoUtil("ChannelManager: Sent PendingDatasetSet to change channel to %d", mChannel);
|
||||
|
||||
mState = kStateSentMgmtPendingDataset;
|
||||
mTimer.Start(delayInMs + kChangeCheckWaitInterval);
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: %s error in dataset update (channel change %d), retry in %d sec",
|
||||
otLogInfoUtil("ChannelManager: %s error in dataset update (channel change %d), retry in %d sec",
|
||||
otThreadErrorToString(error), mChannel, TimerMilli::MsecToSec(kPendingDatasetTxRetryInterval));
|
||||
|
||||
mTimer.Start(kPendingDatasetTxRetryInterval);
|
||||
@@ -240,13 +238,13 @@ void ChannelManager::HandleTimer(void)
|
||||
switch (mState)
|
||||
{
|
||||
case kStateIdle:
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Auto-triggered channel select");
|
||||
otLogInfoUtil("ChannelManager: Auto-triggered channel select");
|
||||
IgnoreReturnValue(RequestChannelSelect(false));
|
||||
StartAutoSelectTimer();
|
||||
break;
|
||||
|
||||
case kStateSentMgmtPendingDataset:
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Timed out waiting for change to %d, trying again.", mChannel);
|
||||
otLogInfoUtil("ChannelManager: Timed out waiting for change to %d, trying again.", mChannel);
|
||||
mState = kStateChangeRequested;
|
||||
|
||||
// fall through
|
||||
@@ -270,7 +268,7 @@ void ChannelManager::HandleStateChanged(otChangedFlags aFlags)
|
||||
mState = kStateIdle;
|
||||
StartAutoSelectTimer();
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Channel successfully changed to %d", mChannel);
|
||||
otLogInfoUtil("ChannelManager: Channel successfully changed to %d", mChannel);
|
||||
|
||||
exit:
|
||||
return;
|
||||
@@ -325,8 +323,8 @@ otError ChannelManager::FindBetterChannel(uint8_t &aNewChannel, uint16_t &aOccup
|
||||
|
||||
if (monitor.GetSampleCount() <= kMinChannelMonitorSampleCount)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Too few samples (%d <= %d) to select channel",
|
||||
monitor.GetSampleCount(), kMinChannelMonitorSampleCount);
|
||||
otLogInfoUtil("ChannelManager: Too few samples (%d <= %d) to select channel", monitor.GetSampleCount(),
|
||||
kMinChannelMonitorSampleCount);
|
||||
ExitNow(error = OT_ERROR_INVALID_STATE);
|
||||
}
|
||||
|
||||
@@ -336,10 +334,10 @@ otError ChannelManager::FindBetterChannel(uint8_t &aNewChannel, uint16_t &aOccup
|
||||
favoredBest = monitor.FindBestChannels(favoredAndSupported, favoredOccupancy);
|
||||
supportedBest = monitor.FindBestChannels(mSupportedChannelMask, supportedOccupancy);
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Best favored %s, occupancy 0x%04x",
|
||||
favoredBest.ToString().AsCString(), favoredOccupancy);
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Best overall %s, occupancy 0x%04x",
|
||||
supportedBest.ToString().AsCString(), supportedOccupancy);
|
||||
otLogInfoUtil("ChannelManager: Best favored %s, occupancy 0x%04x", favoredBest.ToString().AsCString(),
|
||||
favoredOccupancy);
|
||||
otLogInfoUtil("ChannelManager: Best overall %s, occupancy 0x%04x", supportedBest.ToString().AsCString(),
|
||||
supportedOccupancy);
|
||||
|
||||
// Prefer favored channels unless there is no favored channel,
|
||||
// or the occupancy rate of the best favored channel is worse
|
||||
@@ -350,8 +348,7 @@ otError ChannelManager::FindBetterChannel(uint8_t &aNewChannel, uint16_t &aOccup
|
||||
{
|
||||
if (!favoredBest.IsEmpty())
|
||||
{
|
||||
otLogInfoUtil(GetInstance(),
|
||||
"ChannelManager: Preferring an unfavored channel due to high occupancy rate diff");
|
||||
otLogInfoUtil("ChannelManager: Preferring an unfavored channel due to high occupancy rate diff");
|
||||
}
|
||||
|
||||
favoredBest = supportedBest;
|
||||
@@ -372,8 +369,8 @@ bool ChannelManager::ShouldAttamptChannelChange(void)
|
||||
uint16_t ccaFailureRate = GetInstance().Get<Mac::Mac>().GetCcaFailureRate();
|
||||
bool shouldAttempt = (ccaFailureRate >= kCcaFailureRateThreshold);
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: CCA-err-rate: 0x%04x %s 0x%04x, selecting channel: %s",
|
||||
ccaFailureRate, shouldAttempt ? ">=" : "<", kCcaFailureRateThreshold, shouldAttempt ? "yes" : "no");
|
||||
otLogInfoUtil("ChannelManager: CCA-err-rate: 0x%04x %s 0x%04x, selecting channel: %s", ccaFailureRate,
|
||||
shouldAttempt ? ">=" : "<", kCcaFailureRateThreshold, shouldAttempt ? "yes" : "no");
|
||||
|
||||
return shouldAttempt;
|
||||
}
|
||||
@@ -384,7 +381,7 @@ otError ChannelManager::RequestChannelSelect(bool aSkipQualityCheck)
|
||||
uint8_t curChannel, newChannel;
|
||||
uint16_t curOccupancy, newOccupancy;
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Request to select channel (skip quality check: %s)",
|
||||
otLogInfoUtil("ChannelManager: Request to select channel (skip quality check: %s)",
|
||||
aSkipQualityCheck ? "yes" : "no");
|
||||
|
||||
VerifyOrExit(GetInstance().Get<Mle::Mle>().GetRole() != OT_DEVICE_ROLE_DISABLED, error = OT_ERROR_INVALID_STATE);
|
||||
@@ -398,12 +395,12 @@ otError ChannelManager::RequestChannelSelect(bool aSkipQualityCheck)
|
||||
|
||||
if (newChannel == curChannel)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Already on best possible channel %d", curChannel);
|
||||
otLogInfoUtil("ChannelManager: Already on best possible channel %d", curChannel);
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Cur channel %d, occupancy 0x%04x - Best channel %d, occupancy 0x%04x",
|
||||
curChannel, curOccupancy, newChannel, newOccupancy);
|
||||
otLogInfoUtil("ChannelManager: Cur channel %d, occupancy 0x%04x - Best channel %d, occupancy 0x%04x", curChannel,
|
||||
curOccupancy, newChannel, newOccupancy);
|
||||
|
||||
// Switch only if new channel's occupancy rate is better than current
|
||||
// channel's occupancy rate by threshold `kThresholdToChangeChannel`.
|
||||
@@ -411,7 +408,7 @@ otError ChannelManager::RequestChannelSelect(bool aSkipQualityCheck)
|
||||
if ((newOccupancy >= curOccupancy) ||
|
||||
(static_cast<uint16_t>(curOccupancy - newOccupancy) < kThresholdToChangeChannel))
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Occupancy rate diff too small to change channel");
|
||||
otLogInfoUtil("ChannelManager: Occupancy rate diff too small to change channel");
|
||||
ExitNow();
|
||||
}
|
||||
|
||||
@@ -421,7 +418,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_NONE)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Request to select better channel failed, error: %s",
|
||||
otLogInfoUtil("ChannelManager: Request to select better channel failed, error: %s",
|
||||
otThreadErrorToString(error));
|
||||
}
|
||||
|
||||
@@ -432,7 +429,7 @@ exit:
|
||||
|
||||
otError ChannelManager::RequestChannelSelect(bool)
|
||||
{
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: ChannelMonitor feature is disabled - cannot select channel");
|
||||
otLogInfoUtil("ChannelManager: ChannelMonitor feature is disabled - cannot select channel");
|
||||
return OT_ERROR_DISABLED_FEATURE;
|
||||
}
|
||||
|
||||
@@ -487,15 +484,14 @@ void ChannelManager::SetSupportedChannels(uint32_t aChannelMask)
|
||||
{
|
||||
mSupportedChannelMask.SetMask(aChannelMask & OT_RADIO_SUPPORTED_CHANNELS);
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Supported channels: %s",
|
||||
mSupportedChannelMask.ToString().AsCString());
|
||||
otLogInfoUtil("ChannelManager: Supported channels: %s", mSupportedChannelMask.ToString().AsCString());
|
||||
}
|
||||
|
||||
void ChannelManager::SetFavoredChannels(uint32_t aChannelMask)
|
||||
{
|
||||
mFavoredChannelMask.SetMask(aChannelMask & OT_RADIO_SUPPORTED_CHANNELS);
|
||||
|
||||
otLogInfoUtil(GetInstance(), "ChannelManager: Favored channels: %s", mFavoredChannelMask.ToString().AsCString());
|
||||
otLogInfoUtil("ChannelManager: Favored channels: %s", mFavoredChannelMask.ToString().AsCString());
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
@@ -66,7 +66,7 @@ otError ChannelMonitor::Start(void)
|
||||
VerifyOrExit(!IsRunning(), error = OT_ERROR_ALREADY);
|
||||
Clear();
|
||||
mTimer.Start(kTimerInterval);
|
||||
otLogDebgUtil(GetInstance(), "ChannelMonitor: Starting");
|
||||
otLogDebgUtil("ChannelMonitor: Starting");
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -78,7 +78,7 @@ otError ChannelMonitor::Stop(void)
|
||||
|
||||
VerifyOrExit(IsRunning(), error = OT_ERROR_ALREADY);
|
||||
mTimer.Stop();
|
||||
otLogDebgUtil(GetInstance(), "ChannelMonitor: Stopping");
|
||||
otLogDebgUtil("ChannelMonitor: Stopping");
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -90,7 +90,7 @@ void ChannelMonitor::Clear(void)
|
||||
mSampleCount = 0;
|
||||
memset(mChannelOccupancy, 0, sizeof(mChannelOccupancy));
|
||||
|
||||
otLogDebgUtil(GetInstance(), "ChannelMonitor: Clearing data");
|
||||
otLogDebgUtil("ChannelMonitor: Clearing data");
|
||||
}
|
||||
|
||||
uint16_t ChannelMonitor::GetChannelOccupancy(uint8_t aChannel) const
|
||||
@@ -146,7 +146,7 @@ void ChannelMonitor::HandleEnergyScanResult(otEnergyScanResult *aResult)
|
||||
|
||||
assert(channelIndex < kNumChannels);
|
||||
|
||||
otLogDebgUtil(GetInstance(), "ChannelMonitor: channel: %d, rssi:%d", aResult->mChannel, aResult->mMaxRssi);
|
||||
otLogDebgUtil("ChannelMonitor: channel: %d, rssi:%d", aResult->mChannel, aResult->mMaxRssi);
|
||||
|
||||
if (aResult->mMaxRssi != OT_RADIO_RSSI_INVALID)
|
||||
{
|
||||
@@ -182,7 +182,6 @@ void ChannelMonitor::HandleEnergyScanResult(otEnergyScanResult *aResult)
|
||||
void ChannelMonitor::LogResults(void)
|
||||
{
|
||||
otLogInfoUtil(
|
||||
GetInstance(),
|
||||
"ChannelMonitor: %u [%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x]",
|
||||
mSampleCount, mChannelOccupancy[0] >> 8, mChannelOccupancy[1] >> 8, mChannelOccupancy[2] >> 8,
|
||||
mChannelOccupancy[3] >> 8, mChannelOccupancy[4] >> 8, mChannelOccupancy[5] >> 8, mChannelOccupancy[6] >> 8,
|
||||
|
||||
@@ -98,7 +98,7 @@ void ChildSupervisor::SendMessage(Child &aChild)
|
||||
SuccessOrExit(netif.SendMessage(*message));
|
||||
message = NULL;
|
||||
|
||||
otLogInfoUtil(GetInstance(), "Sending supervision message to child 0x%04x", aChild.GetRloc16());
|
||||
otLogInfoUtil("Sending supervision message to child 0x%04x", aChild.GetRloc16());
|
||||
|
||||
exit:
|
||||
|
||||
@@ -155,13 +155,13 @@ void ChildSupervisor::CheckState(void)
|
||||
if (shouldRun && !mTimer.IsRunning())
|
||||
{
|
||||
mTimer.Start(kOneSecond);
|
||||
otLogInfoUtil(GetInstance(), "Starting Child Supervision");
|
||||
otLogInfoUtil("Starting Child Supervision");
|
||||
}
|
||||
|
||||
if (!shouldRun && mTimer.IsRunning())
|
||||
{
|
||||
mTimer.Stop();
|
||||
otLogInfoUtil(GetInstance(), "Stopping Child Supervision");
|
||||
otLogInfoUtil("Stopping Child Supervision");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ void SupervisionListener::HandleTimer(void)
|
||||
VerifyOrExit((netif.GetMle().GetRole() == OT_DEVICE_ROLE_CHILD) &&
|
||||
(netif.GetMeshForwarder().GetRxOnWhenIdle() == false));
|
||||
|
||||
otLogWarnUtil(netif.GetInstance(), "Supervision timeout. No frame from parent in %d sec", mTimeout);
|
||||
otLogWarnUtil("Supervision timeout. No frame from parent in %d sec", mTimeout);
|
||||
|
||||
netif.GetMle().SendChildUpdateRequest();
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ otError JamDetector::Start(Handler aHandler, void *aContext)
|
||||
mContext = aContext;
|
||||
mEnabled = true;
|
||||
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - Started");
|
||||
otLogInfoUtil("JamDetector - Started");
|
||||
|
||||
CheckState();
|
||||
|
||||
@@ -94,7 +94,7 @@ otError JamDetector::Stop(void)
|
||||
|
||||
mTimer.Stop();
|
||||
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - Stopped");
|
||||
otLogInfoUtil("JamDetector - Stopped");
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -130,7 +130,7 @@ exit:
|
||||
otError JamDetector::SetRssiThreshold(int8_t aThreshold)
|
||||
{
|
||||
mRssiThreshold = aThreshold;
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - RSSI threshold set to %d", mRssiThreshold);
|
||||
otLogInfoUtil("JamDetector - RSSI threshold set to %d", mRssiThreshold);
|
||||
|
||||
return OT_ERROR_NONE;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ otError JamDetector::SetWindow(uint8_t aWindow)
|
||||
VerifyOrExit(aWindow <= kMaxWindow, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
mWindow = aWindow;
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - window set to %d", mWindow);
|
||||
otLogInfoUtil("JamDetector - window set to %d", mWindow);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -157,7 +157,7 @@ otError JamDetector::SetBusyPeriod(uint8_t aBusyPeriod)
|
||||
VerifyOrExit(aBusyPeriod <= mWindow, error = OT_ERROR_INVALID_ARGS);
|
||||
|
||||
mBusyPeriod = aBusyPeriod;
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - busy period set to %d", mBusyPeriod);
|
||||
otLogInfoUtil("JamDetector - busy period set to %d", mBusyPeriod);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
@@ -267,7 +267,7 @@ void JamDetector::SetJamState(bool aNewState)
|
||||
{
|
||||
mJamState = aNewState;
|
||||
shouldInvokeHandler = true;
|
||||
otLogInfoUtil(GetInstance(), "JamDetector - jamming %s", mJamState ? "detected" : "cleared");
|
||||
otLogInfoUtil("JamDetector - jamming %s", mJamState ? "detected" : "cleared");
|
||||
}
|
||||
|
||||
if (shouldInvokeHandler)
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <openthread/diag.h>
|
||||
#include <openthread/icmp6.h>
|
||||
#include <openthread/link.h>
|
||||
#include <openthread/logging.h>
|
||||
#include <openthread/ncp.h>
|
||||
#include <openthread/platform/misc.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
@@ -2143,7 +2144,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_DEBUG_TEST_WATCHDOG>(
|
||||
|
||||
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_DEBUG_NCP_LOG_LEVEL>(void)
|
||||
{
|
||||
return mEncoder.WriteUint8(ConvertLogLevel(otGetDynamicLogLevel(mInstance)));
|
||||
return mEncoder.WriteUint8(ConvertLogLevel(otLoggingGetLevel()));
|
||||
}
|
||||
|
||||
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_DEBUG_NCP_LOG_LEVEL>(void)
|
||||
@@ -2187,7 +2188,7 @@ template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_DEBUG_NCP_LOG_LEVEL>(
|
||||
break;
|
||||
}
|
||||
|
||||
error = otSetDynamicLogLevel(mInstance, logLevel);
|
||||
error = otLoggingSetLevel(logLevel);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -235,14 +235,13 @@ static otError SpinelStatusToOtError(spinel_status_t aError)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void LogIfFail(otInstance *aInstance, const char *aText, otError aError)
|
||||
static void LogIfFail(const char *aText, otError aError)
|
||||
{
|
||||
if (aError != OT_ERROR_NONE)
|
||||
{
|
||||
otLogWarnPlat(aInstance, "%s: %s", aText, otThreadErrorToString(aError));
|
||||
otLogWarnPlat("%s: %s", aText, otThreadErrorToString(aError));
|
||||
}
|
||||
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
OT_UNUSED_VARIABLE(aText);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
}
|
||||
@@ -284,7 +283,7 @@ static int ForkPty(const char *aCommand, const char *aArguments)
|
||||
|
||||
rval = snprintf(cmd, sizeof(cmd), "exec %s %s", aCommand, aArguments);
|
||||
VerifyOrExit(rval > 0 && static_cast<size_t>(rval) < sizeof(cmd),
|
||||
otLogCritPlat(mInstance, "NCP file and configuration is too long!"));
|
||||
otLogCritPlat("NCP file and configuration is too long!"));
|
||||
|
||||
execl(getenv("SHELL"), getenv("SHELL"), "-c", cmd, NULL);
|
||||
perror("open pty failed");
|
||||
@@ -561,9 +560,8 @@ void RadioSpinel::Init(const char *aRadioFile, const char *aRadioConfig)
|
||||
if ((versionMajor != SPINEL_PROTOCOL_VERSION_THREAD_MAJOR) ||
|
||||
(versionMinor != SPINEL_PROTOCOL_VERSION_THREAD_MINOR))
|
||||
{
|
||||
otLogCritPlat(mInstance, "Spinel version mismatch - PosixApp:%d.%d, RCP:%d.%d",
|
||||
SPINEL_PROTOCOL_VERSION_THREAD_MAJOR, SPINEL_PROTOCOL_VERSION_THREAD_MINOR, versionMajor,
|
||||
versionMinor);
|
||||
otLogCritPlat("Spinel version mismatch - PosixApp:%d.%d, RCP:%d.%d", SPINEL_PROTOCOL_VERSION_THREAD_MAJOR,
|
||||
SPINEL_PROTOCOL_VERSION_THREAD_MINOR, versionMajor, versionMinor);
|
||||
exit(OT_EXIT_INCOMPATIBLE_RADIO_SPINEL);
|
||||
}
|
||||
}
|
||||
@@ -621,13 +619,12 @@ void RadioSpinel::HandleSpinelFrame(const uint8_t *aBuffer, uint16_t aLength)
|
||||
}
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Error handling hdlc frame", error);
|
||||
LogIfFail("Error handling hdlc frame", error);
|
||||
}
|
||||
|
||||
void RadioSpinel::HandleHdlcError(void *aContext, otError aError, uint8_t *aBuffer, uint16_t aLength)
|
||||
{
|
||||
otLogWarnPlat(static_cast<RadioSpinel *>(aContext)->mInstance, "Error decoding hdlc frame: %s",
|
||||
otThreadErrorToString(aError));
|
||||
otLogWarnPlat("Error decoding hdlc frame: %s", otThreadErrorToString(aError));
|
||||
OT_UNUSED_VARIABLE(aContext);
|
||||
OT_UNUSED_VARIABLE(aError);
|
||||
OT_UNUSED_VARIABLE(aBuffer);
|
||||
@@ -667,7 +664,7 @@ void RadioSpinel::HandleNotification(const uint8_t *aBuffer, uint16_t aLength)
|
||||
|
||||
case SPINEL_CMD_PROP_VALUE_INSERTED:
|
||||
case SPINEL_CMD_PROP_VALUE_REMOVED:
|
||||
otLogInfoPlat(mInstance, "Ignored command %d", cmd);
|
||||
otLogInfoPlat("Ignored command %d", cmd);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -675,7 +672,7 @@ void RadioSpinel::HandleNotification(const uint8_t *aBuffer, uint16_t aLength)
|
||||
}
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Error processing notification", error);
|
||||
LogIfFail("Error processing notification", error);
|
||||
}
|
||||
|
||||
void RadioSpinel::HandleResponse(const uint8_t *aBuffer, uint16_t aLength)
|
||||
@@ -706,12 +703,12 @@ void RadioSpinel::HandleResponse(const uint8_t *aBuffer, uint16_t aLength)
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnPlat(mInstance, "Unexpected Spinel transaction message: %u", SPINEL_HEADER_GET_TID(header));
|
||||
otLogWarnPlat("Unexpected Spinel transaction message: %u", SPINEL_HEADER_GET_TID(header));
|
||||
error = OT_ERROR_DROP;
|
||||
}
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Error processing response", error);
|
||||
LogIfFail("Error processing response", error);
|
||||
}
|
||||
|
||||
void RadioSpinel::HandleWaitingResponse(uint32_t aCommand,
|
||||
@@ -766,7 +763,7 @@ void RadioSpinel::HandleWaitingResponse(uint32_t aCommand,
|
||||
}
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Error processing result", mError);
|
||||
LogIfFail("Error processing result", mError);
|
||||
}
|
||||
|
||||
void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength)
|
||||
@@ -788,7 +785,7 @@ void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer,
|
||||
|
||||
if (status >= SPINEL_STATUS_RESET__BEGIN && status <= SPINEL_STATUS_RESET__END)
|
||||
{
|
||||
otLogCritPlat(mInstance, "RCP reset: %s", spinel_status_to_cstr(status));
|
||||
otLogCritPlat("RCP reset: %s", spinel_status_to_cstr(status));
|
||||
mIsReady = true;
|
||||
|
||||
// If RCP crashes/resets while radio was enabled, posix app exits.
|
||||
@@ -796,7 +793,7 @@ void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer,
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogInfoPlat(mInstance, "RCP last status: %s", spinel_status_to_cstr(status));
|
||||
otLogInfoPlat("RCP last status: %s", spinel_status_to_cstr(status));
|
||||
}
|
||||
}
|
||||
else if (aKey == SPINEL_PROP_MAC_ENERGY_SCAN_RESULT)
|
||||
@@ -820,11 +817,11 @@ void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer,
|
||||
assert(len < sizeof(logStream));
|
||||
VerifyOrExit(unpacked > 0, error = OT_ERROR_PARSE);
|
||||
logStream[len] = '\0';
|
||||
otLogDebgPlat(mInstance, "RCP DEBUG INFO: %s", logStream);
|
||||
otLogDebgPlat("RCP DEBUG INFO: %s", logStream);
|
||||
}
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Failed to handle ValueIs", error);
|
||||
LogIfFail("Failed to handle ValueIs", error);
|
||||
}
|
||||
|
||||
otError RadioSpinel::ParseRadioFrame(otRadioFrame &aFrame, const uint8_t *aBuffer, uint16_t aLength)
|
||||
@@ -852,7 +849,7 @@ otError RadioSpinel::ParseRadioFrame(otRadioFrame &aFrame, const uint8_t *aBuffe
|
||||
VerifyOrExit(unpacked > 0, error = OT_ERROR_PARSE);
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Handle radio frame failed", error);
|
||||
LogIfFail("Handle radio frame failed", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1104,7 +1101,7 @@ otError RadioSpinel::GetTransmitPower(int8_t &aPower)
|
||||
{
|
||||
otError error = Get(SPINEL_PROP_PHY_TX_POWER, SPINEL_DATATYPE_INT8_S, &aPower);
|
||||
|
||||
LogIfFail(mInstance, "Get transmit power failed", error);
|
||||
LogIfFail("Get transmit power failed", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1113,14 +1110,14 @@ int8_t RadioSpinel::GetRssi(void)
|
||||
int8_t rssi = OT_RADIO_RSSI_INVALID;
|
||||
otError error = Get(SPINEL_PROP_PHY_RSSI, SPINEL_DATATYPE_INT8_S, &rssi);
|
||||
|
||||
LogIfFail(mInstance, "Get RSSI failed", error);
|
||||
LogIfFail("Get RSSI failed", error);
|
||||
return rssi;
|
||||
}
|
||||
|
||||
otError RadioSpinel::SetTransmitPower(int8_t aPower)
|
||||
{
|
||||
otError error = Set(SPINEL_PROP_PHY_TX_POWER, SPINEL_DATATYPE_INT8_S, aPower);
|
||||
LogIfFail(mInstance, "Set transmit power failed", error);
|
||||
LogIfFail("Set transmit power failed", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -1286,7 +1283,7 @@ otError RadioSpinel::WaitResponse(void)
|
||||
} while (mWaitingTid || !mIsReady);
|
||||
|
||||
exit:
|
||||
LogIfFail(mInstance, "Error waiting response", mError);
|
||||
LogIfFail("Error waiting response", mError);
|
||||
// This indicates end of waiting repsonse.
|
||||
mWaitingKey = SPINEL_PROP_LAST_STATUS;
|
||||
return mError;
|
||||
@@ -1526,14 +1523,14 @@ void RadioSpinel::HandleTransmitDone(uint32_t aCommand,
|
||||
}
|
||||
else
|
||||
{
|
||||
otLogWarnPlat(mInstance, "Spinel status: %d.", status);
|
||||
otLogWarnPlat("Spinel status: %d.", status);
|
||||
error = SpinelStatusToOtError(status);
|
||||
}
|
||||
|
||||
exit:
|
||||
mTxState = kDone;
|
||||
mTxError = error;
|
||||
LogIfFail(mInstance, "Handle transmit done failed", error);
|
||||
LogIfFail("Handle transmit done failed", error);
|
||||
}
|
||||
|
||||
otError RadioSpinel::Transmit(otRadioFrame &aFrame)
|
||||
|
||||
Reference in New Issue
Block a user