mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[logging] fix format strings (#8446)
This commit fixes the format string in logging functions. When openthread is included in other projects that use the -Werror option in their builds, such as Matter, these format string errors appear. In this case, it can be seen in radio.h that the structure members are uint32_t but printed with %u. The size of types depends on the target, there needs to be a casing.
This commit is contained in:
+2
-2
@@ -2413,12 +2413,12 @@ template <> otError Interpreter::Process<Cmd("coex")>(Arg aArgs[])
|
||||
SuccessOrExit(error = otPlatRadioGetCoexMetrics(GetInstancePtr(), &metrics));
|
||||
|
||||
OutputLine("Stopped: %s", metrics.mStopped ? "true" : "false");
|
||||
OutputLine("Grant Glitch: %u", metrics.mNumGrantGlitch);
|
||||
OutputLine("Grant Glitch: %lu", ToUlong(metrics.mNumGrantGlitch));
|
||||
OutputLine("Transmit metrics");
|
||||
|
||||
for (const RadioCoexMetricName &metric : kTxMetricNames)
|
||||
{
|
||||
OutputLine(kIndentSize, "%s: %u", metric.mName, metrics.*metric.mValuePtr);
|
||||
OutputLine(kIndentSize, "%s: %lu", metric.mName, ToUlong(metrics.*metric.mValuePtr));
|
||||
}
|
||||
|
||||
OutputLine("Receive metrics");
|
||||
|
||||
@@ -3032,23 +3032,23 @@ void RadioSpinel<InterfaceType, ProcessContextType>::LogSpinelFrame(const uint8_
|
||||
VerifyOrExit(unpacked > 0, error = OT_ERROR_PARSE);
|
||||
|
||||
otLogDebgPlat("%s ...", buf);
|
||||
otLogDebgPlat(" txRequest:%u", metrics.mNumTxRequest);
|
||||
otLogDebgPlat(" txGrantImmediate:%u", metrics.mNumTxGrantImmediate);
|
||||
otLogDebgPlat(" txGrantWait:%u", metrics.mNumTxGrantWait);
|
||||
otLogDebgPlat(" txGrantWaitActivated:%u", metrics.mNumTxGrantWaitActivated);
|
||||
otLogDebgPlat(" txGrantWaitTimeout:%u", metrics.mNumTxGrantWaitTimeout);
|
||||
otLogDebgPlat(" txGrantDeactivatedDuringRequest:%u", metrics.mNumTxGrantDeactivatedDuringRequest);
|
||||
otLogDebgPlat(" txDelayedGrant:%u", metrics.mNumTxDelayedGrant);
|
||||
otLogDebgPlat(" avgTxRequestToGrantTime:%u", metrics.mAvgTxRequestToGrantTime);
|
||||
otLogDebgPlat(" rxRequest:%u", metrics.mNumRxRequest);
|
||||
otLogDebgPlat(" rxGrantImmediate:%u", metrics.mNumRxGrantImmediate);
|
||||
otLogDebgPlat(" rxGrantWait:%u", metrics.mNumRxGrantWait);
|
||||
otLogDebgPlat(" rxGrantWaitActivated:%u", metrics.mNumRxGrantWaitActivated);
|
||||
otLogDebgPlat(" rxGrantWaitTimeout:%u", metrics.mNumRxGrantWaitTimeout);
|
||||
otLogDebgPlat(" rxGrantDeactivatedDuringRequest:%u", metrics.mNumRxGrantDeactivatedDuringRequest);
|
||||
otLogDebgPlat(" rxDelayedGrant:%u", metrics.mNumRxDelayedGrant);
|
||||
otLogDebgPlat(" avgRxRequestToGrantTime:%u", metrics.mAvgRxRequestToGrantTime);
|
||||
otLogDebgPlat(" rxGrantNone:%u", metrics.mNumRxGrantNone);
|
||||
otLogDebgPlat(" txRequest:%lu", ToUlong(metrics.mNumTxRequest));
|
||||
otLogDebgPlat(" txGrantImmediate:%lu", ToUlong(metrics.mNumTxGrantImmediate));
|
||||
otLogDebgPlat(" txGrantWait:%lu", ToUlong(metrics.mNumTxGrantWait));
|
||||
otLogDebgPlat(" txGrantWaitActivated:%lu", ToUlong(metrics.mNumTxGrantWaitActivated));
|
||||
otLogDebgPlat(" txGrantWaitTimeout:%lu", ToUlong(metrics.mNumTxGrantWaitTimeout));
|
||||
otLogDebgPlat(" txGrantDeactivatedDuringRequest:%lu", ToUlong(metrics.mNumTxGrantDeactivatedDuringRequest));
|
||||
otLogDebgPlat(" txDelayedGrant:%lu", ToUlong(metrics.mNumTxDelayedGrant));
|
||||
otLogDebgPlat(" avgTxRequestToGrantTime:%lu", ToUlong(metrics.mAvgTxRequestToGrantTime));
|
||||
otLogDebgPlat(" rxRequest:%lu", ToUlong(metrics.mNumRxRequest));
|
||||
otLogDebgPlat(" rxGrantImmediate:%lu", ToUlong(metrics.mNumRxGrantImmediate));
|
||||
otLogDebgPlat(" rxGrantWait:%lu", ToUlong(metrics.mNumRxGrantWait));
|
||||
otLogDebgPlat(" rxGrantWaitActivated:%lu", ToUlong(metrics.mNumRxGrantWaitActivated));
|
||||
otLogDebgPlat(" rxGrantWaitTimeout:%lu", ToUlong(metrics.mNumRxGrantWaitTimeout));
|
||||
otLogDebgPlat(" rxGrantDeactivatedDuringRequest:%lu", ToUlong(metrics.mNumRxGrantDeactivatedDuringRequest));
|
||||
otLogDebgPlat(" rxDelayedGrant:%lu", ToUlong(metrics.mNumRxDelayedGrant));
|
||||
otLogDebgPlat(" avgRxRequestToGrantTime:%lu", ToUlong(metrics.mAvgRxRequestToGrantTime));
|
||||
otLogDebgPlat(" rxGrantNone:%lu", ToUlong(metrics.mNumRxGrantNone));
|
||||
otLogDebgPlat(" stopped:%u", metrics.mStopped);
|
||||
|
||||
start = buf;
|
||||
|
||||
Reference in New Issue
Block a user