From 53b239fd6492c8754c6d51d6573224d6ad207202 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:24:20 -0400 Subject: [PATCH] Align ICD nomenclature in the app/icd/ implementation (#29687) * Align ICD nommenclature in the app/icd/ file implementation * Restyled by clang-format * rename TestIcdMonitoringTable.cpp --------- Co-authored-by: Restyled.io --- src/app/BUILD.gn | 4 +- src/app/ReadHandler.cpp | 4 +- src/app/chip_data_model.cmake | 93 ++++++++++--------- src/app/chip_data_model.gni | 2 +- .../icd-management-server.cpp | 32 +++---- src/app/icd/BUILD.gn | 18 ++-- ...mentServer.cpp => ICDManagementServer.cpp} | 20 ++-- ...nagementServer.h => ICDManagementServer.h} | 14 +-- src/app/icd/ICDManager.cpp | 40 ++++---- src/app/icd/ICDManager.h | 2 +- ...toringTable.cpp => ICDMonitoringTable.cpp} | 38 ++++---- ...MonitoringTable.h => ICDMonitoringTable.h} | 20 ++-- src/app/tests/BUILD.gn | 4 +- src/app/tests/TestICDManager.cpp | 20 ++-- ...ngTable.cpp => TestICDMonitoringTable.cpp} | 24 ++--- src/lib/support/DefaultStorageKeyAllocator.h | 2 +- src/messaging/BUILD.gn | 2 +- .../ReliableMessageProtocolConfig.cpp | 4 +- 18 files changed, 173 insertions(+), 170 deletions(-) rename src/app/icd/{IcdManagementServer.cpp => ICDManagementServer.cpp} (83%) rename src/app/icd/{IcdManagementServer.h => ICDManagementServer.h} (90%) rename src/app/icd/{IcdMonitoringTable.cpp => ICDMonitoringTable.cpp} (80%) rename src/app/icd/{IcdMonitoringTable.h => ICDMonitoringTable.h} (88%) rename src/app/tests/{TestIcdMonitoringTable.cpp => TestICDMonitoringTable.cpp} (96%) diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index a0159708922b8c..efffda6fed4735 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -238,7 +238,7 @@ static_library("app") { ":app_config", "${chip_root}/src/access", "${chip_root}/src/app/icd:notifier", - "${chip_root}/src/app/icd:observer-srcs", + "${chip_root}/src/app/icd:observer", "${chip_root}/src/lib/address_resolve", "${chip_root}/src/lib/support", "${chip_root}/src/messaging", @@ -248,7 +248,7 @@ static_library("app") { ] if (chip_enable_icd_server) { - public_deps += [ "${chip_root}/src/app/icd:manager-srcs" ] + public_deps += [ "${chip_root}/src/app/icd:manager" ] } cflags = [ "-Wconversion" ] diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 9339a08fae7cab..6bd8072425cf42 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -35,7 +35,7 @@ #include #if CHIP_CONFIG_ENABLE_ICD_SERVER -#include // nogncheck +#include // nogncheck #endif namespace chip { @@ -45,7 +45,7 @@ using Status = Protocols::InteractionModel::Status; uint16_t ReadHandler::GetPublisherSelectedIntervalLimit() { #if CHIP_CONFIG_ENABLE_ICD_SERVER - return static_cast(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()); + return static_cast(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); #else return kSubscriptionMaxIntervalPublisherLimit; #endif diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index fb18dd8b16c5fc..89cbee6a4cca8c 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -1,17 +1,17 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020 Project CHIP Authors # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # set(CHIP_APP_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) @@ -32,7 +32,7 @@ function(chip_configure_zap_file APP_TARGET ZAP_FILE EXTERNAL_CLUSTERS) find_package(Python3 REQUIRED) set(args --zap_file ${ZAP_FILE}) - if (EXTERNAL_CLUSTERS) + if(EXTERNAL_CLUSTERS) list(APPEND args --external-clusters ${EXTERNAL_CLUSTERS}) endif() @@ -42,11 +42,13 @@ function(chip_configure_zap_file APP_TARGET ZAP_FILE EXTERNAL_CLUSTERS) ERROR_VARIABLE ERROR_MESSAGE RESULT_VARIABLE RC ) - if (NOT RC EQUAL 0) + + if(NOT RC EQUAL 0) message(FATAL_ERROR "Failed to execute zap_cluster_list.py: ${ERROR_MESSAGE}") endif() string(REPLACE "\n" ";" CLUSTER_LIST "${CLUSTER_LIST}") + foreach(CLUSTER ${CLUSTER_LIST}) chip_configure_cluster(${APP_TARGET} ${CLUSTER}) endforeach() @@ -55,26 +57,26 @@ endfunction() # # Configure ${APP_TARGET} based on the selected data model configuration. # Available options are: -# SCOPE CMake scope keyword that defines the scope of included sources. -# The default is PRIVATE scope. -# INCLUDE_SERVER Include source files from src/app/server directory. -# ZAP_FILE Path to the ZAP file, used to determine the list of clusters -# supported by the application. -# IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE -# if not provided -# EXTERNAL_CLUSTERS Clusters with external implementations. The default implementations -# will not be used nor required for these clusters. -# Format: MY_CUSTOM_CLUSTER'. +# SCOPE CMake scope keyword that defines the scope of included sources. +# The default is PRIVATE scope. +# INCLUDE_SERVER Include source files from src/app/server directory. +# ZAP_FILE Path to the ZAP file, used to determine the list of clusters +# supported by the application. +# IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE +# if not provided +# EXTERNAL_CLUSTERS Clusters with external implementations. The default implementations +# will not be used nor required for these clusters. +# Format: MY_CUSTOM_CLUSTER'. # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) cmake_parse_arguments(ARG "INCLUDE_SERVER" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) - if (ARG_SCOPE) + if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() - if (ARG_INCLUDE_SERVER) + if(ARG_INCLUDE_SERVER) target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp @@ -86,26 +88,27 @@ function(chip_configure_data_model APP_TARGET) ) target_compile_options(${APP_TARGET} ${SCOPE} - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" ) endif() - if (ARG_ZAP_FILE) + if(ARG_ZAP_FILE) chip_configure_zap_file(${APP_TARGET} ${ARG_ZAP_FILE} "${ARG_EXTERNAL_CLUSTERS}") - if (NOT ARG_IDL) + + if(NOT ARG_IDL) string(REPLACE ".zap" ".matter" ARG_IDL ${ARG_ZAP_FILE}) endif() endif() - if (ARG_IDL) + if(ARG_IDL) chip_codegen(${APP_TARGET}-codegen - INPUT "${ARG_IDL}" - GENERATOR "cpp-app" - OUTPUTS - "app/PluginApplicationCallbacks.h" - "app/callback-stub.cpp" - OUTPUT_PATH APP_GEN_DIR - OUTPUT_FILES APP_GEN_FILES + INPUT "${ARG_IDL}" + GENERATOR "cpp-app" + OUTPUTS + "app/PluginApplicationCallbacks.h" + "app/callback-stub.cpp" + OUTPUT_PATH APP_GEN_DIR + OUTPUT_FILES APP_GEN_FILES ) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_GEN_DIR}") @@ -115,16 +118,16 @@ function(chip_configure_data_model APP_TARGET) endif() chip_zapgen(${APP_TARGET}-zapgen - INPUT "${ARG_ZAP_FILE}" + INPUT "${ARG_ZAP_FILE}" GENERATOR "app-templates" OUTPUTS - "zap-generated/access.h" - "zap-generated/CHIPClusters.h" - "zap-generated/endpoint_config.h" - "zap-generated/gen_config.h" - "zap-generated/IMClusterCommandHandler.cpp" - OUTPUT_PATH APP_TEMPLATES_GEN_DIR - OUTPUT_FILES APP_TEMPLATES_GEN_FILES + "zap-generated/access.h" + "zap-generated/CHIPClusters.h" + "zap-generated/endpoint_config.h" + "zap-generated/gen_config.h" + "zap-generated/IMClusterCommandHandler.cpp" + OUTPUT_PATH APP_TEMPLATES_GEN_DIR + OUTPUT_FILES APP_TEMPLATES_GEN_FILES ) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_TEMPLATES_GEN_DIR}") add_dependencies(${APP_TARGET} ${APP_TARGET}-zapgen) @@ -136,8 +139,8 @@ function(chip_configure_data_model APP_TARGET) ${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp - ${CHIP_APP_BASE_DIR}/icd/IcdMonitoringTable.cpp - ${CHIP_APP_BASE_DIR}/icd/IcdManagementServer.cpp + ${CHIP_APP_BASE_DIR}/icd/ICDMonitoringTable.cpp + ${CHIP_APP_BASE_DIR}/icd/ICDManagementServer.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 54abef97926e04..550c8fbf9ccb1b 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -289,7 +289,7 @@ template("chip_data_model") { } else if (cluster == "icd-management-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ] - deps += [ "${chip_root}/src/app/icd:cluster-srcs" ] + deps += [ "${chip_root}/src/app/icd:cluster" ] } else if (cluster == "resource-monitoring-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 10e92c833c0dbf..be5be9be59e6aa 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -89,31 +89,31 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & CHIP_ERROR IcdManagementAttributeAccess::ReadIdleModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()); + return encoder.Encode(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); } CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetActiveModeIntervalMs()); + return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeIntervalMs()); } CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeThreshold(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); } CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder) { - uint16_t supported_clients = IcdManagementServer::GetInstance().GetClientsSupportedPerFabric(); + uint16_t supported_clients = ICDManagementServer::GetInstance().GetClientsSupportedPerFabric(); return encoder.EncodeList([supported_clients](const auto & subEncoder) -> CHIP_ERROR { - IcdMonitoringEntry e; + ICDMonitoringEntry e; const auto & fabricTable = Server::GetInstance().GetFabricTable(); for (const auto & fabricInfo : fabricTable) { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); - IcdMonitoringTable table(storage, fabricInfo.GetFabricIndex(), supported_clients); + ICDMonitoringTable table(storage, fabricInfo.GetFabricIndex(), supported_clients); for (uint16_t i = 0; i < table.Limit(); ++i) { CHIP_ERROR err = table.Get(i, e); @@ -136,12 +136,12 @@ CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoi CHIP_ERROR IcdManagementAttributeAccess::ReadICDCounter(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetICDCounter()); + return encoder.Encode(ICDManagementServer::GetInstance().GetICDCounter()); } CHIP_ERROR IcdManagementAttributeAccess::ReadClientsSupportedPerFabric(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetClientsSupportedPerFabric()); + return encoder.Encode(ICDManagementServer::GetInstance().GetClientsSupportedPerFabric()); } CHIP_ERROR CheckAdmin(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, bool & is_admin) @@ -164,8 +164,8 @@ class IcdManagementFabricDelegate : public chip::FabricTable::Delegate { void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) override { - uint16_t supported_clients = IcdManagementServer::GetInstance().GetClientsSupportedPerFabric(); - IcdMonitoringTable table(chip::Server::GetInstance().GetPersistentStorage(), fabricIndex, supported_clients); + uint16_t supported_clients = ICDManagementServer::GetInstance().GetClientsSupportedPerFabric(); + ICDMonitoringTable table(chip::Server::GetInstance().GetPersistentStorage(), fabricIndex, supported_clients); table.RemoveAll(); } }; @@ -194,7 +194,7 @@ bool emberAfIcdManagementClusterRegisterClientCallback(chip::app::CommandHandler { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - status = IcdManagementServer::GetInstance().RegisterClient(storage, fabric, commandData.checkInNodeID, + status = ICDManagementServer::GetInstance().RegisterClient(storage, fabric, commandData.checkInNodeID, commandData.monitoredSubject, commandData.key, commandData.verificationKey, is_admin); } @@ -203,7 +203,7 @@ bool emberAfIcdManagementClusterRegisterClientCallback(chip::app::CommandHandler { // Response IcdManagement::Commands::RegisterClientResponse::Type response{ .ICDCounter = - IcdManagementServer::GetInstance().GetICDCounter() }; + ICDManagementServer::GetInstance().GetICDCounter() }; commandObj->AddResponse(commandPath, response); return true; } @@ -227,7 +227,7 @@ bool emberAfIcdManagementClusterUnregisterClientCallback(chip::app::CommandHandl { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - status = IcdManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID, + status = ICDManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID, commandData.verificationKey, is_admin); } @@ -242,7 +242,7 @@ bool emberAfIcdManagementClusterStayActiveRequestCallback(chip::app::CommandHand const chip::app::ConcreteCommandPath & commandPath, const Commands::StayActiveRequest::DecodableType & commandData) { - InteractionModel::Status status = IcdManagementServer::GetInstance().StayActiveRequest(commandObj->GetAccessingFabricIndex()); + InteractionModel::Status status = ICDManagementServer::GetInstance().StayActiveRequest(commandObj->GetAccessingFabricIndex()); commandObj->AddStatus(commandPath, status); return true; diff --git a/src/app/icd/BUILD.gn b/src/app/icd/BUILD.gn index 132518887807cc..0879e296865a04 100644 --- a/src/app/icd/BUILD.gn +++ b/src/app/icd/BUILD.gn @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("icd.gni") # ICD Server sources and configurations -source_set("observer-srcs") { +source_set("observer") { sources = [ "ICDStateObserver.h" ] } @@ -32,28 +32,28 @@ source_set("notifier") { # ICD Manager source-set is broken out of the main source-set to enable unit tests # All sources and configurations used by the ICDManager need to go in this source-set -source_set("manager-srcs") { +source_set("manager") { sources = [ "ICDManager.cpp", "ICDManager.h", ] public_deps = [ - ":cluster-srcs", + ":cluster", ":notifier", - ":observer-srcs", + ":observer", "${chip_root}/src/credentials:credentials", ] } # ICD management cluster source-set is broken out of the main source-set to enable unit tests # All sources and configurations used by the ICD management cluster need to go in this source-set -source_set("cluster-srcs") { +source_set("cluster") { sources = [ - "IcdManagementServer.cpp", - "IcdManagementServer.h", - "IcdMonitoringTable.cpp", - "IcdMonitoringTable.h", + "ICDManagementServer.cpp", + "ICDManagementServer.h", + "ICDMonitoringTable.cpp", + "ICDMonitoringTable.h", ] public_deps = [ diff --git a/src/app/icd/IcdManagementServer.cpp b/src/app/icd/ICDManagementServer.cpp similarity index 83% rename from src/app/icd/IcdManagementServer.cpp rename to src/app/icd/ICDManagementServer.cpp index 1db9006f5f5965..c93056f8041c82 100644 --- a/src/app/icd/IcdManagementServer.cpp +++ b/src/app/icd/ICDManagementServer.cpp @@ -1,21 +1,21 @@ -#include "IcdManagementServer.h" -#include +#include "ICDManagementServer.h" +#include using namespace chip; using namespace chip::Protocols; namespace chip { -IcdManagementServer IcdManagementServer::mInstance; +ICDManagementServer ICDManagementServer::mInstance; -Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, +Status ICDManagementServer::RegisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, uint64_t monitored_subject, chip::ByteSpan key, Optional verification_key, bool is_admin) { - IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); + ICDMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); // Get current entry, if exists - IcdMonitoringEntry entry; + ICDMonitoringEntry entry; CHIP_ERROR err = table.Find(node_id, entry); if (CHIP_NO_ERROR == err) { @@ -48,13 +48,13 @@ Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage, return InteractionModel::Status::Success; } -Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, +Status ICDManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, Optional verificationKey, bool is_admin) { - IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); + ICDMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); // Get current entry, if exists - IcdMonitoringEntry entry; + ICDMonitoringEntry entry; CHIP_ERROR err = table.Find(node_id, entry); VerifyOrReturnError(CHIP_ERROR_NOT_FOUND != err, InteractionModel::Status::NotFound); VerifyOrReturnError(CHIP_NO_ERROR == err, InteractionModel::Status::Failure); @@ -72,7 +72,7 @@ Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage return InteractionModel::Status::Success; } -Status IcdManagementServer::StayActiveRequest(FabricIndex fabric_index) +Status ICDManagementServer::StayActiveRequest(FabricIndex fabric_index) { // TODO: Implementent stay awake logic for end device return InteractionModel::Status::UnsupportedCommand; diff --git a/src/app/icd/IcdManagementServer.h b/src/app/icd/ICDManagementServer.h similarity index 90% rename from src/app/icd/IcdManagementServer.h rename to src/app/icd/ICDManagementServer.h index cab712e3a340a2..30a38126f86fb9 100644 --- a/src/app/icd/IcdManagementServer.h +++ b/src/app/icd/ICDManagementServer.h @@ -27,7 +27,7 @@ namespace chip { using chip::Protocols::InteractionModel::Status; -class IcdManagementServer +class ICDManagementServer { public: uint32_t GetIdleModeIntervalSec() { return mIdleInterval_s; } @@ -36,9 +36,9 @@ class IcdManagementServer uint16_t GetActiveModeThresholdMs() { return mActiveThreshold_ms; } - uint32_t GetICDCounter() { return mIcdCounter; } + uint32_t GetICDCounter() { return mICDCounter; } - void SetICDCounter(uint32_t count) { mIcdCounter = count; } + void SetICDCounter(uint32_t count) { mICDCounter = count; } uint16_t GetClientsSupportedPerFabric() { return mFabricClientsSupported; } @@ -50,12 +50,12 @@ class IcdManagementServer Status StayActiveRequest(FabricIndex fabric_index); - static IcdManagementServer & GetInstance() { return mInstance; } + static ICDManagementServer & GetInstance() { return mInstance; } private: - IcdManagementServer() = default; + ICDManagementServer() = default; - static IcdManagementServer mInstance; + static ICDManagementServer mInstance; static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) <= 64800, "Spec requires the IdleModeInterval to be equal or inferior to 64800s."); @@ -73,7 +73,7 @@ class IcdManagementServer "Spec requires the ActiveModeThreshold to be equal or greater to 300ms."); uint16_t mActiveThreshold_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS; - uint32_t mIcdCounter = 0; + uint32_t mICDCounter = 0; static_assert((CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC) >= 1, "Spec requires the minimum of supported clients per fabric be equal or greater to 1."); diff --git a/src/app/icd/ICDManager.cpp b/src/app/icd/ICDManager.cpp index d46a166e361172..1d7199cb813b55 100644 --- a/src/app/icd/ICDManager.cpp +++ b/src/app/icd/ICDManager.cpp @@ -18,9 +18,9 @@ #include #include #include +#include #include -#include -#include +#include #include #include #include @@ -55,10 +55,10 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT mStateObserver = stateObserver; VerifyOrDie(ICDNotifier::GetInstance().Subscribe(this) == CHIP_NO_ERROR); - uint32_t activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeIntervalMs(); + uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); VerifyOrDie(kFastPollingInterval.count() < activeModeInterval); - UpdateIcdMode(); + UpdateICDMode(); UpdateOperationState(OperationalState::ActiveMode); } @@ -86,7 +86,7 @@ bool ICDManager::SupportsCheckInProtocol() return success ? ((featureMap & to_underlying(Feature::kCheckInProtocolSupport)) != 0) : false; } -void ICDManager::UpdateIcdMode() +void ICDManager::UpdateICDMode() { assertChipStackLockedByCurrentThread(); @@ -102,7 +102,7 @@ void ICDManager::UpdateIcdMode() for (const auto & fabricInfo : *mFabricTable) { // We only need 1 valid entry to ensure LIT compliance - IcdMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), 1 /*Table entry limit*/); + ICDMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), 1 /*Table entry limit*/); if (!table.IsEmpty()) { tempMode = ICDMode::LIT; @@ -131,9 +131,9 @@ void ICDManager::UpdateOperationState(OperationalState state) mOperationalState = OperationalState::IdleMode; // When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode - if (IcdManagementServer::GetInstance().GetActiveModeIntervalMs() > 0) + if (ICDManagementServer::GetInstance().GetActiveModeIntervalMs() > 0) { - uint32_t idleModeInterval = IcdManagementServer::GetInstance().GetIdleModeIntervalSec(); + uint32_t idleModeInterval = ICDManagementServer::GetInstance().GetIdleModeIntervalSec(); DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(idleModeInterval), OnIdleModeDone, this); } @@ -162,13 +162,13 @@ void ICDManager::UpdateOperationState(OperationalState state) DeviceLayer::SystemLayer().CancelTimer(OnIdleModeDone, this); mOperationalState = OperationalState::ActiveMode; - uint32_t activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeIntervalMs(); + uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); if (activeModeInterval == 0 && !mKeepActiveFlags.HasAny()) { // A Network Activity triggered the active mode and activeModeInterval is 0. // Stay active for at least Active Mode Threshold. - activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeThresholdMs(); + activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); } DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(activeModeInterval), OnActiveModeDone, this); @@ -187,7 +187,7 @@ void ICDManager::UpdateOperationState(OperationalState state) } else { - uint16_t activeModeThreshold = IcdManagementServer::GetInstance().GetActiveModeThresholdMs(); + uint16_t activeModeThreshold = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); DeviceLayer::SystemLayer().ExtendTimerTo(System::Clock::Timeout(activeModeThreshold), OnActiveModeDone, this); uint16_t activeModeJitterThreshold = (activeModeThreshold >= ICD_ACTIVE_TIME_JITTER_MS) ? activeModeThreshold - ICD_ACTIVE_TIME_JITTER_MS : 0; @@ -219,33 +219,33 @@ void ICDManager::SetKeepActiveModeRequirements(KeepActiveFlags flag, bool state) void ICDManager::OnIdleModeDone(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); - pIcdManager->UpdateOperationState(OperationalState::ActiveMode); + ICDManager * pICDManager = reinterpret_cast(appState); + pICDManager->UpdateOperationState(OperationalState::ActiveMode); // We only reset this flag when idle mode is complete to avoid re-triggering the check when an event brings us back to active, // which could cause a loop. - pIcdManager->mTransitionToIdleCalled = false; + pICDManager->mTransitionToIdleCalled = false; } void ICDManager::OnActiveModeDone(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); + ICDManager * pICDManager = reinterpret_cast(appState); // Don't go to idle mode when we have a keep active requirement - if (!pIcdManager->mKeepActiveFlags.HasAny()) + if (!pICDManager->mKeepActiveFlags.HasAny()) { - pIcdManager->UpdateOperationState(OperationalState::IdleMode); + pICDManager->UpdateOperationState(OperationalState::IdleMode); } } void ICDManager::OnTransitionToIdle(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); + ICDManager * pICDManager = reinterpret_cast(appState); // OnTransitionToIdle will trigger a report message if reporting is needed, which should extend the active mode until the // ack for the report is received. - pIcdManager->mTransitionToIdleCalled = true; - pIcdManager->mStateObserver->OnTransitionToIdle(); + pICDManager->mTransitionToIdleCalled = true; + pICDManager->mStateObserver->OnTransitionToIdle(); } /* ICDListener functions. */ diff --git a/src/app/icd/ICDManager.h b/src/app/icd/ICDManager.h index 852a4b428e9411..8eb62d6f17066b 100644 --- a/src/app/icd/ICDManager.h +++ b/src/app/icd/ICDManager.h @@ -52,7 +52,7 @@ class ICDManager : public ICDListener ICDManager() {} void Init(PersistentStorageDelegate * storage, FabricTable * fabricTable, ICDStateObserver * stateObserver); void Shutdown(); - void UpdateIcdMode(); + void UpdateICDMode(); void UpdateOperationState(OperationalState state); void SetKeepActiveModeRequirements(KeepActiveFlags flag, bool state); bool IsKeepActive() { return mKeepActiveFlags.HasAny(); } diff --git a/src/app/icd/IcdMonitoringTable.cpp b/src/app/icd/ICDMonitoringTable.cpp similarity index 80% rename from src/app/icd/IcdMonitoringTable.cpp rename to src/app/icd/ICDMonitoringTable.cpp index ad8cb7d3c4c550..821cf133060266 100644 --- a/src/app/icd/IcdMonitoringTable.cpp +++ b/src/app/icd/ICDMonitoringTable.cpp @@ -1,4 +1,4 @@ -#include "IcdMonitoringTable.h" +#include "ICDMonitoringTable.h" #include namespace chip { @@ -10,14 +10,14 @@ enum class Fields : uint8_t kKey = 3, }; -CHIP_ERROR IcdMonitoringEntry::UpdateKey(StorageKeyName & skey) +CHIP_ERROR ICDMonitoringEntry::UpdateKey(StorageKeyName & skey) { VerifyOrReturnError(kUndefinedFabricIndex != this->fabricIndex, CHIP_ERROR_INVALID_FABRIC_INDEX); - skey = DefaultStorageKeyAllocator::IcdManagementTableEntry(this->fabricIndex, index); + skey = DefaultStorageKeyAllocator::ICDManagementTableEntry(this->fabricIndex, index); return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringEntry::Serialize(TLV::TLVWriter & writer) const +CHIP_ERROR ICDMonitoringEntry::Serialize(TLV::TLVWriter & writer) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); @@ -28,7 +28,7 @@ CHIP_ERROR IcdMonitoringEntry::Serialize(TLV::TLVWriter & writer) const return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringEntry::Deserialize(TLV::TLVReader & reader) +CHIP_ERROR ICDMonitoringEntry::Deserialize(TLV::TLVReader & reader) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -63,14 +63,14 @@ CHIP_ERROR IcdMonitoringEntry::Deserialize(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -void IcdMonitoringEntry::Clear() +void ICDMonitoringEntry::Clear() { this->checkInNodeID = kUndefinedNodeId; this->monitoredSubject = kUndefinedNodeId; this->key = ByteSpan(); } -CHIP_ERROR IcdMonitoringTable::Get(uint16_t index, IcdMonitoringEntry & entry) const +CHIP_ERROR ICDMonitoringTable::Get(uint16_t index, ICDMonitoringEntry & entry) const { entry.fabricIndex = this->mFabric; entry.index = index; @@ -79,7 +79,7 @@ CHIP_ERROR IcdMonitoringTable::Get(uint16_t index, IcdMonitoringEntry & entry) c return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringTable::Find(NodeId id, IcdMonitoringEntry & entry) +CHIP_ERROR ICDMonitoringTable::Find(NodeId id, ICDMonitoringEntry & entry) { uint16_t index = 0; while (index < this->Limit()) @@ -94,14 +94,14 @@ CHIP_ERROR IcdMonitoringTable::Find(NodeId id, IcdMonitoringEntry & entry) return CHIP_ERROR_NOT_FOUND; } -CHIP_ERROR IcdMonitoringTable::Set(uint16_t index, const IcdMonitoringEntry & entry) +CHIP_ERROR ICDMonitoringTable::Set(uint16_t index, const ICDMonitoringEntry & entry) { VerifyOrReturnError(index < this->Limit(), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.checkInNodeID, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.monitoredSubject, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(entry.key.size() == IcdMonitoringEntry::kKeyMaxSize, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(entry.key.size() == ICDMonitoringEntry::kKeyMaxSize, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(nullptr != entry.key.data(), CHIP_ERROR_INVALID_ARGUMENT); - IcdMonitoringEntry e(this->mFabric, index); + ICDMonitoringEntry e(this->mFabric, index); e.checkInNodeID = entry.checkInNodeID; e.monitoredSubject = entry.monitoredSubject; e.key = entry.key; @@ -109,15 +109,15 @@ CHIP_ERROR IcdMonitoringTable::Set(uint16_t index, const IcdMonitoringEntry & en return e.Save(this->mStorage); } -CHIP_ERROR IcdMonitoringTable::Remove(uint16_t index) +CHIP_ERROR ICDMonitoringTable::Remove(uint16_t index) { - IcdMonitoringEntry entry(this->mFabric, index); + ICDMonitoringEntry entry(this->mFabric, index); // Shift remaining entries down one position while (CHIP_NO_ERROR == this->Get(static_cast(index + 1), entry)) { // WARNING: The key data is held in the entry's serializing buffer - IcdMonitoringEntry copy = entry; + ICDMonitoringEntry copy = entry; this->Set(index++, copy); } @@ -127,9 +127,9 @@ CHIP_ERROR IcdMonitoringTable::Remove(uint16_t index) return entry.Delete(this->mStorage); } -CHIP_ERROR IcdMonitoringTable::RemoveAll() +CHIP_ERROR ICDMonitoringTable::RemoveAll() { - IcdMonitoringEntry entry(this->mFabric); + ICDMonitoringEntry entry(this->mFabric); uint16_t index = 0; while (index < this->Limit()) { @@ -145,13 +145,13 @@ CHIP_ERROR IcdMonitoringTable::RemoveAll() return CHIP_NO_ERROR; } -bool IcdMonitoringTable::IsEmpty() +bool ICDMonitoringTable::IsEmpty() { - IcdMonitoringEntry entry(this->mFabric); + ICDMonitoringEntry entry(this->mFabric); return (this->Get(0, entry) == CHIP_ERROR_NOT_FOUND); } -uint16_t IcdMonitoringTable::Limit() const +uint16_t ICDMonitoringTable::Limit() const { return mLimit; } diff --git a/src/app/icd/IcdMonitoringTable.h b/src/app/icd/ICDMonitoringTable.h similarity index 88% rename from src/app/icd/IcdMonitoringTable.h rename to src/app/icd/ICDMonitoringTable.h index 86186aec594d07..de97610dd01f30 100644 --- a/src/app/icd/IcdMonitoringTable.h +++ b/src/app/icd/ICDMonitoringTable.h @@ -25,13 +25,13 @@ namespace chip { -inline constexpr size_t kIcdMonitoringBufferSize = 40; +inline constexpr size_t kICDMonitoringBufferSize = 40; -struct IcdMonitoringEntry : public PersistentData +struct ICDMonitoringEntry : public PersistentData { static constexpr size_t kKeyMaxSize = 16; - IcdMonitoringEntry(FabricIndex fabric = kUndefinedFabricIndex, NodeId nodeId = kUndefinedNodeId) + ICDMonitoringEntry(FabricIndex fabric = kUndefinedFabricIndex, NodeId nodeId = kUndefinedNodeId) { this->fabricIndex = fabric; this->checkInNodeID = nodeId; @@ -51,8 +51,8 @@ struct IcdMonitoringEntry : public PersistentData }; /** - * @brief IcdMonitoringTable exists to manage the persistence of entries in the IcdManagement Cluster. - * To access persisted data with the IcdMonitoringTable class, instantiate an instance of this class + * @brief ICDMonitoringTable exists to manage the persistence of entries in the IcdManagement Cluster. + * To access persisted data with the ICDMonitoringTable class, instantiate an instance of this class * and call the LoadFromStorage function. * * This class can only manage one fabric at a time. The flow is load a fabric, execute necessary operations, @@ -62,9 +62,9 @@ struct IcdMonitoringEntry : public PersistentData * https://github.com/project-chip/connectedhomeip/issues/24288 */ -struct IcdMonitoringTable +struct ICDMonitoringTable { - IcdMonitoringTable(PersistentStorageDelegate & storage, FabricIndex fabric, uint16_t limit) : + ICDMonitoringTable(PersistentStorageDelegate & storage, FabricIndex fabric, uint16_t limit) : mStorage(&storage), mFabric(fabric), mLimit(limit) {} @@ -75,7 +75,7 @@ struct IcdMonitoringTable * @return CHIP_NO_ERROR on success, * CHIP_ERROR_NOT_FOUND if index is greater than the index of the last entry on the table. */ - CHIP_ERROR Get(uint16_t index, IcdMonitoringEntry & entry) const; + CHIP_ERROR Get(uint16_t index, ICDMonitoringEntry & entry) const; /** * @brief Stores the MonitoringRegistrationStruct entry at the given position, @@ -84,7 +84,7 @@ struct IcdMonitoringTable * @param entry On success, contains the MonitoringRegistrationStruct matching the given index. * @return CHIP_NO_ERROR on success */ - CHIP_ERROR Set(uint16_t index, const IcdMonitoringEntry & entry); + CHIP_ERROR Set(uint16_t index, const ICDMonitoringEntry & entry); /** * @brief Search the registered clients for an entry on the fabric whose checkInNodeID matches the given id. @@ -94,7 +94,7 @@ struct IcdMonitoringTable * If CHIP_ERROR_NOT_FOUND is returned, entry.index contains the total number of entries in the table. * @return CHIP_NO_ERROR if found, CHIP_ERROR_NOT_FOUND if no checkInNodeID matches the provided id. */ - CHIP_ERROR Find(NodeId id, IcdMonitoringEntry & entry); + CHIP_ERROR Find(NodeId id, ICDMonitoringEntry & entry); /** * @brief Removes the MonitoringRegistrationStruct entry at the given position, diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index e56a91aaff1383..122e87bc550ffb 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -139,7 +139,7 @@ chip_test_suite_using_nltest("tests") { "TestExtensionFieldSets.cpp", "TestFabricScopedEventLogging.cpp", "TestICDManager.cpp", - "TestIcdMonitoringTable.cpp", + "TestICDMonitoringTable.cpp", "TestInteractionModelEngine.cpp", "TestMessageDef.cpp", "TestNumericAttributeTraits.cpp", @@ -201,7 +201,7 @@ chip_test_suite_using_nltest("tests") { ":time-sync-data-provider-test-srcs", "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", - "${chip_root}/src/app/icd:manager-srcs", + "${chip_root}/src/app/icd:manager", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util/mock:mock_ember", "${chip_root}/src/lib/core", diff --git a/src/app/tests/TestICDManager.cpp b/src/app/tests/TestICDManager.cpp index 5d57be4245f116..76c8cd345cb0c4 100644 --- a/src/app/tests/TestICDManager.cpp +++ b/src/app/tests/TestICDManager.cpp @@ -16,10 +16,10 @@ * limitations under the License. */ #include +#include #include #include #include -#include #include #include #include @@ -115,20 +115,20 @@ class TestICDManager // After the init we should be in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // Active mode interval expired, ICDManager transitioned to the IdleMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); - AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()) + 1); + AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()) + 1); // Idle mode interval expired, ICDManager transitioned to the ActiveMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Events updating the Operation to Active mode can extend the current active mode time by 1 Active mode threshold. // Kick an active Threshold just before the end of the Active interval and validate that the active mode is extended. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() - 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() - 1); ICDNotifier::GetInstance().BroadcastNetworkActivityNotification(); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeThresholdMs() / 2); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeThresholdMs() / 2); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); } @@ -142,7 +142,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kCommissioningWindowOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time so active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // Requirement flag still set. We stay in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); @@ -156,12 +156,12 @@ class TestICDManager // Advance time, but by less than the active mode interval and remove the requirement. // We should stay in active mode. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() / 2); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() / 2); notifier.BroadcastActiveRequestWithdrawal(ActiveFlag::kFailSafeArmed); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time again, The activemode interval is completed. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); // Set two requirements @@ -169,7 +169,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kExchangeContextOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // advance time so the active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // A requirement flag is still set. We stay in active mode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); diff --git a/src/app/tests/TestIcdMonitoringTable.cpp b/src/app/tests/TestICDMonitoringTable.cpp similarity index 96% rename from src/app/tests/TestIcdMonitoringTable.cpp rename to src/app/tests/TestICDMonitoringTable.cpp index 5cfdadd01ccbbc..4aca4ff4e1d7c6 100644 --- a/src/app/tests/TestIcdMonitoringTable.cpp +++ b/src/app/tests/TestICDMonitoringTable.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include +#include #include #include #include @@ -61,9 +61,9 @@ constexpr uint8_t kKeyBuffer3a[] = { void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable saving(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable loading(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringEntry entry; + ICDMonitoringTable saving(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable loading(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert first entry @@ -139,8 +139,8 @@ void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringEntry entry; + ICDMonitoringTable table(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringEntry entry; CHIP_ERROR err; // Invalid checkInNodeID @@ -182,9 +182,9 @@ void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); - IcdMonitoringEntry entry; + ICDMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert in first fabric @@ -246,9 +246,9 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); - IcdMonitoringEntry entry; + ICDMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert first entry diff --git a/src/lib/support/DefaultStorageKeyAllocator.h b/src/lib/support/DefaultStorageKeyAllocator.h index 6715f0298531f2..c33e1127015e39 100644 --- a/src/lib/support/DefaultStorageKeyAllocator.h +++ b/src/lib/support/DefaultStorageKeyAllocator.h @@ -185,7 +185,7 @@ class DefaultStorageKeyAllocator // ICD Management - static StorageKeyName IcdManagementTableEntry(chip::FabricIndex fabric, uint16_t index) + static StorageKeyName ICDManagementTableEntry(chip::FabricIndex fabric, uint16_t index) { return StorageKeyName::Formatted("f/%x/icd/%x", fabric, index); } diff --git a/src/messaging/BUILD.gn b/src/messaging/BUILD.gn index cd805fb52facae..cd32155d71a5d7 100644 --- a/src/messaging/BUILD.gn +++ b/src/messaging/BUILD.gn @@ -79,6 +79,6 @@ static_library("messaging") { ] if (chip_enable_icd_server) { - public_deps += [ "${chip_root}/src/app/icd:manager-srcs" ] + public_deps += [ "${chip_root}/src/app/icd:manager" ] } } diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index bd1eb2a3fc073c..652531c8ee8567 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -28,8 +28,8 @@ #include #if CHIP_CONFIG_ENABLE_ICD_SERVER +#include // nogncheck #include // nogncheck -#include // nogncheck #endif namespace chip { @@ -75,7 +75,7 @@ Optional GetLocalMRPConfig() // which the device can be at sleep and not be able to receive any messages). config.mIdleRetransTimeout += app::ICDManager::GetSlowPollingInterval(); config.mActiveRetransTimeout += app::ICDManager::GetFastPollingInterval(); - config.mActiveThresholdTime = System::Clock::Milliseconds16(IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + config.mActiveThresholdTime = System::Clock::Milliseconds16(ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); #endif #if CONFIG_BUILD_FOR_HOST_UNIT_TEST