mirror of
https://github.com/espressif/openthread.git
synced 2026-09-17 22:50:07 +00:00
[neighbor] change IsThreadVersion1p2() to include higher versions (#7755)
This commit is contained in:
@@ -117,7 +117,7 @@ Error LinkMetrics::Query(const Ip6::Address &aDestination, uint8_t aSeriesId, co
|
|||||||
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
||||||
|
|
||||||
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
||||||
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
|
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
|
||||||
|
|
||||||
if (aMetrics != nullptr)
|
if (aMetrics != nullptr)
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ Error LinkMetrics::SendMgmtRequestForwardTrackingSeries(const Ip6::Address &
|
|||||||
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
||||||
|
|
||||||
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
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`
|
// Directly transform `aMetrics` into TypeIdFlags and put them into `subTlvs`
|
||||||
if (aMetrics != nullptr)
|
if (aMetrics != nullptr)
|
||||||
@@ -187,7 +187,7 @@ Error LinkMetrics::SendMgmtRequestEnhAckProbing(const Ip6::Address &aDestination
|
|||||||
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
Neighbor * neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
||||||
|
|
||||||
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
||||||
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
|
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
|
||||||
|
|
||||||
if (aEnhAckFlags == kEnhAckClear)
|
if (aEnhAckFlags == kEnhAckClear)
|
||||||
{
|
{
|
||||||
@@ -227,7 +227,7 @@ Error LinkMetrics::SendLinkProbe(const Ip6::Address &aDestination, uint8_t aSeri
|
|||||||
Neighbor *neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
Neighbor *neighbor = GetNeighborFromLinkLocalAddr(aDestination);
|
||||||
|
|
||||||
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
VerifyOrExit(neighbor != nullptr, error = kErrorUnknownNeighbor);
|
||||||
VerifyOrExit(neighbor->IsThreadVersion1p2(), error = kErrorNotCapable);
|
VerifyOrExit(neighbor->IsThreadVersion1p2OrHigher(), error = kErrorNotCapable);
|
||||||
|
|
||||||
VerifyOrExit(aLength <= LinkMetrics::kLinkProbeMaxLen && aSeriesId != kQueryIdSingleProbe &&
|
VerifyOrExit(aLength <= LinkMetrics::kLinkProbeMaxLen && aSeriesId != kQueryIdSingleProbe &&
|
||||||
aSeriesId != kSeriesIdAllSeries,
|
aSeriesId != kSeriesIdAllSeries,
|
||||||
|
|||||||
@@ -552,20 +552,20 @@ public:
|
|||||||
#endif // OPENTHREAD_CONFIG_MULTI_RADIO
|
#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; }
|
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.
|
* This method indicates whether Thread version supports CSL.
|
||||||
@@ -573,7 +573,7 @@ public:
|
|||||||
* @returns TRUE if CSL is supported, FALSE otherwise.
|
* @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.
|
* This method indicates whether Enhanced Keep-Alive is supported or not.
|
||||||
|
|||||||
Reference in New Issue
Block a user