From f70d00e546014d723bc3342fbd8b2de28fda45ad Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Mon, 7 Jun 2021 21:16:08 +0800 Subject: [PATCH] Add Diagnostic Logs template --- .../all-clusters-common/all-clusters-app.zap | 26 ++++++ .../esp32/main/CMakeLists.txt | 1 + .../bridge-app/bridge-common/bridge-app.zap | 28 +++++- .../chip-tool/commands/clusters/Commands.h | 92 +++++++++++++++++++ .../lighting-common/lighting-app.zap | 28 +++++- .../lighting-app/nrfconnect/CMakeLists.txt | 1 + examples/lighting-app/telink/CMakeLists.txt | 1 + examples/lock-app/lock-common/lock-app.zap | 28 +++++- examples/lock-app/nrfconnect/CMakeLists.txt | 1 + examples/pump-app/pump-common/pump-app.zap | 28 +++++- .../pump-controller-app.zap | 28 +++++- .../esp32/main/temperature-measurement.zap | 26 ++++++ examples/tv-app/tv-common/tv-app.zap | 28 +++++- .../diagnostic-logs-server.cpp | 27 ++++++ .../zcl/diagnostic-logs-cluster.xml | 57 ++++++++++++ src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.py | 2 + .../data_model/controller-clusters.zap | 26 ++++++ .../python/chip/clusters/CHIPClusters.cpp | 16 ++++ 19 files changed, 439 insertions(+), 6 deletions(-) create mode 100644 src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp create mode 100644 src/app/zap-templates/zcl/diagnostic-logs-cluster.xml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index f5b0fc8dd78833..705670d1cc9d0b 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -1619,6 +1619,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 885fb2862c9a50..3f9102a91a043c 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -58,6 +58,7 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ias-zone-server" diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index eb012ae07c9b9e..c8694450e59d85 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -712,6 +712,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -3256,4 +3282,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index 9bc35b81a48d1b..a9063061624d97 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -1101,6 +1101,7 @@ static void OnThreadNetworkDiagnosticsActiveNetworkFaultsListListAttributeRespon | ColorControl | 0x0300 | | ContentLauncher | 0x050A | | Descriptor | 0x001D | +| DiagnosticLogs | 0x0032 | | DoorLock | 0x0101 | | EthernetNetworkDiagnostics | 0x0037 | | FixedLabel | 0x0040 | @@ -1146,6 +1147,7 @@ constexpr chip::ClusterId kBridgedDeviceBasicClusterId = 0x0039; constexpr chip::ClusterId kColorControlClusterId = 0x0300; constexpr chip::ClusterId kContentLauncherClusterId = 0x050A; constexpr chip::ClusterId kDescriptorClusterId = 0x001D; +constexpr chip::ClusterId kDiagnosticLogsClusterId = 0x0032; constexpr chip::ClusterId kDoorLockClusterId = 0x0101; constexpr chip::ClusterId kEthernetNetworkDiagnosticsClusterId = 0x0037; constexpr chip::ClusterId kFixedLabelClusterId = 0x0040; @@ -7749,6 +7751,84 @@ class ReadDescriptorClusterRevision : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; +/*----------------------------------------------------------------------------*\ +| Cluster DiagnosticLogs | 0x0032 | +|------------------------------------------------------------------------------| +| Commands: | | +| * RetrieveLogsRequest | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command RetrieveLogsRequest + */ +class DiagnosticLogsRetrieveLogsRequest : public ModelCommand +{ +public: + DiagnosticLogsRetrieveLogsRequest() : ModelCommand("retrieve-logs-request") + { + AddArgument("intent", 0, UINT8_MAX, &mIntent); + AddArgument("requestedProtocol", 0, UINT8_MAX, &mRequestedProtocol); + AddArgument("transferFileDesignator", &mTransferFileDesignator); + ModelCommand::AddArguments(); + } + ~DiagnosticLogsRetrieveLogsRequest() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0032) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::DiagnosticLogsCluster cluster; + cluster.Associate(device, endpointId); + return cluster.RetrieveLogsRequest(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIntent, mRequestedProtocol, + mTransferFileDesignator); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mIntent; + uint8_t mRequestedProtocol; + chip::ByteSpan mTransferFileDesignator; +}; + +/* + * Discover Attributes + */ +class DiscoverDiagnosticLogsAttributes : public ModelCommand +{ +public: + DiscoverDiagnosticLogsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + + ~DiscoverDiagnosticLogsAttributes() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); + + chip::Controller::DiagnosticLogsCluster cluster; + cluster.Associate(device, endpointId); + return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + /*----------------------------------------------------------------------------*\ | Cluster DoorLock | 0x0101 | |------------------------------------------------------------------------------| @@ -21144,6 +21224,17 @@ void registerClusterDescriptor(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterDiagnosticLogs(Commands & commands) +{ + const char * clusterName = "DiagnosticLogs"; + + commands_list clusterCommands = { + make_unique(), + make_unique(), + }; + + commands.Register(clusterName, clusterCommands); +} void registerClusterDoorLock(Commands & commands) { const char * clusterName = "DoorLock"; @@ -21756,6 +21847,7 @@ void registerClusters(Commands & commands) registerClusterColorControl(commands); registerClusterContentLauncher(commands); registerClusterDescriptor(commands); + registerClusterDiagnosticLogs(commands); registerClusterDoorLock(commands); registerClusterEthernetNetworkDiagnostics(commands); registerClusterFixedLabel(commands); diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 3a1b36526c5740..e888c467f186c5 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1381,6 +1381,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -4521,4 +4547,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index 14e2fe43bf6af0..22198fe7c71d63 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -87,6 +87,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/server/StorablePeerConnection.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp + ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 219eab853add8f..551e81d40a1a05 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -76,6 +76,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/server/StorablePeerConnection.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp + ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/on-off-server/on-off-server.cpp ${CHIP_ROOT}/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 9ee6faaa939fb3..ff7464f716f413 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1841,6 +1841,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -5162,4 +5188,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index 09f299aa24831d..1ed34b9267c70f 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -87,6 +87,7 @@ target_sources(app PRIVATE ${CHIP_ROOT}/src/app/server/StorablePeerConnection.cpp ${CHIP_ROOT}/src/app/clusters/basic/basic.cpp ${CHIP_ROOT}/src/app/clusters/bindings/bindings.cpp + ${CHIP_ROOT}/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp ${CHIP_ROOT}/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning-ember.cpp ${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 524b0138b72932..60ba47863bb4fa 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -1308,6 +1308,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -4905,4 +4931,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 65cdc7fcaa9656..071aca92daaf55 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -1308,6 +1308,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -4905,4 +4931,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap index 0a386fd325c910..d8933b673c1dc3 100644 --- a/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap +++ b/examples/temperature-measurement-app/esp32/main/temperature-measurement.zap @@ -1417,6 +1417,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 4d29cf9ca90ac6..af6bf598009ad7 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1604,6 +1604,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ] + }, { "name": "General Diagnostics", "code": 51, @@ -8192,4 +8218,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp new file mode 100644 index 00000000000000..d8d830bfbef7f2 --- /dev/null +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -0,0 +1,27 @@ +/** + * + * Copyright (c) 2021 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 + * + * 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. + */ + +#include +#include + +bool emberAfDiagnosticLogsClusterRetrieveLogsRequestCallback(chip::app::Command * commandObj, uint8_t intent, + uint8_t requestedProtocol, chip::ByteSpan transferFileDesignator) +{ + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + emberAfSendImmediateDefaultResponse(status); + return true; +} diff --git a/src/app/zap-templates/zcl/diagnostic-logs-cluster.xml b/src/app/zap-templates/zcl/diagnostic-logs-cluster.xml new file mode 100644 index 00000000000000..89db19d93bfab8 --- /dev/null +++ b/src/app/zap-templates/zcl/diagnostic-logs-cluster.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + Diagnostic Logs + CHIP + The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. + 0x0032 + DIAGNOSTIC_LOGS_CLUSTER + true + true + + Retrieving diagnostic logs from a Node + + + + + + Response to the RetrieveLogsRequest + + + + + + + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 46e7509a450958..5cde9eaaacae4b 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -12,6 +12,7 @@ "switch-cluster.xml", "clusters-extensions.xml", "content-launch-cluster.xml", + "diagnostic-logs-cluster.xml", "ethernet-network-diagnostics-cluster.xml", "media-playback-cluster.xml", "low-power-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index 08bee9d8ed8412..be6bdb079c04ab 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -24,6 +24,7 @@ 'CONTENT_LAUNCH_CLUSTER': ['content-launch-server'], 'DESCRIPTOR_CLUSTER': ['descriptor'], 'DEVICE_TEMP_CLUSTER': [], + 'DIAGNOSTIC_LOGS_CLUSTER': ['diagnostic-logs-server'], 'DOOR_LOCK_CLUSTER': ['door-lock-server'], 'ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER': [], 'FIXED_LABEL_CLUSTER': [], @@ -82,6 +83,7 @@ 'CONTENT_LAUNCH_CLUSTER': [], 'DEVICE_TEMP_CLUSTER': [], 'DESCRIPTOR_CLUSTER': [], + 'DIAGNOSTIC_LOGS_CLUSTER': [], 'DOOR_LOCK_CLUSTER': [], 'ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER': [], 'FIXED_LABEL_CLUSTER': [], diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index a07bad1c8ec905..b061035f44a073 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1791,6 +1791,32 @@ } ] }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RetrieveLogsResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ] + }, { "name": "General Diagnostics", "code": 51, diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index d8f56c277090e9..fea3b5a61fa1b2 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -1870,6 +1870,22 @@ CHIP_ERROR chip_ime_ReadAttribute_Descriptor_ClusterRevision(chip::Controller::D } // End of Cluster Descriptor +// Cluster DiagnosticLogs + +CHIP_ERROR chip_ime_AppendCommand_DiagnosticLogs_RetrieveLogsRequest(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, uint8_t intent, + uint8_t requestedProtocol, + const uint8_t * transferFileDesignator, + uint32_t transferFileDesignator_Len) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::DiagnosticLogsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.RetrieveLogsRequest(nullptr, nullptr, intent, requestedProtocol, + chip::ByteSpan(transferFileDesignator, transferFileDesignator_Len)); +} + +// End of Cluster DiagnosticLogs // Cluster DoorLock CHIP_ERROR chip_ime_AppendCommand_DoorLock_ClearAllPins(chip::Controller::Device * device, chip::EndpointId ZCLendpointId,