mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[link-metrics] split OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro (#6716)
This commit splits OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE macro into two subsequent ones: - OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE - OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
This commit is contained in:
@@ -229,9 +229,14 @@ if(OT_LINK_RAW)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_LINK_RAW_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LINK_METRICS "enable link metrics")
|
||||
if (OT_LINK_METRICS)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE=1")
|
||||
option(OT_LINK_METRICS_INITIATOR "enable link metrics initiator")
|
||||
if (OT_LINK_METRICS_INITIATOR)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LINK_METRICS_SUBJECT "enable link metrics subject")
|
||||
if (OT_LINK_METRICS_SUBJECT)
|
||||
target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE=1")
|
||||
endif()
|
||||
|
||||
option(OT_LOG_LEVEL_DYNAMIC "enable dynamic log level control")
|
||||
|
||||
@@ -153,8 +153,11 @@ if (openthread_enable_core_config_args) {
|
||||
# Enable legacy network support
|
||||
openthread_config_legacy_enable = false
|
||||
|
||||
# Enable link metrics
|
||||
openthread_config_link_metrics_enable = false
|
||||
# Enable link metrics initiator
|
||||
openthread_config_link_metrics_initiator_enable = false
|
||||
|
||||
# Enable link metrics subject
|
||||
openthread_config_link_metrics_subject_enable = false
|
||||
|
||||
# Enable link raw service
|
||||
openthread_config_link_raw_enable = false
|
||||
|
||||
@@ -224,8 +224,12 @@ ifeq ($(LINK_RAW),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(LINK_METRICS),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE=1
|
||||
ifeq ($(LINK_METRICS_INITIATOR),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(LINK_METRICS_SUBJECT),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE=1
|
||||
endif
|
||||
|
||||
ifneq ($(LOG_OUTPUT),)
|
||||
|
||||
@@ -378,7 +378,7 @@ void platformRadioInit(void)
|
||||
sChannelMaxTransmitPower[i] = OT_RADIO_POWER_INVALID;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
otLinkMetricsInit(SIM_RECEIVE_SENSITIVITY);
|
||||
#endif
|
||||
}
|
||||
@@ -871,7 +871,7 @@ void radioSendAck(void)
|
||||
uint8_t linkMetricsDataLen = 0;
|
||||
uint8_t *dataPtr = NULL;
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
uint8_t linkMetricsData[OT_ENH_PROBING_IE_DATA_MAX_SIZE];
|
||||
otMacAddress macAddress;
|
||||
|
||||
@@ -935,7 +935,7 @@ void radioProcessFrame(otInstance *aInstance)
|
||||
otEXPECT_ACTION(otMacFrameDoesAddrMatch(&sReceiveFrame, sPanid, sShortAddress, &sExtAddress),
|
||||
error = OT_ERROR_ABORT);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
otEXPECT_ACTION(otMacFrameGetSrcAddr(&sReceiveFrame, &macAddress) == OT_ERROR_NONE, error = OT_ERROR_PARSE);
|
||||
#endif
|
||||
|
||||
@@ -1153,7 +1153,7 @@ static uint8_t generateAckIeData(uint8_t *aLinkMetricsIeData, uint8_t aLinkMetri
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
if (aLinkMetricsIeData != NULL && aLinkMetricsIeDataLen > 0)
|
||||
{
|
||||
offset += otMacFrameGenerateEnhAckProbingIe(sAckIeData, aLinkMetricsIeData, aLinkMetricsIeDataLen);
|
||||
@@ -1237,7 +1237,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
otError otPlatRadioConfigureEnhAckProbing(otInstance * aInstance,
|
||||
otLinkMetrics aLinkMetrics,
|
||||
const otShortAddress aShortAddress,
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "common/pool.hpp"
|
||||
#include "thread/link_quality.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
using namespace ot;
|
||||
|
||||
@@ -260,4 +260,4 @@ uint8_t otLinkMetricsEnhAckGetDataLen(const otMacAddress *aMacAddress)
|
||||
exit:
|
||||
return len;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
@@ -237,7 +237,7 @@ uint8_t otMacFrameGenerateCslIeTemplate(uint8_t *aDest)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
uint8_t otMacFrameGenerateEnhAckProbingIe(uint8_t *aDest, const uint8_t *aIeData, uint8_t aIeDataLength)
|
||||
{
|
||||
uint8_t len = sizeof(Mac::VendorIeHeader) + aIeDataLength;
|
||||
@@ -267,4 +267,4 @@ void otMacFrameSetEnhAckProbingIe(otRadioFrame *aFrame, const uint8_t *aData, ui
|
||||
|
||||
reinterpret_cast<Mac::Frame *>(aFrame)->SetEnhAckProbingIe(aData, aDataLen);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
* @note This number versions both OpenThread platform and user APIs.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_API_VERSION (126)
|
||||
#define OPENTHREAD_API_VERSION (127)
|
||||
|
||||
/**
|
||||
* @addtogroup api-instance
|
||||
|
||||
@@ -199,6 +199,7 @@ otError otLinkMetricsConfigForwardTrackingSeries(otInstance *
|
||||
|
||||
/**
|
||||
* This function sends an MLE Link Metrics Management Request to configure/clear an Enhanced-ACK Based Probing.
|
||||
* This functionality requires OT_LINK_METRICS_INITIATOR feature enabled.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[in] aDestination A pointer to the destination address.
|
||||
|
||||
+2
-1
@@ -155,7 +155,8 @@ size_nrf52840_version()
|
||||
"-DOT_DUA=ON"
|
||||
"-DOT_MLR=ON"
|
||||
"-DOT_CSL_RECEIVER=ON"
|
||||
"-DOT_LINK_METRICS=ON"
|
||||
"-DOT_LINK_METRICS_INITIATOR=ON"
|
||||
"-DOT_LINK_METRICS_SUBJECT=ON"
|
||||
)
|
||||
fi
|
||||
|
||||
|
||||
+2
-1
@@ -104,7 +104,8 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
|
||||
'-DOT_JOINER=ON'
|
||||
'-DOT_LEGACY=ON'
|
||||
'-DOT_LINK_RAW=ON'
|
||||
'-DOT_LINK_METRICS=ON'
|
||||
'-DOT_LINK_METRICS_INITIATOR=ON'
|
||||
'-DOT_LINK_METRICS_SUBJECT=ON'
|
||||
'-DOT_MAC_FILTER=ON'
|
||||
'-DOT_MTD_NETDIAG=ON'
|
||||
'-DOT_PING_SENDER=ON'
|
||||
|
||||
+2
-1
@@ -83,7 +83,8 @@ build_simulation()
|
||||
|
||||
if [[ ${version} == "1.2" ]]; then
|
||||
options+=("-DOT_CSL_RECEIVER=ON")
|
||||
options+=("-DOT_LINK_METRICS=ON")
|
||||
options+=("-DOT_LINK_METRICS_INITIATOR=ON")
|
||||
options+=("-DOT_LINK_METRICS_SUBJECT=ON")
|
||||
fi
|
||||
|
||||
if [[ ${ot_extra_options[*]+x} ]]; then
|
||||
|
||||
+3
-3
@@ -68,7 +68,7 @@
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
#include <openthread/backbone_router_ftd.h>
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
#include <openthread/link_metrics.h>
|
||||
#endif
|
||||
#endif
|
||||
@@ -2167,7 +2167,7 @@ otError Interpreter::ProcessLeaderWeight(uint8_t aArgsLength, Arg aArgs[])
|
||||
}
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void Interpreter::HandleLinkMetricsReport(const otIp6Address * aAddress,
|
||||
const otLinkMetricsValues *aMetricsValues,
|
||||
uint8_t aStatus,
|
||||
@@ -2504,7 +2504,7 @@ otError Interpreter::ProcessLinkMetricsProbe(uint8_t aArgsLength, Arg aArgs[])
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_FTD
|
||||
otError Interpreter::ProcessPskc(uint8_t aArgsLength, Arg aArgs[])
|
||||
|
||||
+4
-4
@@ -521,7 +521,7 @@ private:
|
||||
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
|
||||
otError ProcessMlIid(uint8_t aArgsLength, Arg aArgs[]);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
otError ProcessLinkMetrics(uint8_t aArgsLength, Arg aArgs[]);
|
||||
otError ProcessLinkMetricsQuery(uint8_t aArgsLength, Arg aArgs[]);
|
||||
otError ProcessLinkMetricsMgmt(uint8_t aArgsLength, Arg aArgs[]);
|
||||
@@ -695,7 +695,7 @@ private:
|
||||
#if OPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE
|
||||
void HandleSntpResponse(uint64_t aTime, otError aResult);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void PrintLinkMetricsValue(const otLinkMetricsValues *aMetricsValues);
|
||||
|
||||
static void HandleLinkMetricsReport(const otIp6Address * aAddress,
|
||||
@@ -721,7 +721,7 @@ private:
|
||||
const otLinkMetricsValues *aMetricsValues);
|
||||
|
||||
const char *LinkMetricsStatusToStr(uint8_t aStatus);
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
|
||||
static void HandleDiscoveryRequest(const otThreadDiscoveryRequestInfo *aInfo, void *aContext)
|
||||
{
|
||||
@@ -811,7 +811,7 @@ private:
|
||||
#if OPENTHREAD_FTD
|
||||
{"leaderweight", &Interpreter::ProcessLeaderWeight},
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
{"linkmetrics", &Interpreter::ProcessLinkMetrics},
|
||||
#endif
|
||||
{"log", &Interpreter::ProcessLog},
|
||||
|
||||
+6
-2
@@ -168,8 +168,12 @@ if (openthread_enable_core_config_args) {
|
||||
defines += [ "OPENTHREAD_CONFIG_LEGACY_ENABLE=1" ]
|
||||
}
|
||||
|
||||
if (openthread_config_link_metrics_enable) {
|
||||
defines += [ "OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE=1" ]
|
||||
if (openthread_config_link_metrics_initiator_enable) {
|
||||
defines += [ "DOPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE=1" ]
|
||||
}
|
||||
|
||||
if (openthread_config_link_metrics_subject_enable) {
|
||||
defines += [ "DOPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE=1" ]
|
||||
}
|
||||
|
||||
if (openthread_config_link_raw_enable) {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#include <openthread/link_metrics.h>
|
||||
|
||||
@@ -74,6 +74,7 @@ otError otLinkMetricsConfigForwardTrackingSeries(otInstance *
|
||||
static_cast<const Ip6::Address &>(*aDestination), aSeriesId, aSeriesFlags, aLinkMetricsFlags);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
otError otLinkMetricsConfigEnhAckProbing(otInstance * aInstance,
|
||||
const otIp6Address * aDestination,
|
||||
const otLinkMetricsEnhAckFlags aEnhAckFlags,
|
||||
@@ -104,5 +105,6 @@ otError otLinkMetricsSendLinkProbe(otInstance * aInstance,
|
||||
return static_cast<Instance *>(aInstance)->Get<LinkMetrics>().SendLinkProbe(
|
||||
static_cast<const Ip6::Address &>(*aDestination), aSeriesId, aLength);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
#include "backbone_router/bbr_local.hpp"
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
#include "thread/link_metrics.hpp"
|
||||
#endif
|
||||
|
||||
@@ -891,7 +891,7 @@ template <> inline DuaManager &Instance::Get(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
template <> inline LinkMetrics &Instance::Get(void)
|
||||
{
|
||||
return mThreadNetif.mLinkMetrics;
|
||||
|
||||
@@ -703,7 +703,7 @@ void Message::SetLinkInfo(const ThreadLinkInfo &aLinkInfo)
|
||||
SetLinkSecurityEnabled(aLinkInfo.mLinkSecurity);
|
||||
SetPanId(aLinkInfo.mPanId);
|
||||
AddRss(aLinkInfo.mRss);
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
AddLqi(aLinkInfo.mLqi);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
|
||||
@@ -167,7 +167,7 @@ struct MessageMetadata
|
||||
uint16_t mLength; ///< Number of bytes within the message.
|
||||
uint16_t mOffset; ///< A byte offset within the message.
|
||||
RssAverager mRssAverager; ///< The averager maintaining the received signal strength (RSS) average.
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
LqiAverager mLqiAverager; ///< The averager maintaining the Link quality indicator (LQI) average.
|
||||
#endif
|
||||
|
||||
@@ -1108,7 +1108,7 @@ public:
|
||||
*/
|
||||
const RssAverager &GetRssAverager(void) const { return GetMetadata().mRssAverager; }
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This method updates the average LQI (Link Quality Indicator) associated with the message.
|
||||
*
|
||||
|
||||
+14
-4
@@ -261,13 +261,23 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
* @def OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
*
|
||||
* Define as 1 to enable Link Metrics feature.
|
||||
* Define as 1 to enable Link Metrics initiator feature.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE 0
|
||||
#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
*
|
||||
* Define as 1 to enable Link Metrics subject feature.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
#define OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -514,4 +514,9 @@
|
||||
"You can make OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MIN = OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT_MAX to specify a static UDP port. "
|
||||
#endif
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#error "OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE was replaced by OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE" \
|
||||
" and OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE"
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_CORE_CONFIG_CHECK_H_
|
||||
|
||||
@@ -1340,7 +1340,7 @@ void Mac::RecordFrameTransmitStatus(const TxFrame &aFrame,
|
||||
if ((aError == kErrorNone) && ackRequested && (aAckFrame != nullptr) && (neighbor != nullptr))
|
||||
{
|
||||
neighbor->GetLinkInfo().AddRss(aAckFrame->GetRssi());
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
neighbor->AggregateLinkMetrics(/* aSeriesId */ 0, aAckFrame->GetType(), aAckFrame->GetLqi(),
|
||||
aAckFrame->GetRssi());
|
||||
ProcessEnhAckProbing(*aAckFrame, *neighbor);
|
||||
@@ -2026,7 +2026,7 @@ void Mac::HandleReceivedFrame(RxFrame *aFrame, Error aError)
|
||||
if (neighbor != nullptr)
|
||||
{
|
||||
neighbor->GetLinkInfo().AddRss(aFrame->GetRssi());
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
neighbor->AggregateLinkMetrics(/* aSeriesId */ 0, aFrame->GetType(), aFrame->GetLqi(), aFrame->GetRssi());
|
||||
#endif
|
||||
|
||||
@@ -2478,7 +2478,7 @@ exit:
|
||||
}
|
||||
#endif // OPENTHREAD_FTD && OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void Mac::ProcessEnhAckProbing(const RxFrame &aFrame, const Neighbor &aNeighbor)
|
||||
{
|
||||
enum
|
||||
@@ -2501,7 +2501,7 @@ void Mac::ProcessEnhAckProbing(const RxFrame &aFrame, const Neighbor &aNeighbor)
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
} // namespace Mac
|
||||
} // namespace ot
|
||||
|
||||
@@ -820,7 +820,7 @@ private:
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
|
||||
void ProcessCsl(const RxFrame &aFrame, const Address &aSrcAddr);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void ProcessEnhAckProbing(const RxFrame &aFrame, const Neighbor &aNeighbor);
|
||||
#endif
|
||||
static const char *OperationToString(Operation aOperation);
|
||||
|
||||
@@ -975,7 +975,7 @@ exit:
|
||||
return header;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
const uint8_t *Frame::GetThreadIe(uint8_t aSubType) const
|
||||
{
|
||||
uint8_t index = FindHeaderIeIndex();
|
||||
@@ -1007,7 +1007,7 @@ const uint8_t *Frame::GetThreadIe(uint8_t aSubType) const
|
||||
exit:
|
||||
return header;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
|
||||
|
||||
@@ -1027,7 +1027,7 @@ exit:
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void Frame::SetEnhAckProbingIe(const uint8_t *aValue, uint8_t aLen)
|
||||
{
|
||||
uint8_t *cur = GetThreadIe(ThreadIe::kEnhAckProbingIe);
|
||||
@@ -1036,7 +1036,7 @@ void Frame::SetEnhAckProbingIe(const uint8_t *aValue, uint8_t aLen)
|
||||
|
||||
memcpy(cur + sizeof(HeaderIe) + sizeof(VendorIeHeader), aValue, aLen);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
const TimeIe *Frame::GetTimeIe(void) const
|
||||
|
||||
@@ -144,7 +144,8 @@ private:
|
||||
|
||||
} OT_TOOL_PACKED_END;
|
||||
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || \
|
||||
OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This class implements vendor specific Header IE generation and parsing.
|
||||
*
|
||||
@@ -274,7 +275,7 @@ private:
|
||||
} OT_TOOL_PACKED_END;
|
||||
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
class ThreadIe
|
||||
{
|
||||
public:
|
||||
@@ -296,7 +297,8 @@ public:
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE ||
|
||||
// OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
/**
|
||||
* This class implements IEEE 802.15.4 MAC frame generation and parsing.
|
||||
@@ -1024,7 +1026,7 @@ public:
|
||||
void SetCslIe(uint16_t aCslPeriod, uint16_t aCslPhase);
|
||||
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This method finds Enhanced ACK Probing (Vendor Specific) IE and set its value.
|
||||
*
|
||||
@@ -1033,7 +1035,7 @@ public:
|
||||
*
|
||||
*/
|
||||
void SetEnhAckProbingIe(const uint8_t *aValue, uint8_t aLen);
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
|
||||
|
||||
|
||||
@@ -598,7 +598,7 @@ public:
|
||||
*/
|
||||
uint32_t GetPreferredChannelMask(void);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This method enables/disables or updates Enhanced-ACK Based Probing in radio for a specific Initiator.
|
||||
*
|
||||
@@ -626,7 +626,7 @@ public:
|
||||
{
|
||||
return otPlatRadioConfigureEnhAckProbing(GetInstancePtr(), aLinkMetrics, aShortAddress, &aExtAddress);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
/**
|
||||
* This method checks if a given channel is valid as a CSL channel.
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include "link_metrics.hpp"
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#include "common/code_utils.hpp"
|
||||
#include "common/instance.hpp"
|
||||
@@ -139,6 +139,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address & aDestination,
|
||||
uint8_t aSeriesId,
|
||||
const otLinkMetricsSeriesFlags &aSeriesFlags,
|
||||
@@ -243,7 +244,9 @@ exit:
|
||||
otLogDebgMle("SendLinkProbe, error:%s, Series ID:%u", ErrorToString(error), aSeriesId);
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
Error LinkMetrics::AppendLinkMetricsReport(Message &aMessage, const Message &aRequestMessage, Neighbor &aNeighbor)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -409,6 +412,7 @@ Error LinkMetrics::HandleLinkMetricsManagementRequest(const Message & aMessag
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
Error LinkMetrics::HandleLinkMetricsManagementResponse(const Message &aMessage, const Ip6::Address &aAddress)
|
||||
{
|
||||
@@ -712,6 +716,7 @@ exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
LinkMetrics::LinkMetricsStatus LinkMetrics::ConfigureEnhAckProbing(LinkMetricsEnhAckFlags aEnhAckFlags,
|
||||
const otLinkMetrics & aLinkMetrics,
|
||||
Neighbor & aNeighbor)
|
||||
@@ -747,6 +752,7 @@ LinkMetrics::LinkMetricsStatus LinkMetrics::ConfigureEnhAckProbing(LinkMetricsEn
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
Neighbor *LinkMetrics::GetNeighborFromLinkLocalAddr(const Ip6::Address &aDestination)
|
||||
{
|
||||
@@ -880,4 +886,4 @@ exit:
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
@@ -36,10 +36,11 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#if (OPENTHREAD_CONFIG_THREAD_VERSION < OT_THREAD_VERSION_1_2)
|
||||
#error "Thread 1.2 or higher version is required for OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE."
|
||||
#error \
|
||||
"Thread 1.2 or higher version is required for OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE and OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE."
|
||||
#endif
|
||||
|
||||
#include <openthread/link.h>
|
||||
@@ -226,6 +227,7 @@ public:
|
||||
const otLinkMetricsSeriesFlags &aSeriesFlags,
|
||||
const otLinkMetrics * aLinkMetricsFlags);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
/**
|
||||
* This method sends an MLE Link Metrics Management Request to configure/clear a Enhanced-ACK Based Probing.
|
||||
*
|
||||
@@ -259,7 +261,9 @@ public:
|
||||
*
|
||||
*/
|
||||
Error SendLinkProbe(const Ip6::Address &aDestination, uint8_t aSeriesId, uint8_t aLength);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This method appends a Link Metrics Report to a message according to the Link Metrics query.
|
||||
*
|
||||
@@ -273,7 +277,7 @@ public:
|
||||
*
|
||||
*/
|
||||
Error AppendLinkMetricsReport(Message &aMessage, const Message &aRequestMessage, Neighbor &aNeighbor);
|
||||
|
||||
#endif
|
||||
/**
|
||||
* This method handles the received Link Metrics Management Request contained in @p aMessage and return a status.
|
||||
*
|
||||
@@ -346,7 +350,6 @@ public:
|
||||
|
||||
void SetLinkMetricsEnhAckProbingCallback(otLinkMetricsEnhAckProbingIeReportCallback aCallback,
|
||||
void * aCallbackContext);
|
||||
|
||||
void ProcessEnhAckIeData(const uint8_t *aData, uint8_t aLen, const Neighbor &aNeighbor);
|
||||
|
||||
private:
|
||||
@@ -413,6 +416,6 @@ private:
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#endif // LINK_METRICS_HPP
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "openthread-core-config.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#include <openthread/link_metrics.h>
|
||||
|
||||
@@ -620,6 +620,6 @@ private:
|
||||
|
||||
} // namespace ot
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#endif // LINK_METRICS_TLVS_HPP_
|
||||
|
||||
@@ -1300,7 +1300,7 @@ void MeshForwarder::HandleFragment(const uint8_t * aFrame,
|
||||
message->WriteBytes(message->GetOffset(), aFrame, aFrameLength);
|
||||
message->MoveOffset(aFrameLength);
|
||||
message->AddRss(aLinkInfo.GetRss());
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
message->AddLqi(aLinkInfo.GetLqi());
|
||||
#endif
|
||||
message->SetTimeout(kReassemblyTimeout);
|
||||
@@ -1629,7 +1629,7 @@ uint16_t MeshForwarder::CalcFrameVersion(const Neighbor *aNeighbor, bool aIePres
|
||||
version = Mac::Frame::kFcfFrameVersion2015;
|
||||
}
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
else if (aNeighbor != nullptr && aNeighbor->IsEnhAckProbingActive())
|
||||
{
|
||||
version = Mac::Frame::kFcfFrameVersion2015; ///< Set version to 2015 to fetch Link Metrics data in Enh-ACK.
|
||||
|
||||
+23
-12
@@ -2493,7 +2493,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
Error Mle::SendLinkMetricsManagementResponse(const Ip6::Address &aDestination, LinkMetrics::LinkMetricsStatus aStatus)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -2517,7 +2517,9 @@ Error Mle::SendLinkMetricsManagementResponse(const Ip6::Address &aDestination, L
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
Error Mle::SendLinkProbe(const Ip6::Address &aDestination, uint8_t aSeriesId, uint8_t *aBuf, uint8_t aLength)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -2538,7 +2540,7 @@ Error Mle::SendLinkProbe(const Ip6::Address &aDestination, uint8_t aSeriesId, ui
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif
|
||||
|
||||
Error Mle::SendMessage(Message &aMessage, const Ip6::Address &aDestination)
|
||||
{
|
||||
@@ -2866,15 +2868,19 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
#endif
|
||||
#endif // OPENTHREAD_FTD
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
case kCommandLinkMetricsManagementRequest:
|
||||
HandleLinkMetricsManagementRequest(aMessage, aMessageInfo, neighbor);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
case kCommandLinkMetricsManagementResponse:
|
||||
HandleLinkMetricsManagementResponse(aMessage, aMessageInfo, neighbor);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
case kCommandLinkProbe:
|
||||
HandleLinkProbe(aMessage, aMessageInfo, neighbor);
|
||||
break;
|
||||
@@ -2995,7 +3001,7 @@ exit:
|
||||
void Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, const Neighbor *aNeighbor)
|
||||
{
|
||||
Error error;
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
uint16_t metricsReportValueOffset;
|
||||
uint16_t length;
|
||||
#endif
|
||||
@@ -3004,7 +3010,7 @@ void Mle::HandleDataResponse(const Message &aMessage, const Ip6::MessageInfo &aM
|
||||
|
||||
VerifyOrExit(aNeighbor && aNeighbor->IsStateValid(), error = kErrorSecurity);
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
if (Tlv::FindTlvValueOffset(aMessage, Tlv::kLinkMetricsReport, metricsReportValueOffset, length) == kErrorNone)
|
||||
{
|
||||
Get<LinkMetrics>().HandleLinkMetricsReport(aMessage, metricsReportValueOffset, length,
|
||||
@@ -3864,7 +3870,7 @@ exit:
|
||||
LogProcessError(kTypeAnnounce, error);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void Mle::HandleLinkMetricsManagementRequest(const Message & aMessage,
|
||||
const Ip6::MessageInfo &aMessageInfo,
|
||||
Neighbor * aNeighbor)
|
||||
@@ -3883,6 +3889,9 @@ exit:
|
||||
LogProcessError(kTypeLinkMetricsManagementRequest, error);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void Mle::HandleLinkMetricsManagementResponse(const Message & aMessage,
|
||||
const Ip6::MessageInfo &aMessageInfo,
|
||||
Neighbor * aNeighbor)
|
||||
@@ -3898,7 +3907,9 @@ void Mle::HandleLinkMetricsManagementResponse(const Message & aMessage,
|
||||
exit:
|
||||
LogProcessError(kTypeLinkMetricsManagementResponse, error);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void Mle::HandleLinkProbe(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, Neighbor *aNeighbor)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
@@ -3913,7 +3924,7 @@ void Mle::HandleLinkProbe(const Message &aMessage, const Ip6::MessageInfo &aMess
|
||||
exit:
|
||||
LogProcessError(kTypeLinkProbe, error);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
void Mle::ProcessAnnounce(void)
|
||||
{
|
||||
@@ -4213,7 +4224,7 @@ const char *Mle::MessageTypeToString(MessageType aType)
|
||||
"Time Sync", // (28) kTypeTimeSync
|
||||
#endif
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
"Link Metrics Management Request", // (29) kTypeLinkMetricsManagementRequest
|
||||
"Link Metrics Management Response", // (30) kTypeLinkMetricsManagementResponse
|
||||
"Link Probe", // (31) kTypeLinkProbe
|
||||
@@ -4251,20 +4262,20 @@ const char *Mle::MessageTypeToString(MessageType aType)
|
||||
static_assert(kTypeParentRequest == 27, "kTypeParentRequest value is incorrect");
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
static_assert(kTypeTimeSync == 28, "kTypeTimeSync value is incorrect");
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
static_assert(kTypeLinkMetricsManagementRequest == 29, "kTypeLinkMetricsManagementRequest value is incorrect)");
|
||||
static_assert(kTypeLinkMetricsManagementResponse == 30, "kTypeLinkMetricsManagementResponse value is incorrect)");
|
||||
static_assert(kTypeLinkProbe == 31, "kTypeLinkProbe value is incorrect)");
|
||||
#endif
|
||||
#else // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
static_assert(kTypeLinkMetricsManagementRequest == 28, "kTypeLinkMetricsManagementRequest value is incorrect)");
|
||||
static_assert(kTypeLinkMetricsManagementResponse == 29, "kTypeLinkMetricsManagementResponse value is incorrect)");
|
||||
static_assert(kTypeLinkProbe == 30, "kTypeLinkProbe value is incorrect)");
|
||||
#endif
|
||||
#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
#else // OPENTHREAD_FTD
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
static_assert(kTypeLinkMetricsManagementRequest == 16, "kTypeLinkMetricsManagementRequest value is incorrect)");
|
||||
static_assert(kTypeLinkMetricsManagementResponse == 17, "kTypeLinkMetricsManagementResponse value is incorrect)");
|
||||
static_assert(kTypeLinkProbe == 18, "kTypeLinkProbe value is incorrect)");
|
||||
@@ -4397,7 +4408,7 @@ const char *Mle::ReattachStateToString(ReattachState aState)
|
||||
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
Error Mle::SendLinkMetricsManagementRequest(const Ip6::Address &aDestination, const uint8_t *aSubTlvs, uint8_t aLength)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
|
||||
@@ -96,7 +96,7 @@ class Mle : public InstanceLocator, private NonCopyable
|
||||
{
|
||||
friend class DiscoverScanner;
|
||||
friend class ot::Notifier;
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
friend class ot::LinkMetrics;
|
||||
#endif
|
||||
|
||||
@@ -872,7 +872,7 @@ protected:
|
||||
kTypeTimeSync,
|
||||
#endif
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
kTypeLinkMetricsManagementRequest,
|
||||
kTypeLinkMetricsManagementResponse,
|
||||
kTypeLinkProbe,
|
||||
@@ -1546,7 +1546,7 @@ protected:
|
||||
static const char *ReattachStateToString(ReattachState aState);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
/**
|
||||
* This method sends a Link Metrics Management Request message.
|
||||
*
|
||||
@@ -1762,13 +1762,17 @@ private:
|
||||
void HandleDataResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, const Neighbor *aNeighbor);
|
||||
void HandleParentResponse(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, uint32_t aKeySequence);
|
||||
void HandleAnnounce(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void HandleLinkMetricsManagementRequest(const Message & aMessage,
|
||||
const Ip6::MessageInfo &aMessageInfo,
|
||||
Neighbor * aNeighbor);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void HandleLinkMetricsManagementResponse(const Message & aMessage,
|
||||
const Ip6::MessageInfo &aMessageInfo,
|
||||
Neighbor * aNeighbor);
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void HandleLinkProbe(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, Neighbor *aNeighbor);
|
||||
#endif
|
||||
Error HandleLeaderData(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
@@ -1781,7 +1785,7 @@ private:
|
||||
Error SendOrphanAnnounce(void);
|
||||
bool PrepareAnnounceState(void);
|
||||
void SendAnnounce(uint8_t aChannel, bool aOrphanAnnounce, const Ip6::Address &aDestination);
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
Error SendLinkMetricsManagementResponse(const Ip6::Address &aDestination, LinkMetrics::LinkMetricsStatus aStatus);
|
||||
#endif
|
||||
uint32_t Reattach(void);
|
||||
|
||||
@@ -3251,7 +3251,7 @@ void MleRouter::SendDataResponse(const Ip6::Address &aDestination,
|
||||
SuccessOrExit(error = AppendPendingDataset(*message));
|
||||
break;
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
case Tlv::kLinkMetricsReport:
|
||||
OT_ASSERT(aRequestMessage != nullptr);
|
||||
neighbor = mNeighborTable.FindNeighbor(aDestination);
|
||||
@@ -3367,7 +3367,7 @@ void MleRouter::RemoveNeighbor(Neighbor &aNeighbor)
|
||||
|
||||
aNeighbor.GetLinkInfo().Clear();
|
||||
aNeighbor.SetState(Neighbor::kStateInvalid);
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
aNeighbor.RemoveAllForwardTrackingSeriesInfo();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ ThreadNetif::ThreadNetif(Instance &aInstance)
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
, mTimeSync(aInstance)
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
, mLinkMetrics(aInstance)
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -301,7 +301,7 @@ private:
|
||||
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
|
||||
TimeSync mTimeSync;
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
LinkMetrics mLinkMetrics;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -160,7 +160,7 @@ void Neighbor::GenerateChallenge(void)
|
||||
Random::Crypto::FillBuffer(mValidPending.mPending.mChallenge, sizeof(mValidPending.mPending.mChallenge)));
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
void Neighbor::AggregateLinkMetrics(uint8_t aSeriesId, uint8_t aFrameType, uint8_t aLqi, int8_t aRss)
|
||||
{
|
||||
for (LinkMetricsSeriesInfo *entry = mLinkMetricsSeriesInfoList.GetHead(); entry != nullptr;
|
||||
@@ -196,7 +196,7 @@ void Neighbor::RemoveAllForwardTrackingSeriesInfo(void)
|
||||
Get<LinkMetrics>().mLinkMetricsSeriesInfoPool.Free(*seriesInfo);
|
||||
}
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
const char *Neighbor::StateToString(State aState)
|
||||
{
|
||||
|
||||
@@ -664,7 +664,7 @@ public:
|
||||
void SetTimeSyncEnabled(bool aEnabled) { mTimeSyncEnabled = aEnabled; }
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
/**
|
||||
* This method aggregates the Link Metrics data into all the series that is running for this neighbor.
|
||||
*
|
||||
@@ -744,7 +744,7 @@ public:
|
||||
return (mEnhAckProbingMetrics.mLqi != 0) || (mEnhAckProbingMetrics.mLinkMargin != 0) ||
|
||||
(mEnhAckProbingMetrics.mRssi != 0);
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
|
||||
/**
|
||||
* This method converts a given `State` to a human-readable string.
|
||||
@@ -800,7 +800,7 @@ private:
|
||||
#endif
|
||||
uint8_t mVersion; ///< The MLE version
|
||||
LinkQualityInfo mLinkInfo; ///< Link quality info (contains average RSS, link margin and link quality)
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
LinkedList<LinkMetricsSeriesInfo> mLinkMetricsSeriesInfoList; ///< A list of Link Metrics Forward Tracking Series
|
||||
///< that is being tracked for this neighbor. Note
|
||||
///< that this device is the Subject and this
|
||||
|
||||
@@ -1934,7 +1934,7 @@ template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_CAPS>(void)
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_SRP_CLIENT));
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
SuccessOrExit(error = mEncoder.WriteUintPacked(SPINEL_CAP_THREAD_LINK_METRICS));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ protected:
|
||||
void HandleJoinerCallback(otError aError);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
static void HandleLinkMetricsReport_Jump(const otIp6Address * aSource,
|
||||
const otLinkMetricsValues *aMetricsValues,
|
||||
uint8_t aStatus,
|
||||
@@ -388,7 +388,7 @@ protected:
|
||||
otError EncodeChildInfo(const otChildInfo &aChildInfo);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
otError DecodeLinkMetrics(otLinkMetrics *aMetrics, bool aAllowPduCount);
|
||||
|
||||
otError EncodeLinkMetricsValues(const otLinkMetricsValues *aMetricsValues);
|
||||
|
||||
@@ -556,7 +556,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
|
||||
#if OPENTHREAD_FTD && (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2)
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_DOMAIN_NAME),
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_LINK_METRICS_QUERY),
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_LINK_METRICS_PROBE),
|
||||
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_LINK_METRICS_MGMT_ENH_ACK),
|
||||
|
||||
@@ -211,7 +211,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
otError NcpBase::DecodeLinkMetrics(otLinkMetrics *aMetrics, bool aAllowPduCount)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
@@ -3136,7 +3136,7 @@ exit:
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MAC_FILTER_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_LINK_METRICS_QUERY>(void)
|
||||
{
|
||||
otError error = OT_ERROR_NONE;
|
||||
@@ -3233,7 +3233,7 @@ template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_THREAD_LINK_METRICS_M
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
|
||||
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_THREAD_MODE>(void)
|
||||
{
|
||||
@@ -4337,7 +4337,7 @@ void NcpBase::HandleJoinerCallback(otError aError)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||
void NcpBase::HandleLinkMetricsReport_Jump(const otIp6Address * aSource,
|
||||
const otLinkMetricsValues *aMetricsValues,
|
||||
uint8_t aStatus,
|
||||
|
||||
@@ -684,7 +684,7 @@ otError otPlatTrelUdp6SetTestMode(otInstance *aInstance, bool aEnable)
|
||||
|
||||
#endif // OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
|
||||
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE
|
||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
|
||||
otError otPlatRadioConfigureEnhAckProbing(otInstance * aInstance,
|
||||
otLinkMetrics aLinkMetrics,
|
||||
const otShortAddress aShortAddress,
|
||||
|
||||
Reference in New Issue
Block a user