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

[occupancy-sensing]Updated occupancy sensing cluster SDK & Sample app(all-clusters-app) implementation to Rev 5 (Matter 1.4) #34293

Merged
merged 17 commits into from
Jul 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -8792,8 +8792,10 @@ endpoint 1 {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute holdTime default = 10;
callback attribute holdTimeLimits;
ram attribute featureMap default = 0x01;
ram attribute clusterRevision default = 5;
}

server cluster CarbonMonoxideConcentrationMeasurement {
Expand Down Expand Up @@ -9261,8 +9263,10 @@ endpoint 2 {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 4;
ram attribute holdTime default = 20;
callback attribute holdTimeLimits;
ram attribute featureMap default = 0x01;
ram attribute clusterRevision default = 5;
}
}
endpoint 65534 {
Expand Down
100 changes: 82 additions & 18 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -18716,6 +18716,38 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "HoldTime",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "10",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "HoldTimeLimits",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "HoldTimeLimitsStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand All @@ -18726,7 +18758,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -18742,7 +18774,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -21900,6 +21932,14 @@
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "StringEchoResponse",
"code": 13,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "TestEnumsRequest",
"code": 14,
Expand Down Expand Up @@ -21973,32 +22013,24 @@
"isEnabled": 1
},
{
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
"name": "StringEchoRequest",
"code": 24,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "TestDifferentVendorMeiResponse",
"code": 4294049979,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "StringEchoRequest",
"code": 24,
"name": "TestDifferentVendorMeiRequest",
"code": 4294049962,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "StringEchoResponse",
"code": 13,
"name": "TestDifferentVendorMeiResponse",
"code": 4294049979,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
Expand Down Expand Up @@ -24745,6 +24777,38 @@
"maxInterval": 65344,
"reportableChange": 0
},
{
"name": "HoldTime",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "20",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "HoldTimeLimits",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "HoldTimeLimitsStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand All @@ -24755,7 +24819,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "0x01",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -24771,7 +24835,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "4",
"defaultValue": "5",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
*
* Copyright (c) 2024 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 <app/CommandHandler.h>
#include <app/clusters/occupancy-sensor-server/occupancy-hal.h>
#include <app/clusters/occupancy-sensor-server/occupancy-sensor-server.h>
#include <platform/CHIPDeviceLayer.h>

using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::OccupancySensing;
using namespace chip::app::Clusters::OccupancySensing::Structs;
using namespace chip::DeviceLayer;

using chip::Protocols::InteractionModel::Status;

static std::unique_ptr<OccupancySensingAttrAccess>
OliverFan1 marked this conversation as resolved.
Show resolved Hide resolved
gAttrAccess[MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT];

void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId)
OliverFan1 marked this conversation as resolved.
Show resolved Hide resolved
{
VerifyOrDie(!gAttrAccess[endpointId]);

gAttrAccess[endpointId] = std::make_unique<OccupancySensingAttrAccess>(
BitMask<OccupancySensing::Feature, uint32_t>(OccupancySensing::Feature::kOther));

OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = {
.holdTimeMin = 1,
.holdTimeMax = 300,
.holdTimeDefault = 10,
};

uint16_t holdTime = 10;

if (gAttrAccess[endpointId])
{
gAttrAccess[endpointId]->Init();

SetHoldTimeLimits(endpointId, holdTimeLimits);

SetHoldTime(endpointId, holdTime);
}
}
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/microwave-oven-mode.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-modes.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp",
Expand Down
Loading
Loading