From b2e813429be64f7641294be1325ccca40bd0b614 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 13 Mar 2023 10:37:24 -0700 Subject: [PATCH] [mesh-diag] update `kMaxTlvsToRequest` constant (#8853) This commit updates `kMaxTlvsToRequest` constant to account for the recently added `VersionTlv`. It also moves its definition from header file to cpp file in `SendDiagGetTo()` method so to make it easier to track and update it when/if new TLV types are added. --- src/core/utils/mesh_diag.cpp | 2 ++ src/core/utils/mesh_diag.hpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/utils/mesh_diag.cpp b/src/core/utils/mesh_diag.cpp index 29824a2da..f49932990 100644 --- a/src/core/utils/mesh_diag.cpp +++ b/src/core/utils/mesh_diag.cpp @@ -90,6 +90,8 @@ void MeshDiag::Cancel(void) Error MeshDiag::SendDiagGetTo(uint16_t aRloc16, const DiscoverConfig &aConfig) { + static constexpr uint8_t kMaxTlvsToRequest = 6; + Error error = kErrorNone; Coap::Message *message = nullptr; Tmf::MessageInfo messageInfo(GetInstance()); diff --git a/src/core/utils/mesh_diag.hpp b/src/core/utils/mesh_diag.hpp index 494e78462..931a080a7 100644 --- a/src/core/utils/mesh_diag.hpp +++ b/src/core/utils/mesh_diag.hpp @@ -182,8 +182,7 @@ public: private: typedef ot::NetworkDiagnostic::Tlv Tlv; - static constexpr uint32_t kResponseTimeout = OPENTHREAD_CONFIG_MESH_DIAG_RESPONSE_TIMEOUT; - static constexpr uint8_t kMaxTlvsToRequest = 5; + static constexpr uint32_t kResponseTimeout = OPENTHREAD_CONFIG_MESH_DIAG_RESPONSE_TIMEOUT; Error SendDiagGetTo(uint16_t aRloc16, const DiscoverConfig &aConfig); void HandleTimer(void);