Skip to content

Commit ad84990

Browse files
committed
[MATTER] Added Enhanced Scheduling feature for TRV app
1 parent 1f6aada commit ad84990

14 files changed

+2635
-125
lines changed

examples/thermostat/qpg/BUILD.gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ qpg_executable("thermostat") {
5151
output_name = "chip-${qpg_target_ic}-thermostat-example.out"
5252

5353
sources = [
54+
"${chip_root}/examples/thermostat/thermostat-common/src/thermostat-delegate-impl.cpp",
5455
"${chip_root}/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerHandler.cpp",
56+
"${examples_plat_dir}/app/battery.cpp",
5557
"${examples_plat_dir}/app/main.cpp",
5658
"${examples_plat_dir}/ota/ota.cpp",
5759
"src/AppTask.cpp",
@@ -80,6 +82,7 @@ qpg_executable("thermostat") {
8082

8183
include_dirs = [
8284
"include",
85+
"${chip_root}/examples/thermostat/thermostat-common/include",
8386
"${examples_plat_dir}/ota",
8487
]
8588

examples/thermostat/qpg/src/ZclCallbacks.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
#include "AppTask.h"
2222
#include "ThermostaticRadiatorValveManager.h"
23+
#include "thermostat-delegate-impl.h"
2324

2425
#include <app-common/zap-generated/attribute-type.h>
26+
#include <app/clusters/thermostat-server/thermostat-server.h>
2527
#include <app/util/attribute-storage.h>
2628

2729
#include <app-common/zap-generated/attributes/Accessors.h>
@@ -54,6 +56,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
5456

5557
void emberAfThermostatClusterInitCallback(EndpointId endpoint)
5658
{
59+
Thermostat::SetDefaultDelegate(endpoint, &Thermostat::ThermostatDelegate::GetInstance());
5760

5861
// Temp. code for testing purpose, need to be updated
5962
const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) {

examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter

Lines changed: 105 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ cluster GeneralDiagnostics = 51 {
13771377
/** Take a snapshot of system time and epoch time. */
13781378
command TimeSnapshot(): TimeSnapshotResponse = 1;
13791379
/** Request a variable length payload response. */
1380-
command access(invoke: manage) PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
1380+
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
13811381
}
13821382

13831383
/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */
@@ -1663,14 +1663,12 @@ cluster OperationalCredentials = 62 {
16631663
fabric_id fabricID = 3;
16641664
node_id nodeID = 4;
16651665
char_string<32> label = 5;
1666-
optional octet_string<85> VIDVerificationStatement = 6;
16671666
fabric_idx fabricIndex = 254;
16681667
}
16691668

16701669
fabric_scoped struct NOCStruct {
1671-
octet_string<400> noc = 1;
1672-
nullable octet_string<400> icac = 2;
1673-
optional octet_string<400> vvsc = 3;
1670+
fabric_sensitive octet_string noc = 1;
1671+
nullable fabric_sensitive octet_string icac = 2;
16741672
fabric_idx fabricIndex = 254;
16751673
}
16761674

@@ -1778,10 +1776,6 @@ cluster OperationalCredentials = 62 {
17781776
command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10;
17791777
/** This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation. */
17801778
command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11;
1781-
/** This command SHALL be used to update any of the accessing fabric's associated VendorID, VidVerificatioNStatement or VVSC (Vendor Verification Signing Certificate). */
1782-
fabric command access(invoke: administer) SetVIDVerificationStatement(SetVIDVerificationStatementRequest): DefaultSuccess = 12;
1783-
/** This command SHALL be used to request that the server authenticate the fabric associated with the FabricIndex given. */
1784-
command access(invoke: administer) SignVIDVerificationRequest(SignVIDVerificationRequestRequest): SignVIDVerificationResponse = 13;
17851779
}
17861780

17871781
/** The Group Key Management Cluster is the mechanism by which group keys are managed. */
@@ -1899,6 +1893,104 @@ cluster UserLabel = 65 {
18991893
readonly attribute int16u clusterRevision = 65533;
19001894
}
19011895

1896+
/** Allows servers to ensure that listed clients are notified when a server is available for communication. */
1897+
cluster IcdManagement = 70 {
1898+
revision 3;
1899+
1900+
enum ClientTypeEnum : enum8 {
1901+
kPermanent = 0;
1902+
kEphemeral = 1;
1903+
}
1904+
1905+
enum OperatingModeEnum : enum8 {
1906+
kSIT = 0;
1907+
kLIT = 1;
1908+
}
1909+
1910+
bitmap Feature : bitmap32 {
1911+
kCheckInProtocolSupport = 0x1;
1912+
kUserActiveModeTrigger = 0x2;
1913+
kLongIdleTimeSupport = 0x4;
1914+
kDynamicSitLitSupport = 0x8;
1915+
}
1916+
1917+
bitmap UserActiveModeTriggerBitmap : bitmap32 {
1918+
kPowerCycle = 0x1;
1919+
kSettingsMenu = 0x2;
1920+
kCustomInstruction = 0x4;
1921+
kDeviceManual = 0x8;
1922+
kActuateSensor = 0x10;
1923+
kActuateSensorSeconds = 0x20;
1924+
kActuateSensorTimes = 0x40;
1925+
kActuateSensorLightsBlink = 0x80;
1926+
kResetButton = 0x100;
1927+
kResetButtonLightsBlink = 0x200;
1928+
kResetButtonSeconds = 0x400;
1929+
kResetButtonTimes = 0x800;
1930+
kSetupButton = 0x1000;
1931+
kSetupButtonSeconds = 0x2000;
1932+
kSetupButtonLightsBlink = 0x4000;
1933+
kSetupButtonTimes = 0x8000;
1934+
kAppDefinedButton = 0x10000;
1935+
}
1936+
1937+
fabric_scoped struct MonitoringRegistrationStruct {
1938+
fabric_sensitive node_id checkInNodeID = 1;
1939+
fabric_sensitive int64u monitoredSubject = 2;
1940+
fabric_sensitive ClientTypeEnum clientType = 4;
1941+
fabric_idx fabricIndex = 254;
1942+
}
1943+
1944+
readonly attribute int32u idleModeDuration = 0;
1945+
readonly attribute int32u activeModeDuration = 1;
1946+
readonly attribute int16u activeModeThreshold = 2;
1947+
readonly attribute access(read: administer) optional MonitoringRegistrationStruct registeredClients[] = 3;
1948+
readonly attribute access(read: administer) optional int32u ICDCounter = 4;
1949+
readonly attribute optional int16u clientsSupportedPerFabric = 5;
1950+
provisional readonly attribute optional UserActiveModeTriggerBitmap userActiveModeTriggerHint = 6;
1951+
provisional readonly attribute optional char_string<128> userActiveModeTriggerInstruction = 7;
1952+
provisional readonly attribute optional OperatingModeEnum operatingMode = 8;
1953+
provisional readonly attribute optional int32u maximumCheckInBackOff = 9;
1954+
readonly attribute command_id generatedCommandList[] = 65528;
1955+
readonly attribute command_id acceptedCommandList[] = 65529;
1956+
readonly attribute event_id eventList[] = 65530;
1957+
readonly attribute attrib_id attributeList[] = 65531;
1958+
readonly attribute bitmap32 featureMap = 65532;
1959+
readonly attribute int16u clusterRevision = 65533;
1960+
1961+
request struct RegisterClientRequest {
1962+
node_id checkInNodeID = 0;
1963+
int64u monitoredSubject = 1;
1964+
octet_string<16> key = 2;
1965+
optional octet_string<16> verificationKey = 3;
1966+
ClientTypeEnum clientType = 4;
1967+
}
1968+
1969+
response struct RegisterClientResponse = 1 {
1970+
int32u ICDCounter = 0;
1971+
}
1972+
1973+
request struct UnregisterClientRequest {
1974+
node_id checkInNodeID = 0;
1975+
optional octet_string<16> verificationKey = 1;
1976+
}
1977+
1978+
request struct StayActiveRequestRequest {
1979+
int32u stayActiveDuration = 0;
1980+
}
1981+
1982+
response struct StayActiveResponse = 4 {
1983+
int32u promisedActiveDuration = 0;
1984+
}
1985+
1986+
/** Register a client to the end device */
1987+
fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0;
1988+
/** Unregister a client from an end device */
1989+
fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2;
1990+
/** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */
1991+
command access(invoke: manage) StayActiveRequest(StayActiveRequestRequest): StayActiveResponse = 3;
1992+
}
1993+
19021994
/** An interface for configuring and controlling the functionality of a thermostat. */
19031995
cluster Thermostat = 513 {
19041996
revision 7;
@@ -2549,9 +2641,6 @@ endpoint 0 {
25492641
handle command UpdateFabricLabel;
25502642
handle command RemoveFabric;
25512643
handle command AddTrustedRootCertificate;
2552-
handle command SetVIDVerificationStatement;
2553-
handle command SignVIDVerificationRequest;
2554-
handle command SignVIDVerificationResponse;
25552644
}
25562645

25572646
server cluster GroupKeyManagement {
@@ -2645,6 +2734,10 @@ endpoint 1 {
26452734
ram attribute clusterRevision default = 6;
26462735

26472736
handle command SetpointRaiseLower;
2737+
handle command SetActiveScheduleRequest;
2738+
handle command SetActivePresetRequest;
2739+
handle command AtomicResponse;
2740+
handle command AtomicRequest;
26482741
}
26492742

26502743
server cluster ThermostatUserInterfaceConfiguration {
@@ -2657,5 +2750,3 @@ endpoint 1 {
26572750
ram attribute clusterRevision default = 2;
26582751
}
26592752
}
2660-
2661-

0 commit comments

Comments
 (0)