[mle] log Thread Mode change (#3059)

This commit adds a log line (at log level `OT_LOG_LEVEL_NOTE`) to
indicate the mode change and the new mode value.
This commit is contained in:
Abtin Keshavarzian
2018-09-10 19:36:36 -10:00
committed by Jonathan Hui
parent d9da4c2652
commit 8c5775cbfc
+6
View File
@@ -811,6 +811,12 @@ 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, ffd:%s, full-netdata:%s]",
mDeviceMode, aDeviceMode, (aDeviceMode & ModeTlv::kModeRxOnWhenIdle) ? "yes" : " no",
(aDeviceMode & ModeTlv::kModeSecureDataRequest) ? "yes" : " no",
(aDeviceMode & ModeTlv::kModeFFD) ? "yes" : "no",
(aDeviceMode & ModeTlv::kModeFullNetworkData) ? "yes" : "no");
mDeviceMode = aDeviceMode;
switch (mRole)