mirror of
https://github.com/espressif/openthread.git
synced 2026-10-04 06:47:36 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user