Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IC-Device] Initial Structure for client monitoring cluster #23838

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/chip_data_model.gni
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ template("chip_data_model") {
sources += [
"${_app_root}/clusters/barrier-control-server/barrier-control-server.h",
"${_app_root}/clusters/basic/basic.h",
"${_app_root}/clusters/client-monitoring-server/client-monitoring-server.h",
"${_app_root}/clusters/color-control-server/color-control-server.h",
"${_app_root}/clusters/door-lock-server/door-lock-server.h",
"${_app_root}/clusters/groups-server/groups-server.h",
Expand Down
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() {}
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>
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/data-model/all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<xi:include href="chip/bridged-device-basic.xml" />
<xi:include href="chip/chip-ota.xml" />
<xi:include href="chip/chip-types.xml" />
<xi:include href="chip/client-monitoring-cluster.xml" />
<xi:include href="chip/clusters-extensions.xml" />
<xi:include href="chip/content-launch-cluster.xml" />
<xi:include href="chip/descriptor-cluster.xml" />
Expand Down
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">
mkardous-silabs marked this conversation as resolved.
Show resolved Hide resolved
<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>
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"chip-ota.xml",
"chip-types.xml",
"channel-cluster.xml",
"client-monitoring-cluster.xml",
"clusters-extensions.xml",
"content-launch-cluster.xml",
"descriptor-cluster.xml",
Expand Down
1 change: 1 addition & 0 deletions src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"chip-ota.xml",
"chip-types.xml",
"channel-cluster.xml",
"client-monitoring-cluster.xml",
"clusters-extensions.xml",
"content-launch-cluster.xml",
"descriptor-cluster.xml",
Expand Down
2 changes: 2 additions & 0 deletions src/app/zap_cluster_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'ACTIONS_CLUSTER': [],
'BRIDGED_DEVICE_BASIC_CLUSTER': ['bridged-device-basic-information-server'],
'CHANNEL_CLUSTER': ['channel-server'],
'CLIENT_MONITORING_CLUSTER': ['client-monitoring-server'],
'COLOR_CONTROL_CLUSTER': ['color-control-server'],
'COMMISSIONING_CLUSTER': [],
'CONTENT_LAUNCHER_CLUSTER': ['content-launch-server'],
Expand Down Expand Up @@ -110,6 +111,7 @@
'ACTIONS_CLUSTER': [],
'BRIDGED_DEVICE_BASIC_CLUSTER': [],
'CHANNEL_CLUSTER': [],
'CLIENT_MONITORING_CLUSTER': [],
'COLOR_CONTROL_CLUSTER': [],
'COMMISSIONING_CLUSTER': [],
'CONTENT_LAUNCHER_CLUSTER': [],
Expand Down
Loading