Skip to content

Commit

Permalink
Feature/dishwasher alarm impl (#27748)
Browse files Browse the repository at this point in the history
* init disdwasher alarm

* add dishwasher alarm zap

* format file

* Restyled by whitespace

* Restyled by clang-format

* init disdwasher alarm

* add dishwasher alarm zap

* format file

* Restyled by whitespace

* Restyled by clang-format

* modify dishwasheralarm Supported

* revert

* Restyled by clang-format

* modify dishwasher alarm

* modify dishwasher alarm latch support

* add all cluster zap

* modify dishwasher alarm latch support

* modify all cluster zap

* Restyled by whitespace

* Restyled by clang-format

* Add TestDishwasherAlarm

* Modify dishwasher cluster definition in all-cluster-app

* add dishwasher alarm cluster

* Restyled by whitespace and Tab

* Optimize the dishwasher alarm cluster

* Optimize the alarm dishwasher alarm server

* Using namespace to optimize the head file

* Add dishwasher alarm cluster delegate

* optimize TestDishwasherAlarm

* init DishwasherAlarmServer instance in all-cluster-app

* Move the dishwasher alarm plugin server init

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by prettier-yaml

* optimize the note for dishwasher alarm server and delegate

* optimize the note in ciTest

* rename and note the function.

* use static to modify variable

* Fix some bug not match with dishwasher alarm cluster's spec

* modify the init value of attribute in dishwasher alarm cluster in all-cluster-app

* optimize the TestDishwasherAlarm

* take off prefix of variable chip::

* Optimize SetStateByLatch api

* fix CI build error

* optimize document of function in dishwasher alarm cluster

* modify with review advice

* Optimize StateStateValue and ResetStateValue function

* fix SetStateValue function error

* Restyled by whitespace

* Restyled by clang-format

* fix zap error

* modify the State attribute in Dishwasher alarm in zap

* fix CI build error

* Remove function.

* Update src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Update src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* Updates per review

* Update src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.h

Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>

* fix TestScript error in TestDishwasherAlarm

* zap regen all

* fix the document

* Restyled by whitespace

* Restyled by gn

---------

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: mideayanghui <yanghui65@midea.com>
Co-authored-by: Rob Bultman <rob.bultman@gmail.com>
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
5 people authored Jul 24, 2023
1 parent 126eadc commit d328c30
Show file tree
Hide file tree
Showing 15 changed files with 2,257 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2919,6 +2919,47 @@ server cluster SmokeCoAlarm = 92 {
command SelfTestRequest(): DefaultSuccess = 0;
}

/** Attributes and commands for configuring the Dishwasher alarm. */
server cluster DishwasherAlarm = 93 {
bitmap AlarmMap : BITMAP32 {
kInflowError = 0x1;
kDrainError = 0x2;
kDoorError = 0x4;
kTempTooLow = 0x8;
kTempTooHigh = 0x10;
kWaterLevelError = 0x20;
}

info event Notify = 0 {
AlarmMap active = 0;
AlarmMap inactive = 1;
AlarmMap state = 2;
AlarmMap mask = 3;
}

readonly attribute AlarmMap mask = 0;
readonly attribute AlarmMap latch = 1;
readonly attribute AlarmMap state = 2;
readonly attribute AlarmMap supported = 3;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct ResetRequest {
AlarmMap alarms = 0;
}

request struct ModifyEnabledAlarmsRequest {
AlarmMap mask = 0;
}

command Reset(ResetRequest): DefaultSuccess = 0;
command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1;
}

/** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */
server cluster OperationalState = 96 {
enum ErrorStateEnum : ENUM8 {
Expand Down Expand Up @@ -6676,6 +6717,20 @@ endpoint 1 {
ram attribute clusterRevision default = 1;
}

server cluster DishwasherAlarm {
emits event Notify;
ram attribute mask default = 1;
ram attribute latch default = 1;
ram attribute state default = 0;
ram attribute supported default = 15;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 1;
ram attribute clusterRevision default = 1;
}

server cluster OperationalState {
emits event OperationalError;
emits event OperationCompletion;
Expand Down
239 changes: 239 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -15739,6 +15739,245 @@
}
]
},
{
"name": "Dishwasher Alarm",
"code": 93,
"mfgCode": null,
"define": "DISHWASHER_ALARM_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Reset",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "ModifyEnabledAlarms",
"code": 1,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
}
],
"attributes": [
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "client",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "client",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Dishwasher Alarm",
"code": 93,
"mfgCode": null,
"define": "DISHWASHER_ALARM_CLUSTER",
"side": "server",
"enabled": 1,
"attributes": [
{
"name": "Mask",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "AlarmMap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Latch",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "AlarmMap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "State",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "AlarmMap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Supported",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "AlarmMap",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "15",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "EventList",
"code": 65530,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
],
"events": [
{
"name": "Notify",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
}
]
},
{
"name": "Operational State",
"code": 96,
Expand Down
Loading

0 comments on commit d328c30

Please sign in to comment.