-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IC-Device] Initial Structure for client monitoring cluster (#23838)
* Initial Structure for client monitoring cluster * generated files * Review Comments * generated files * fix xml file * generated files * fix conflict * Update cluster xml * regen
- Loading branch information
1 parent
fad0bc4
commit 2765555
Showing
34 changed files
with
1,823 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/app/clusters/client-monitoring-server/client-monitoring-server.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* | ||
* Copyright (c) 2022 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 "client-monitoring-server.h" | ||
|
||
#include <app-common/zap-generated/af-structs.h> | ||
#include <app-common/zap-generated/attributes/Accessors.h> | ||
#include <app/CommandHandler.h> | ||
#include <app/util/af-event.h> | ||
#include <app/util/af.h> | ||
#include <app/util/attribute-storage.h> | ||
|
||
using namespace chip; | ||
using namespace chip::app::Clusters; | ||
using namespace chip::app::Clusters::ClientMonitoring; | ||
|
||
/** | ||
* @brief Client Monitoring Cluster RegisterClientMonitoring Command callback (from client) | ||
*/ | ||
bool emberAfClientMonitoringClusterRegisterClientMonitoringCallback( | ||
app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, | ||
const Commands::RegisterClientMonitoring::DecodableType & commandData) | ||
{ | ||
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); | ||
return false; | ||
} | ||
/** | ||
* @brief Client Monitoring Cluster StayAwakeRequest Command callback (from client) | ||
*/ | ||
bool emberAfClientMonitoringClusterStayAwakeRequestCallback(app::CommandHandler * commandObj, | ||
const chip::app::ConcreteCommandPath & commandPath, | ||
const Commands::StayAwakeRequest::DecodableType & commandData) | ||
{ | ||
emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND); | ||
return false; | ||
} | ||
|
||
void MatterClientMonitoringPluginServerInitCallback() {} |
23 changes: 23 additions & 0 deletions
23
src/app/clusters/client-monitoring-server/client-monitoring-server.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* | ||
* Copyright (c) 2022 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <app-common/zap-generated/cluster-objects.h> | ||
#include <app/ConcreteCommandPath.h> | ||
#include <app/util/af-types.h> | ||
#include <app/util/basic-types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/app/zap-templates/zcl/data-model/chip/client-monitoring-cluster.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
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. | ||
--> | ||
|
||
<configurator> | ||
<domain name="CHIP"/> | ||
|
||
<struct name = "MonitoringRegistration" isFabricScoped="true"> | ||
<cluster code="0x1046"/> | ||
<item fieldId="1" name="ClientNodeId" type="node_id"/> | ||
<item fieldId="2" name="ICid" type="INT64U"/> | ||
</struct> | ||
|
||
<cluster> | ||
<domain>General</domain> | ||
<name>Client Monitoring</name> | ||
<code>0x1046</code> | ||
<define>CLIENT_MONITORING_CLUSTER</define> | ||
<description>Client Monitoring allows for ensuring that listed clients meet the required monitoring conditions on the server.</description> | ||
<attribute side="server" code="0x00" define="IDLE_MODE_INTERVAL" type="INT32U" min="0x12C" max="0X5265C00" default="0x12C" writable="false" optional="false" isNullable="false">IdleModeInterval</attribute> | ||
<attribute side="server" code="0x01" define="ACTIVE_MODE_INTERVAL" type="INT32U" min="0x12C" max="0X5265C00" default="0x12C" writable="false" optional="false" isNullable="false">ActiveModeInterval</attribute> | ||
<attribute side="server" code="0x02" define="ACTIVE_MODE_THRESHOLD" type="INT16U" min="0x12C" max="0xEA60" default="0xFA0" writable="false" optional="false" isNullable="false">ActiveModeThreshold</attribute> | ||
|
||
<!-- TODO: Revisit the number of entries per fabric--> | ||
<attribute side="server" code="0x03" define="EXPECTED_CLIENTS" type="ARRAY" entryType="MonitoringRegistration" length="4" writable="false" optional="false" isNullable="false">ExpectedClients</attribute> | ||
|
||
<command source="client" code="0x00" name="RegisterClientMonitoring" optional="false"> | ||
<description> Register a client to the end device </description> | ||
<arg name="ClientNodeId" type="node_id"/> | ||
<arg name="ICid" type="INT64U"/> | ||
<access op="invoke" privilege="manage"/> | ||
</command> | ||
|
||
<command source="client" code="0x01" name="StayAwakeRequest" optional="true"> | ||
<description>Request the end device to stay in Active Mode for an additional ActiveModeThreshold</description> | ||
<access op="invoke" privilege="manage"/> | ||
</command> | ||
</cluster> | ||
</configurator> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.