mirror of
https://github.com/espressif/openthread.git
synced 2026-10-07 16:27:35 +00:00
[cli] add CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE config guard (#13435)
HandleLinkMetricsEnhAckProbingIe() emits unsolicited CLI output from the time-critical MAC transmit-done path on every Enhanced-ACK Link Metrics reception, which can break SED fast-poll timing on platforms with a synchronous/blocking CLI transport. Guard this output behind the new OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE option (disabled by default). When disabled, no Enh-ACK IE callback is registered with otLinkMetricsConfigEnhAckProbing(), so the callback and its CLI output are compiled out entirely.
This commit is contained in:
@@ -75,6 +75,22 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE
|
||||
*
|
||||
* Define to 1 to enable unsolicited CLI output of Link Metrics data
|
||||
* received in Enhanced-ACK frames. When disabled (default), no Enhanced-ACK
|
||||
* IE callback is registered with otLinkMetricsConfigEnhAckProbing(), so the
|
||||
* callback and its CLI output are compiled out entirely.
|
||||
*
|
||||
* Enabling this option adds OutputFormat() calls inside the time-critical
|
||||
* Mac::HandleTransmitDone() path. On platforms with synchronous/blocking
|
||||
* CLI transport, this may break SED fast-poll timing.
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE
|
||||
#define OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_CLI_BLE_SECURE_ENABLE
|
||||
*
|
||||
|
||||
@@ -325,10 +325,14 @@ template <> otError LinkMetrics::Process<Cmd("config")>(Arg aArgs[])
|
||||
ExitNow(error = OT_ERROR_INVALID_ARGS);
|
||||
}
|
||||
|
||||
SuccessOrExit(
|
||||
error = otLinkMetricsConfigEnhAckProbing(GetInstancePtr(), &address, enhAckFlags, pLinkMetrics,
|
||||
&LinkMetrics::HandleLinkMetricsConfigEnhAckProbingMgmtResponse,
|
||||
this, &LinkMetrics::HandleLinkMetricsEnhAckProbingIe, this));
|
||||
error = otLinkMetricsConfigEnhAckProbing(GetInstancePtr(), &address, enhAckFlags, pLinkMetrics,
|
||||
&LinkMetrics::HandleLinkMetricsConfigEnhAckProbingMgmtResponse, this,
|
||||
#if OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE
|
||||
&LinkMetrics::HandleLinkMetricsEnhAckProbingIe, this);
|
||||
#else
|
||||
nullptr, nullptr);
|
||||
#endif
|
||||
SuccessOrExit(error);
|
||||
|
||||
if (sync)
|
||||
{
|
||||
@@ -542,6 +546,7 @@ void LinkMetrics::HandleLinkMetricsMgmtResponse(const otIp6Address *aAddress, ot
|
||||
OutputLine("Status: %s", LinkMetricsStatusToStr(aStatus));
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE
|
||||
void LinkMetrics::HandleLinkMetricsEnhAckProbingIe(otShortAddress aShortAddress,
|
||||
const otExtAddress *aExtAddress,
|
||||
const otLinkMetricsValues *aMetricsValues,
|
||||
@@ -563,6 +568,7 @@ void LinkMetrics::HandleLinkMetricsEnhAckProbingIe(otShortAddress aS
|
||||
PrintLinkMetricsValue(aMetricsValues);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *LinkMetrics::LinkMetricsStatusToStr(otLinkMetricsStatus aStatus)
|
||||
{
|
||||
|
||||
@@ -104,6 +104,7 @@ private:
|
||||
void HandleLinkMetricsConfigEnhAckProbingMgmtResponse(const otIp6Address *aAddress, otLinkMetricsStatus aStatus);
|
||||
void HandleLinkMetricsMgmtResponse(const otIp6Address *aAddress, otLinkMetricsStatus aStatus);
|
||||
|
||||
#if OPENTHREAD_CONFIG_CLI_LINK_METRICS_ENH_ACK_VERBOSE_ENABLE
|
||||
static void HandleLinkMetricsEnhAckProbingIe(otShortAddress aShortAddress,
|
||||
const otExtAddress *aExtAddress,
|
||||
const otLinkMetricsValues *aMetricsValues,
|
||||
@@ -112,6 +113,7 @@ private:
|
||||
void HandleLinkMetricsEnhAckProbingIe(otShortAddress aShortAddress,
|
||||
const otExtAddress *aExtAddress,
|
||||
const otLinkMetricsValues *aMetricsValues);
|
||||
#endif
|
||||
|
||||
const char *LinkMetricsStatusToStr(otLinkMetricsStatus aStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user