Skip to content

Commit e702a20

Browse files
committed
[MATTER] Added Enhanced Scheduling feature for TRV app
1 parent 8167c5f commit e702a20

14 files changed

+1812
-53
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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,6 +2622,10 @@ endpoint 1 {
26222622
ram attribute clusterRevision default = 6;
26232623

26242624
handle command SetpointRaiseLower;
2625+
handle command SetActiveScheduleRequest;
2626+
handle command SetActivePresetRequest;
2627+
handle command AtomicResponse;
2628+
handle command AtomicRequest;
26252629
}
26262630

26272631
server cluster ThermostatUserInterfaceConfiguration {
@@ -2634,5 +2638,3 @@ endpoint 1 {
26342638
ram attribute clusterRevision default = 2;
26352639
}
26362640
}
2637-
2638-

examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap

Lines changed: 217 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,57 @@
2222
"path": "../../../../src/app/zap-templates/zcl/zcl.json",
2323
"type": "zcl-properties",
2424
"category": "matter",
25-
"version": 1,
26-
"description": "Matter SDK ZCL data"
25+
"version": "chip-v1"
2726
},
2827
{
2928
"pathRelativity": "relativeToZap",
3029
"path": "../../../../src/app/zap-templates/app-templates.json",
3130
"type": "gen-templates-json",
3231
"category": "matter",
33-
"version": "chip-v1"
32+
"version": 1,
33+
"description": "Matter SDK ZCL data"
3434
}
3535
],
3636
"endpointTypes": [
3737
{
3838
"id": 1,
3939
"name": "MA-rootdevice",
4040
"deviceTypeRef": {
41-
"code": 22,
41+
"code": 18,
4242
"profileId": 259,
43-
"label": "MA-rootdevice",
44-
"name": "MA-rootdevice",
45-
"deviceTypeOrder": 0
43+
"label": "MA-otarequestor",
44+
"name": "MA-otarequestor"
4645
},
4746
"deviceTypes": [
47+
{
48+
"code": 18,
49+
"profileId": 259,
50+
"label": "MA-otarequestor",
51+
"name": "MA-otarequestor"
52+
},
53+
{
54+
"code": 17,
55+
"profileId": 259,
56+
"label": "MA-powersource",
57+
"name": "MA-powersource"
58+
},
4859
{
4960
"code": 22,
5061
"profileId": 259,
5162
"label": "MA-rootdevice",
52-
"name": "MA-rootdevice",
53-
"deviceTypeOrder": 0
63+
"name": "MA-rootdevice"
5464
}
5565
],
5666
"deviceVersions": [
5767
1
5868
],
5969
"deviceIdentifiers": [
70+
18,
71+
17,
6072
22
6173
],
62-
"deviceTypeName": "MA-rootdevice",
63-
"deviceTypeCode": 22,
74+
"deviceTypeName": "MA-otarequestor",
75+
"deviceTypeCode": 18,
6476
"deviceTypeProfileId": 259,
6577
"clusters": [
6678
{
@@ -3541,16 +3553,14 @@
35413553
"code": 769,
35423554
"profileId": 259,
35433555
"label": "MA-thermostat",
3544-
"name": "MA-thermostat",
3545-
"deviceTypeOrder": 0
3556+
"name": "MA-thermostat"
35463557
},
35473558
"deviceTypes": [
35483559
{
35493560
"code": 769,
35503561
"profileId": 259,
35513562
"label": "MA-thermostat",
3552-
"name": "MA-thermostat",
3553-
"deviceTypeOrder": 0
3563+
"name": "MA-thermostat"
35543564
}
35553565
],
35563566
"deviceVersions": [
@@ -3934,6 +3944,38 @@
39343944
"source": "client",
39353945
"isIncoming": 1,
39363946
"isEnabled": 1
3947+
},
3948+
{
3949+
"name": "SetActiveScheduleRequest",
3950+
"code": 5,
3951+
"mfgCode": null,
3952+
"source": "client",
3953+
"isIncoming": 1,
3954+
"isEnabled": 1
3955+
},
3956+
{
3957+
"name": "SetActivePresetRequest",
3958+
"code": 6,
3959+
"mfgCode": null,
3960+
"source": "client",
3961+
"isIncoming": 1,
3962+
"isEnabled": 1
3963+
},
3964+
{
3965+
"name": "AtomicResponse",
3966+
"code": 253,
3967+
"mfgCode": null,
3968+
"source": "server",
3969+
"isIncoming": 0,
3970+
"isEnabled": 1
3971+
},
3972+
{
3973+
"name": "AtomicRequest",
3974+
"code": 254,
3975+
"mfgCode": null,
3976+
"source": "client",
3977+
"isIncoming": 1,
3978+
"isEnabled": 1
39373979
}
39383980
],
39393981
"attributes": [
@@ -4161,6 +4203,166 @@
41614203
"maxInterval": 65344,
41624204
"reportableChange": 0
41634205
},
4206+
{
4207+
"name": "PresetTypes",
4208+
"code": 72,
4209+
"mfgCode": null,
4210+
"side": "server",
4211+
"type": "array",
4212+
"included": 1,
4213+
"storageOption": "External",
4214+
"singleton": 0,
4215+
"bounded": 0,
4216+
"defaultValue": null,
4217+
"reportable": 1,
4218+
"minInterval": 1,
4219+
"maxInterval": 65534,
4220+
"reportableChange": 0
4221+
},
4222+
{
4223+
"name": "ScheduleTypes",
4224+
"code": 73,
4225+
"mfgCode": null,
4226+
"side": "server",
4227+
"type": "array",
4228+
"included": 1,
4229+
"storageOption": "External",
4230+
"singleton": 0,
4231+
"bounded": 0,
4232+
"defaultValue": null,
4233+
"reportable": 1,
4234+
"minInterval": 1,
4235+
"maxInterval": 65534,
4236+
"reportableChange": 0
4237+
},
4238+
{
4239+
"name": "NumberOfPresets",
4240+
"code": 74,
4241+
"mfgCode": null,
4242+
"side": "server",
4243+
"type": "int8u",
4244+
"included": 1,
4245+
"storageOption": "RAM",
4246+
"singleton": 0,
4247+
"bounded": 0,
4248+
"defaultValue": "0",
4249+
"reportable": 1,
4250+
"minInterval": 1,
4251+
"maxInterval": 65534,
4252+
"reportableChange": 0
4253+
},
4254+
{
4255+
"name": "NumberOfSchedules",
4256+
"code": 75,
4257+
"mfgCode": null,
4258+
"side": "server",
4259+
"type": "int8u",
4260+
"included": 1,
4261+
"storageOption": "RAM",
4262+
"singleton": 0,
4263+
"bounded": 0,
4264+
"defaultValue": "0",
4265+
"reportable": 1,
4266+
"minInterval": 1,
4267+
"maxInterval": 65534,
4268+
"reportableChange": 0
4269+
},
4270+
{
4271+
"name": "NumberOfScheduleTransitions",
4272+
"code": 76,
4273+
"mfgCode": null,
4274+
"side": "server",
4275+
"type": "int8u",
4276+
"included": 1,
4277+
"storageOption": "RAM",
4278+
"singleton": 0,
4279+
"bounded": 0,
4280+
"defaultValue": "0",
4281+
"reportable": 1,
4282+
"minInterval": 1,
4283+
"maxInterval": 65534,
4284+
"reportableChange": 0
4285+
},
4286+
{
4287+
"name": "NumberOfScheduleTransitionPerDay",
4288+
"code": 77,
4289+
"mfgCode": null,
4290+
"side": "server",
4291+
"type": "int8u",
4292+
"included": 1,
4293+
"storageOption": "RAM",
4294+
"singleton": 0,
4295+
"bounded": 0,
4296+
"defaultValue": "",
4297+
"reportable": 1,
4298+
"minInterval": 1,
4299+
"maxInterval": 65534,
4300+
"reportableChange": 0
4301+
},
4302+
{
4303+
"name": "ActivePresetHandle",
4304+
"code": 78,
4305+
"mfgCode": null,
4306+
"side": "server",
4307+
"type": "octet_string",
4308+
"included": 1,
4309+
"storageOption": "RAM",
4310+
"singleton": 0,
4311+
"bounded": 0,
4312+
"defaultValue": "",
4313+
"reportable": 1,
4314+
"minInterval": 1,
4315+
"maxInterval": 65534,
4316+
"reportableChange": 0
4317+
},
4318+
{
4319+
"name": "ActiveScheduleHandle",
4320+
"code": 79,
4321+
"mfgCode": null,
4322+
"side": "server",
4323+
"type": "octet_string",
4324+
"included": 1,
4325+
"storageOption": "RAM",
4326+
"singleton": 0,
4327+
"bounded": 0,
4328+
"defaultValue": "",
4329+
"reportable": 1,
4330+
"minInterval": 1,
4331+
"maxInterval": 65534,
4332+
"reportableChange": 0
4333+
},
4334+
{
4335+
"name": "Presets",
4336+
"code": 80,
4337+
"mfgCode": null,
4338+
"side": "server",
4339+
"type": "array",
4340+
"included": 1,
4341+
"storageOption": "External",
4342+
"singleton": 0,
4343+
"bounded": 0,
4344+
"defaultValue": null,
4345+
"reportable": 1,
4346+
"minInterval": 1,
4347+
"maxInterval": 65534,
4348+
"reportableChange": 0
4349+
},
4350+
{
4351+
"name": "Schedules",
4352+
"code": 81,
4353+
"mfgCode": null,
4354+
"side": "server",
4355+
"type": "array",
4356+
"included": 1,
4357+
"storageOption": "External",
4358+
"singleton": 0,
4359+
"bounded": 0,
4360+
"defaultValue": null,
4361+
"reportable": 1,
4362+
"minInterval": 1,
4363+
"maxInterval": 65534,
4364+
"reportableChange": 0
4365+
},
41644366
{
41654367
"name": "GeneratedCommandList",
41664368
"code": 65528,

0 commit comments

Comments
 (0)