mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 07:00:08 +00:00
[link-metrics] simplify processing of SeriesFlags (#8116)
This commit updates `SeriesFlags` definition to map to the public `otLinkMetricsSeriesFlags` struct and adds helper methods to convert to or set it from a `uint8_t` flags bitmask which is read or written in the TLVs.
This commit is contained in:
@@ -67,8 +67,8 @@ otError otLinkMetricsConfigForwardTrackingSeries(otInstance *
|
|||||||
|
|
||||||
linkMetrics.SetMgmtResponseCallback(aCallback, aCallbackContext);
|
linkMetrics.SetMgmtResponseCallback(aCallback, aCallbackContext);
|
||||||
|
|
||||||
return linkMetrics.SendMgmtRequestForwardTrackingSeries(AsCoreType(aDestination), aSeriesId, aSeriesFlags,
|
return linkMetrics.SendMgmtRequestForwardTrackingSeries(
|
||||||
AsCoreTypePtr(aLinkMetricsFlags));
|
AsCoreType(aDestination), aSeriesId, AsCoreType(&aSeriesFlags), AsCoreTypePtr(aLinkMetricsFlags));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||||
|
|||||||
@@ -89,10 +89,10 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||||
Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address & aDestination,
|
Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address &aDestination,
|
||||||
uint8_t aSeriesId,
|
uint8_t aSeriesId,
|
||||||
const SeriesFlags::Info &aSeriesFlags,
|
const SeriesFlags & aSeriesFlags,
|
||||||
const Metrics * aMetrics)
|
const Metrics * aMetrics)
|
||||||
{
|
{
|
||||||
Error error = kErrorNone;
|
Error error = kErrorNone;
|
||||||
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
||||||
@@ -106,14 +106,14 @@ Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address &
|
|||||||
|
|
||||||
fwdProbingSubTlv.Init();
|
fwdProbingSubTlv.Init();
|
||||||
fwdProbingSubTlv.SetSeriesId(aSeriesId);
|
fwdProbingSubTlv.SetSeriesId(aSeriesId);
|
||||||
fwdProbingSubTlv.GetSeriesFlags().SetFrom(aSeriesFlags);
|
fwdProbingSubTlv.SetSeriesFlagsMask(aSeriesFlags.ConvertToMask());
|
||||||
|
|
||||||
if (aMetrics != nullptr)
|
if (aMetrics != nullptr)
|
||||||
{
|
{
|
||||||
typeIdCount = TypeIdFlagsFromMetrics(fwdProbingSubTlv.GetTypeIds(), *aMetrics);
|
typeIdCount = TypeIdFlagsFromMetrics(fwdProbingSubTlv.GetTypeIds(), *aMetrics);
|
||||||
}
|
}
|
||||||
|
|
||||||
fwdProbingSubTlv.SetLength(sizeof(aSeriesId) + sizeof(SeriesFlags) + typeIdCount * sizeof(TypeIdFlags));
|
fwdProbingSubTlv.SetLength(sizeof(aSeriesId) + sizeof(uint8_t) + typeIdCount * sizeof(TypeIdFlags));
|
||||||
|
|
||||||
error = Get<Mle::MleRouter>().SendLinkMetricsManagementRequest(aDestination, fwdProbingSubTlv);
|
error = Get<Mle::MleRouter>().SendLinkMetricsManagementRequest(aDestination, fwdProbingSubTlv);
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ Error LinkMetrics::HandleManagementRequest(const Message &aMessage, Neighbor &aN
|
|||||||
Error error = kErrorNone;
|
Error error = kErrorNone;
|
||||||
Tlv tlv;
|
Tlv tlv;
|
||||||
uint8_t seriesId;
|
uint8_t seriesId;
|
||||||
SeriesFlags seriesFlags;
|
uint8_t seriesFlagsMask;
|
||||||
EnhAckFlags enhAckFlags;
|
EnhAckFlags enhAckFlags;
|
||||||
Metrics metrics;
|
Metrics metrics;
|
||||||
bool hasForwardProbingRegistrationTlv = false;
|
bool hasForwardProbingRegistrationTlv = false;
|
||||||
@@ -312,11 +312,11 @@ Error LinkMetrics::HandleManagementRequest(const Message &aMessage, Neighbor &aN
|
|||||||
{
|
{
|
||||||
case SubTlv::kFwdProbingReg:
|
case SubTlv::kFwdProbingReg:
|
||||||
VerifyOrExit(!hasForwardProbingRegistrationTlv && !hasEnhAckProbingTlv, error = kErrorParse);
|
VerifyOrExit(!hasForwardProbingRegistrationTlv && !hasEnhAckProbingTlv, error = kErrorParse);
|
||||||
VerifyOrExit(tlv.GetLength() >= sizeof(seriesId) + sizeof(seriesFlags), error = kErrorParse);
|
VerifyOrExit(tlv.GetLength() >= sizeof(seriesId) + sizeof(seriesFlagsMask), error = kErrorParse);
|
||||||
SuccessOrExit(aMessage.Read(pos, seriesId));
|
SuccessOrExit(aMessage.Read(pos, seriesId));
|
||||||
pos += sizeof(seriesId);
|
pos += sizeof(seriesId);
|
||||||
SuccessOrExit(aMessage.Read(pos, seriesFlags));
|
SuccessOrExit(aMessage.Read(pos, seriesFlagsMask));
|
||||||
pos += sizeof(seriesFlags);
|
pos += sizeof(seriesFlagsMask);
|
||||||
SuccessOrExit(error = ReadTypeIdFlagsFromMessage(
|
SuccessOrExit(error = ReadTypeIdFlagsFromMessage(
|
||||||
aMessage, pos, static_cast<uint16_t>(offset + index + tlv.GetSize()), metrics));
|
aMessage, pos, static_cast<uint16_t>(offset + index + tlv.GetSize()), metrics));
|
||||||
hasForwardProbingRegistrationTlv = true;
|
hasForwardProbingRegistrationTlv = true;
|
||||||
@@ -341,7 +341,7 @@ Error LinkMetrics::HandleManagementRequest(const Message &aMessage, Neighbor &aN
|
|||||||
|
|
||||||
if (hasForwardProbingRegistrationTlv)
|
if (hasForwardProbingRegistrationTlv)
|
||||||
{
|
{
|
||||||
aStatus = ConfigureForwardTrackingSeries(seriesId, seriesFlags, metrics, aNeighbor);
|
aStatus = ConfigureForwardTrackingSeries(seriesId, seriesFlagsMask, metrics, aNeighbor);
|
||||||
}
|
}
|
||||||
else if (hasEnhAckProbingTlv)
|
else if (hasEnhAckProbingTlv)
|
||||||
{
|
{
|
||||||
@@ -610,15 +610,16 @@ exit:
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status LinkMetrics::ConfigureForwardTrackingSeries(uint8_t aSeriesId,
|
Status LinkMetrics::ConfigureForwardTrackingSeries(uint8_t aSeriesId,
|
||||||
const SeriesFlags &aSeriesFlags,
|
uint8_t aSeriesFlagsMask,
|
||||||
const Metrics & aMetrics,
|
const Metrics &aMetrics,
|
||||||
Neighbor & aNeighbor)
|
Neighbor & aNeighbor)
|
||||||
{
|
{
|
||||||
Status status = kStatusSuccess;
|
Status status = kStatusSuccess;
|
||||||
|
|
||||||
VerifyOrExit(0 < aSeriesId, status = kStatusOtherError);
|
VerifyOrExit(0 < aSeriesId, status = kStatusOtherError);
|
||||||
if (aSeriesFlags.GetRawValue() == 0) // Remove the series
|
|
||||||
|
if (aSeriesFlagsMask == 0) // Remove the series
|
||||||
{
|
{
|
||||||
if (aSeriesId == kSeriesIdAllSeries) // Remove all
|
if (aSeriesId == kSeriesIdAllSeries) // Remove all
|
||||||
{
|
{
|
||||||
@@ -638,7 +639,7 @@ Status LinkMetrics::ConfigureForwardTrackingSeries(uint8_t aSeriesId,
|
|||||||
seriesInfo = mSeriesInfoPool.Allocate();
|
seriesInfo = mSeriesInfoPool.Allocate();
|
||||||
VerifyOrExit(seriesInfo != nullptr, status = kStatusCannotSupportNewSeries);
|
VerifyOrExit(seriesInfo != nullptr, status = kStatusCannotSupportNewSeries);
|
||||||
|
|
||||||
seriesInfo->Init(aSeriesId, aSeriesFlags, aMetrics);
|
seriesInfo->Init(aSeriesId, aSeriesFlagsMask, aMetrics);
|
||||||
|
|
||||||
aNeighbor.AddForwardTrackingSeriesInfo(*seriesInfo);
|
aNeighbor.AddForwardTrackingSeriesInfo(*seriesInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,10 +123,10 @@ public:
|
|||||||
* @retval kErrorUnknownNeighbor @p aDestination is not link-local or the neighbor is not found.
|
* @retval kErrorUnknownNeighbor @p aDestination is not link-local or the neighbor is not found.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Error SendMgmtRequestForwardTrackingSeries(const Ip6::Address & aDestination,
|
Error SendMgmtRequestForwardTrackingSeries(const Ip6::Address &aDestination,
|
||||||
uint8_t aSeriesId,
|
uint8_t aSeriesId,
|
||||||
const SeriesFlags::Info &aSeriesFlags,
|
const SeriesFlags & aSeriesFlags,
|
||||||
const Metrics * aMetrics);
|
const Metrics * aMetrics);
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE
|
||||||
/**
|
/**
|
||||||
@@ -282,10 +282,10 @@ private:
|
|||||||
const TypeIdFlags * aTypeIdFlags,
|
const TypeIdFlags * aTypeIdFlags,
|
||||||
uint8_t aTypeIdFlagsCount);
|
uint8_t aTypeIdFlagsCount);
|
||||||
|
|
||||||
Status ConfigureForwardTrackingSeries(uint8_t aSeriesId,
|
Status ConfigureForwardTrackingSeries(uint8_t aSeriesId,
|
||||||
const SeriesFlags &aSeriesFlags,
|
uint8_t aSeriesFlags,
|
||||||
const Metrics & aMetrics,
|
const Metrics &aMetrics,
|
||||||
Neighbor & aNeighbor);
|
Neighbor & aNeighbor);
|
||||||
|
|
||||||
Status ConfigureEnhAckProbing(EnhAckFlags aEnhAckFlags, const Metrics &aMetrics, Neighbor &aNeighbor);
|
Status ConfigureEnhAckProbing(EnhAckFlags aEnhAckFlags, const Metrics &aMetrics, Neighbor &aNeighbor);
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ OT_TOOL_PACKED_BEGIN
|
|||||||
class FwdProbingRegSubTlv : public Tlv, public TlvInfo<SubTlv::kFwdProbingReg>
|
class FwdProbingRegSubTlv : public Tlv, public TlvInfo<SubTlv::kFwdProbingReg>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t kMinLength = sizeof(uint8_t) + sizeof(SeriesFlags); ///< Minimum expected TLV length
|
static constexpr uint8_t kMinLength = sizeof(uint8_t) + sizeof(uint8_t); ///< Minimum expected TLV length
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method initializes the TLV.
|
* This method initializes the TLV.
|
||||||
@@ -255,20 +255,20 @@ public:
|
|||||||
void SetSeriesId(uint8_t aSeriesId) { mSeriesId = aSeriesId; }
|
void SetSeriesId(uint8_t aSeriesId) { mSeriesId = aSeriesId; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets the Forward Series Flags.
|
* This method gets the Forward Series Flags bit-mask.
|
||||||
*
|
*
|
||||||
* @returns The Forward Series Flags.
|
* @returns The Forward Series Flags mask.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
SeriesFlags &GetSeriesFlags(void) { return mSeriesFlags; }
|
uint8_t GetSeriesFlagsMask(void) { return mSeriesFlagsMask; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method sets the Forward Series Flags.
|
* This method sets the Forward Series Flags bit-mask
|
||||||
*
|
*
|
||||||
* @param[in] aSeriesFlags The Forward Series Flags.
|
* @param[in] aSeriesFlagsMask The Forward Series Flags.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void SetSeriesFlags(const SeriesFlags &aSeriesFlags) { mSeriesFlags = aSeriesFlags; }
|
void SetSeriesFlagsMask(uint8_t aSeriesFlagsMask) { mSeriesFlagsMask = aSeriesFlagsMask; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets the start of Type ID Flags array.
|
* This method gets the start of Type ID Flags array.
|
||||||
@@ -280,7 +280,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
uint8_t mSeriesId;
|
uint8_t mSeriesId;
|
||||||
SeriesFlags mSeriesFlags;
|
uint8_t mSeriesFlagsMask;
|
||||||
TypeIdFlags mTypeIds[kMaxTypeIdFlags];
|
TypeIdFlags mTypeIds[kMaxTypeIdFlags];
|
||||||
} OT_TOOL_PACKED_END;
|
} OT_TOOL_PACKED_END;
|
||||||
|
|
||||||
|
|||||||
@@ -81,39 +81,34 @@ uint8_t TypeIdFlagsFromMetrics(TypeIdFlags aTypeIdFlags[], const Metrics &aMetri
|
|||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// SeriesFlags
|
// SeriesFlags
|
||||||
|
|
||||||
void SeriesFlags::SetFrom(const Info &aSeriesFlags)
|
uint8_t SeriesFlags::ConvertToMask(void) const
|
||||||
{
|
{
|
||||||
Clear();
|
uint8_t mask = 0;
|
||||||
|
|
||||||
if (aSeriesFlags.mLinkProbe)
|
mask |= (mLinkProbe ? kLinkProbeFlag : 0);
|
||||||
{
|
mask |= (mMacData ? kMacDataFlag : 0);
|
||||||
SetLinkProbeFlag();
|
mask |= (mMacDataRequest ? kMacDataRequestFlag : 0);
|
||||||
}
|
mask |= (mMacAck ? kMacAckFlag : 0);
|
||||||
|
|
||||||
if (aSeriesFlags.mMacData)
|
return mask;
|
||||||
{
|
}
|
||||||
SetMacDataFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aSeriesFlags.mMacDataRequest)
|
void SeriesFlags::SetFrom(uint8_t aFlagsMask)
|
||||||
{
|
{
|
||||||
SetMacDataRequestFlag();
|
mLinkProbe = (aFlagsMask & kLinkProbeFlag);
|
||||||
}
|
mMacData = (aFlagsMask & kMacDataFlag);
|
||||||
|
mMacDataRequest = (aFlagsMask & kMacDataRequestFlag);
|
||||||
if (aSeriesFlags.mMacAck)
|
mMacAck = (aFlagsMask & kMacAckFlag);
|
||||||
{
|
|
||||||
SetMacAckFlag();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
// SeriesInfo
|
// SeriesInfo
|
||||||
|
|
||||||
void SeriesInfo::Init(uint8_t aSeriesId, const SeriesFlags &aSeriesFlags, const Metrics &aMetrics)
|
void SeriesInfo::Init(uint8_t aSeriesId, uint8_t aSeriesFlagsMask, const Metrics &aMetrics)
|
||||||
{
|
{
|
||||||
mSeriesId = aSeriesId;
|
mSeriesId = aSeriesId;
|
||||||
mSeriesFlags = aSeriesFlags;
|
mSeriesFlags.SetFrom(aSeriesFlagsMask);
|
||||||
mMetrics = aMetrics;
|
mMetrics = aMetrics;
|
||||||
mRssAverager.Clear();
|
mRssAverager.Clear();
|
||||||
mLqiAverager.Clear();
|
mLqiAverager.Clear();
|
||||||
mPduCount = 0;
|
mPduCount = 0;
|
||||||
|
|||||||
@@ -298,49 +298,27 @@ private:
|
|||||||
} OT_TOOL_PACKED_END;
|
} OT_TOOL_PACKED_END;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class implements Series Flags for Forward Tracking Series.
|
* This class represents the Series Flags for Forward Tracking Series.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
OT_TOOL_PACKED_BEGIN
|
class SeriesFlags : public otLinkMetricsSeriesFlags
|
||||||
class SeriesFlags
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* This type represents which frames to be accounted in a Forward Tracking Series.
|
* This method converts the `SeriesFlags` to `uint8_t` bit-mask (for inclusion in TLVs).
|
||||||
*
|
*
|
||||||
* @sa otLinkMetricsSeriesFlags
|
* @returns The bit-mask representation.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef otLinkMetricsSeriesFlags Info;
|
uint8_t ConvertToMask(void) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor.
|
* This method sets the `SeriesFlags` from a given bit-mask value.
|
||||||
|
*
|
||||||
|
* @param[in] aFlagsMask The bit-mask flags.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
SeriesFlags(void)
|
void SetFrom(uint8_t aFlagsMask);
|
||||||
: mFlags(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the values from an `Info` object.
|
|
||||||
*
|
|
||||||
* @param[in] aSeriesFlags The `Info` object.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SetFrom(const Info &aSeriesFlags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method clears the Link Probe flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void ClearLinkProbeFlag(void) { mFlags &= ~kLinkProbeFlag; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the Link Probe flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SetLinkProbeFlag(void) { mFlags |= kLinkProbeFlag; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method indicates whether or not the Link Probe flag is set.
|
* This method indicates whether or not the Link Probe flag is set.
|
||||||
@@ -349,19 +327,7 @@ public:
|
|||||||
* @retval false The Link Probe flag is not set.
|
* @retval false The Link Probe flag is not set.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool IsLinkProbeFlagSet(void) const { return (mFlags & kLinkProbeFlag) != 0; }
|
bool IsLinkProbeFlagSet(void) const { return mLinkProbe; }
|
||||||
|
|
||||||
/**
|
|
||||||
* This method clears the MAC Data flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void ClearMacDataFlag(void) { mFlags &= ~kMacDataFlag; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the MAC Data flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SetMacDataFlag(void) { mFlags |= kMacDataFlag; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method indicates whether or not the MAC Data flag is set.
|
* This method indicates whether or not the MAC Data flag is set.
|
||||||
@@ -370,19 +336,7 @@ public:
|
|||||||
* @retval false The MAC Data flag is not set.
|
* @retval false The MAC Data flag is not set.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool IsMacDataFlagSet(void) const { return (mFlags & kMacDataFlag) != 0; }
|
bool IsMacDataFlagSet(void) const { return mMacData; }
|
||||||
|
|
||||||
/**
|
|
||||||
* This method clears the MAC Data Request flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void ClearMacDataRequestFlag(void) { mFlags &= ~kMacDataRequestFlag; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the MAC Data Request flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SetMacDataRequestFlag(void) { mFlags |= kMacDataRequestFlag; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method indicates whether or not the MAC Data Request flag is set.
|
* This method indicates whether or not the MAC Data Request flag is set.
|
||||||
@@ -391,19 +345,7 @@ public:
|
|||||||
* @retval false The MAC Data Request flag is not set.
|
* @retval false The MAC Data Request flag is not set.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool IsMacDataRequestFlagSet(void) const { return (mFlags & kMacDataRequestFlag) != 0; }
|
bool IsMacDataRequestFlagSet(void) const { return mMacDataRequest; }
|
||||||
|
|
||||||
/**
|
|
||||||
* This method clears the Mac Ack flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void ClearMacAckFlag(void) { mFlags &= ~kMacAckFlag; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method sets the Mac Ack flag.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SetMacAckFlag(void) { mFlags |= kMacAckFlag; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method indicates whether or not the Mac Ack flag is set.
|
* This method indicates whether or not the Mac Ack flag is set.
|
||||||
@@ -412,28 +354,14 @@ public:
|
|||||||
* @retval false The Mac Ack flag is not set.
|
* @retval false The Mac Ack flag is not set.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool IsMacAckFlagSet(void) const { return (mFlags & kMacAckFlag) != 0; }
|
bool IsMacAckFlagSet(void) const { return mMacAck; }
|
||||||
|
|
||||||
/**
|
|
||||||
* This method returns the raw value of flags.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
uint8_t GetRawValue(void) const { return mFlags; }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method clears the all the flags.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void Clear(void) { mFlags = 0; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr uint8_t kLinkProbeFlag = 1 << 0;
|
static constexpr uint8_t kLinkProbeFlag = 1 << 0;
|
||||||
static constexpr uint8_t kMacDataFlag = 1 << 1;
|
static constexpr uint8_t kMacDataFlag = 1 << 1;
|
||||||
static constexpr uint8_t kMacDataRequestFlag = 1 << 2;
|
static constexpr uint8_t kMacDataRequestFlag = 1 << 2;
|
||||||
static constexpr uint8_t kMacAckFlag = 1 << 3;
|
static constexpr uint8_t kMacAckFlag = 1 << 3;
|
||||||
|
};
|
||||||
uint8_t mFlags;
|
|
||||||
} OT_TOOL_PACKED_END;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This enumeration type represent Enhanced-ACK Flags.
|
* This enumeration type represent Enhanced-ACK Flags.
|
||||||
@@ -477,12 +405,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* This method initializes the SeriesInfo object.
|
* This method initializes the SeriesInfo object.
|
||||||
*
|
*
|
||||||
* @param[in] aSeriesId The Series ID.
|
* @param[in] aSeriesId The Series ID.
|
||||||
* @param[in] aSeriesFlags The Series Flags which specify what types of frames are to be accounted.
|
* @param[in] aSeriesFlagsMask The Series Flags bitmask which specify what types of frames are to be accounted.
|
||||||
* @param[in] aMetrics Metrics to query.
|
* @param[in] aMetrics Metrics to query.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void Init(uint8_t aSeriesId, const SeriesFlags &aSeriesFlags, const Metrics &aMetrics);
|
void Init(uint8_t aSeriesId, uint8_t aSeriesFlagsMask, const Metrics &aMetrics);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method gets the Series ID.
|
* This method gets the Series ID.
|
||||||
@@ -565,6 +493,7 @@ enum Status : uint8_t
|
|||||||
|
|
||||||
DefineCoreType(otLinkMetrics, LinkMetrics::Metrics);
|
DefineCoreType(otLinkMetrics, LinkMetrics::Metrics);
|
||||||
DefineCoreType(otLinkMetricsValues, LinkMetrics::MetricsValues);
|
DefineCoreType(otLinkMetricsValues, LinkMetrics::MetricsValues);
|
||||||
|
DefineCoreType(otLinkMetricsSeriesFlags, LinkMetrics::SeriesFlags);
|
||||||
DefineMapEnum(otLinkMetricsEnhAckFlags, LinkMetrics::EnhAckFlags);
|
DefineMapEnum(otLinkMetricsEnhAckFlags, LinkMetrics::EnhAckFlags);
|
||||||
DefineMapEnum(otLinkMetricsStatus, LinkMetrics::Status);
|
DefineMapEnum(otLinkMetricsStatus, LinkMetrics::Status);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user