forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4c4c38
commit 2721cb2
Showing
22 changed files
with
2,458 additions
and
39 deletions.
There are no files selected for viewing
121 changes: 121 additions & 0 deletions
121
#0001-Thermostat-changes-to-support-Apple-Thermostat-exten.patch#
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,121 @@ | ||
From 650bacd3f9eb91d03c15660831154dcb03794d8a Mon Sep 17 00:00:00 2001 | ||
From: Nivedita Sarkar <[email protected]> | ||
Date: Fri, 9 Feb 2024 09:37:39 -0800 | ||
Subject: [PATCH] Thermostat changes to support Apple Thermostat extensions | ||
|
||
--- | ||
.../thermostat-server/thermostat-server.cpp | 22 ++-------- | ||
.../thermostat-server/thermostat-server.h | 43 +++++++++++++++++++ | ||
2 files changed, 46 insertions(+), 19 deletions(-) | ||
create mode 100644 src/app/clusters/thermostat-server/thermostat-server.h | ||
|
||
diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
index f5a5157a7e..2feceb56a6 100644 | ||
--- a/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
+++ b/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
@@ -15,17 +15,14 @@ | ||
* limitations under the License. | ||
*/ | ||
|
||
-#include <app/util/af.h> | ||
- | ||
-#include <app/util/attribute-storage.h> | ||
+#include "thermostat-server.h" | ||
+#include "apple-thermostat-extension-server.h" | ||
|
||
#include <app-common/zap-generated/attributes/Accessors.h> | ||
#include <app-common/zap-generated/callback.h> | ||
#include <app-common/zap-generated/cluster-objects.h> | ||
#include <app-common/zap-generated/ids/Attributes.h> | ||
#include <app/CommandHandler.h> | ||
-#include <app/ConcreteAttributePath.h> | ||
-#include <app/ConcreteCommandPath.h> | ||
#include <app/util/error-mapping.h> | ||
#include <lib/core/CHIPEncoding.h> | ||
|
||
@@ -65,17 +62,6 @@ constexpr int8_t kDefaultDeadBand = 25; // 2.5C is the default | ||
|
||
#define FEATURE_MAP_DEFAULT FEATURE_MAP_HEAT | FEATURE_MAP_COOL | FEATURE_MAP_AUTO | ||
|
||
-namespace { | ||
- | ||
-class ThermostatAttrAccess : public AttributeAccessInterface | ||
-{ | ||
-public: | ||
- ThermostatAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), Thermostat::Id) {} | ||
- | ||
- CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; | ||
- CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; | ||
-}; | ||
- | ||
ThermostatAttrAccess gThermostatAttrAccess; | ||
|
||
CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) | ||
@@ -180,8 +166,6 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
-} // anonymous namespace | ||
- | ||
void emberAfThermostatClusterServerInitCallback(chip::EndpointId endpoint) | ||
{ | ||
// TODO | ||
@@ -931,5 +915,5 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co | ||
|
||
void MatterThermostatPluginServerInitCallback() | ||
{ | ||
- registerAttributeAccessOverride(&gThermostatAttrAccess); | ||
+ RegisterAppleThermostatExtAttrAccess(&gThermostatAttrAccess); | ||
} | ||
diff --git a/src/app/clusters/thermostat-server/thermostat-server.h b/src/app/clusters/thermostat-server/thermostat-server.h | ||
new file mode 100644 | ||
index 0000000000..b41d89f19f | ||
--- /dev/null | ||
+++ b/src/app/clusters/thermostat-server/thermostat-server.h | ||
@@ -0,0 +1,43 @@ | ||
+/** | ||
+ * | ||
+ * 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. | ||
+ */ | ||
+ | ||
+/**************************************************************************** | ||
+ * @file | ||
+ * @brief Thermostat cluster Attribute Access Interface | ||
+ * | ||
+ ******************************************************************************* | ||
+ ******************************************************************************/ | ||
+ | ||
+#pragma once | ||
+ | ||
+#include <app/AttributeAccessInterface.h> | ||
+#include <app/ConcreteAttributePath.h> | ||
+#include <app/ConcreteCommandPath.h> | ||
+#include <app-common/zap-generated/ids/Clusters.h> | ||
+ | ||
+class ThermostatAttrAccess : public chip::app::AttributeAccessInterface | ||
+{ | ||
+ | ||
+public: | ||
+ ThermostatAttrAccess() : AttributeAccessInterface(chip::Optional<chip::EndpointId>::Missing(), chip::app::Clusters::Thermostat::Id) {} | ||
+ | ||
+ CHIP_ERROR Read(const chip::app::ConcreteReadAttributePath & aPath, chip::app::AttributeValueEncoder & aEncoder) override; | ||
+ CHIP_ERROR Write(const chip::app::ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override; | ||
+}; | ||
+ | ||
+int16_t EnforceHeatingSetpointLimits(int16_t HeatingSetpoint, chip::EndpointId endpoint); | ||
+int16_t EnforceCoolingSetpointLimits(int16_t CoolingSetpoint, chip::EndpointId endpoint); | ||
-- | ||
2.39.2 (Apple Git-144) | ||
|
71 changes: 71 additions & 0 deletions
71
0001-Patch-thermostat-to-build-with-Apple-Thermostat-exte.patch
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,71 @@ | ||
From 452cc40204883de1491fe3d751a0f6c12bbedad3 Mon Sep 17 00:00:00 2001 | ||
From: Nivedita Sarkar <[email protected]> | ||
Date: Fri, 9 Feb 2024 09:17:24 -0800 | ||
Subject: [PATCH] Patch thermostat to build with Apple Thermostat extension | ||
code | ||
|
||
--- | ||
.../thermostat-server/thermostat-server.cpp | 22 +++---------------- | ||
1 file changed, 3 insertions(+), 19 deletions(-) | ||
|
||
diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
index f5a5157a7e..2feceb56a6 100644 | ||
--- a/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
+++ b/src/app/clusters/thermostat-server/thermostat-server.cpp | ||
@@ -15,17 +15,14 @@ | ||
* limitations under the License. | ||
*/ | ||
|
||
-#include <app/util/af.h> | ||
- | ||
-#include <app/util/attribute-storage.h> | ||
+#include "thermostat-server.h" | ||
+#include "apple-thermostat-extension-server.h" | ||
|
||
#include <app-common/zap-generated/attributes/Accessors.h> | ||
#include <app-common/zap-generated/callback.h> | ||
#include <app-common/zap-generated/cluster-objects.h> | ||
#include <app-common/zap-generated/ids/Attributes.h> | ||
#include <app/CommandHandler.h> | ||
-#include <app/ConcreteAttributePath.h> | ||
-#include <app/ConcreteCommandPath.h> | ||
#include <app/util/error-mapping.h> | ||
#include <lib/core/CHIPEncoding.h> | ||
|
||
@@ -65,17 +62,6 @@ constexpr int8_t kDefaultDeadBand = 25; // 2.5C is the default | ||
|
||
#define FEATURE_MAP_DEFAULT FEATURE_MAP_HEAT | FEATURE_MAP_COOL | FEATURE_MAP_AUTO | ||
|
||
-namespace { | ||
- | ||
-class ThermostatAttrAccess : public AttributeAccessInterface | ||
-{ | ||
-public: | ||
- ThermostatAttrAccess() : AttributeAccessInterface(Optional<EndpointId>::Missing(), Thermostat::Id) {} | ||
- | ||
- CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; | ||
- CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; | ||
-}; | ||
- | ||
ThermostatAttrAccess gThermostatAttrAccess; | ||
|
||
CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) | ||
@@ -180,8 +166,6 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, | ||
return CHIP_NO_ERROR; | ||
} | ||
|
||
-} // anonymous namespace | ||
- | ||
void emberAfThermostatClusterServerInitCallback(chip::EndpointId endpoint) | ||
{ | ||
// TODO | ||
@@ -931,5 +915,5 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co | ||
|
||
void MatterThermostatPluginServerInitCallback() | ||
{ | ||
- registerAttributeAccessOverride(&gThermostatAttrAccess); | ||
+ RegisterAppleThermostatExtAttrAccess(&gThermostatAttrAccess); | ||
} | ||
-- | ||
2.39.2 (Apple Git-144) | ||
|
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.