[neighbor] change IsThreadVersion1p2() to include higher versions (#7755)

This commit is contained in:
Jonathan Hui
2022-05-26 09:07:41 -07:00
committed by GitHub
parent d266f90fbf
commit cbb51b01ce
2 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -117,7 +117,7 @@ Error LinkMetrics::Query(const Ip6::Address &aDestination, uint8_t aSeriesId, co
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
if (aMetrics != nullptr)
{
@@ -150,7 +150,7 @@ Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address &
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
// Directly transform `aMetrics` into TypeIdFlags and put them into `subTlvs`
if (aMetrics != nullptr)
@@ -187,7 +187,7 @@ Error LinkMetrics::SendMgmtRequestEnhAckProbing(const Ip6::Address &aDestination
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
if (aEnhAckFlags == kEnhAckClear)
{
@@ -227,7 +227,7 @@ Error LinkMetrics::SendLinkProbe(const Ip6::Address &aDestination, uint8_t aSeri
Neighbor *neighbor = GetNeighborFromLinkLocalAddr(aDestination);
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
VerifyOrExit(aLength <= LinkMetrics::kLinkProbeMaxLen && aSeriesId != kQueryIdSingleProbe &&
aSeriesId != kSeriesIdAllSeries,
+6 -6
View File
@@ -552,20 +552,20 @@ public:
#endif // OPENTHREAD_CONFIG_MULTI_RADIO
/**
* This method indicates whether or not it is a valid Thread 1.1 neighbor.
* This method indicates whether or not it is Thread 1.1.
*
* @returns TRUE if it is a valid Thread 1.1 neighbor, FALSE otherwise.
* @returns TRUE if neighbors is Thread 1.1, FALSE otherwise.
*
*/
bool IsThreadVersion1p1(void) const { return mState != kStateInvalid && mVersion == OT_THREAD_VERSION_1_1; }
/**
* This method indicates whether or not it is a valid Thread 1.2 neighbor.
* This method indicates whether or not neighbor is Thread 1.2 or higher..
*
* @returns TRUE if it is a valid Thread 1.2 neighbor, FALSE otherwise.
* @returns TRUE if neighbor is Thread 1.2 or higher, FALSE otherwise.
*
*/
bool IsThreadVersion1p2(void) const { return mState != kStateInvalid && mVersion == OT_THREAD_VERSION_1_2; }
bool IsThreadVersion1p2OrHigher(void) const { return mState != kStateInvalid && mVersion >= OT_THREAD_VERSION_1_2; }
/**
* This method indicates whether Thread version supports CSL.
@@ -573,7 +573,7 @@ public:
* @returns TRUE if CSL is supported, FALSE otherwise.
*
*/
bool IsThreadVersionCslCapable(void) const { return IsThreadVersion1p2() && !IsRxOnWhenIdle(); }
bool IsThreadVersionCslCapable(void) const { return IsThreadVersion1p2OrHigher() && !IsRxOnWhenIdle(); }
/**
* This method indicates whether Enhanced Keep-Alive is supported or not.