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

Make XOccupiedToUnoccupiedDelay attributes in OccupancySensing cluster managed by AAI #36777

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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 @@ -9047,7 +9047,7 @@ endpoint 1 {
ram attribute occupancySensorTypeBitmap default = 1;
callback attribute holdTime;
callback attribute holdTimeLimits;
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
callback attribute PIROccupiedToUnoccupiedDelay;
callback attribute featureMap;
ram attribute clusterRevision default = 5;
}
Expand Down Expand Up @@ -9505,7 +9505,7 @@ endpoint 2 {
ram attribute occupancySensorTypeBitmap default = 1;
callback attribute holdTime;
callback attribute holdTimeLimits;
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
callback attribute PIROccupiedToUnoccupiedDelay;
callback attribute featureMap;
ram attribute clusterRevision default = 5;
}
Expand Down
6 changes: 3 additions & 3 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9645,13 +9645,13 @@ endpoint 1 {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute PIROccupiedToUnoccupiedDelay default = 0x00;
callback attribute PIROccupiedToUnoccupiedDelay;
ram attribute PIRUnoccupiedToOccupiedDelay default = 0x00;
ram attribute PIRUnoccupiedToOccupiedThreshold default = 1;
ram attribute ultrasonicOccupiedToUnoccupiedDelay default = 0x00;
callback attribute ultrasonicOccupiedToUnoccupiedDelay;
ram attribute ultrasonicUnoccupiedToOccupiedDelay default = 0x00;
ram attribute ultrasonicUnoccupiedToOccupiedThreshold default = 1;
ram attribute physicalContactOccupiedToUnoccupiedDelay default = 0x00;
callback attribute physicalContactOccupiedToUnoccupiedDelay;
ram attribute physicalContactUnoccupiedToOccupiedDelay default = 0x00;
ram attribute physicalContactUnoccupiedToOccupiedThreshold default = 1;
callback attribute featureMap;
Expand Down
6 changes: 3 additions & 3 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -9540,13 +9540,13 @@ endpoint 1 {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute PIROccupiedToUnoccupiedDelay default = 0x00;
callback attribute PIROccupiedToUnoccupiedDelay;
ram attribute PIRUnoccupiedToOccupiedDelay default = 0x00;
ram attribute PIRUnoccupiedToOccupiedThreshold default = 1;
ram attribute ultrasonicOccupiedToUnoccupiedDelay default = 0x00;
callback attribute ultrasonicOccupiedToUnoccupiedDelay;
ram attribute ultrasonicUnoccupiedToOccupiedDelay default = 0x00;
ram attribute ultrasonicUnoccupiedToOccupiedThreshold default = 1;
ram attribute physicalContactOccupiedToUnoccupiedDelay default = 0x00;
callback attribute physicalContactOccupiedToUnoccupiedDelay;
ram attribute physicalContactUnoccupiedToOccupiedDelay default = 0x00;
ram attribute physicalContactUnoccupiedToOccupiedThreshold default = 1;
callback attribute featureMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu
case Attributes::FeatureMap::Id:
ReturnErrorOnFailure(aEncoder.Encode(mFeature));
break;
case Attributes::HoldTime::Id: {

case Attributes::HoldTime::Id:
case Attributes::PIROccupiedToUnoccupiedDelay::Id:
case Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id:
case Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: {
bzbarsky-apple marked this conversation as resolved.
Show resolved Hide resolved
// HoldTime is equivalent to the legacy *OccupiedToUnoccupiedDelay attributes.
// The AAI will read/write these attributes at the same storage for one endpoint.
uint16_t * holdTime = GetHoldTimeForEndpoint(aPath.mEndpointId);

if (holdTime == nullptr)
Expand Down Expand Up @@ -190,12 +194,6 @@ CHIP_ERROR SetHoldTime(EndpointId endpointId, uint16_t newHoldTime)
MatterReportingAttributeChangeCallback(endpointId, OccupancySensing::Id, Attributes::HoldTime::Id);
}

// Blindly try to write RAM-backed legacy attributes (will fail silently if absent)
// to keep them in sync.
(void) Attributes::PIROccupiedToUnoccupiedDelay::Set(endpointId, newHoldTime);
(void) Attributes::UltrasonicOccupiedToUnoccupiedDelay::Set(endpointId, newHoldTime);
(void) Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Set(endpointId, newHoldTime);

return CHIP_NO_ERROR;
}

Expand Down
9 changes: 8 additions & 1 deletion src/app/zap-templates/zcl/zcl-with-test-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,14 @@
"ClientsSupportedPerFabric",
"MaximumCheckInBackOff"
],
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
"Occupancy Sensing": [
"HoldTimeLimits",
"HoldTime",
"PIROccupiedToUnoccupiedDelay",
"UltrasonicOccupiedToUnoccupiedDelay",
"PhysicalContactOccupiedToUnoccupiedDelay",
"FeatureMap"
],
"Operational Credentials": [
"SupportedFabrics",
"CommissionedFabrics",
Expand Down
9 changes: 8 additions & 1 deletion src/app/zap-templates/zcl/zcl.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,14 @@
"ClientsSupportedPerFabric",
"MaximumCheckInBackOff"
],
"Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"],
"Occupancy Sensing": [
"HoldTimeLimits",
"HoldTime",
"PIROccupiedToUnoccupiedDelay",
"UltrasonicOccupiedToUnoccupiedDelay",
"PhysicalContactOccupiedToUnoccupiedDelay",
"FeatureMap"
],
"Operational Credentials": [
"SupportedFabrics",
"CommissionedFabrics",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading