Skip to content

Commit

Permalink
[Feature] RVC Operational State implementation and example cluster se…
Browse files Browse the repository at this point in the history
…rver application (#28020)

* Add RVC Operational State Cluster Implementation

* enable RVC operational state in all-cluster-app

* Add RVC operational state server in all-cluster-app

* Add TestRVCOperationalState

* zap regen all

* Restyled by clang-format

* Address review comments:

* Disable Start/Stop for RVC Operational State, since it's not valid.
* Adjust the test accordingly.
* Rename the overall test in the YAML.

* fix zap error

* fix CI error

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Jul 24, 2023
1 parent a735510 commit 1079832
Show file tree
Hide file tree
Showing 11 changed files with 1,354 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2979,6 +2979,67 @@ server cluster OperationalState = 96 {
command Resume(): OperationalCommandResponse = 3;
}

/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */
server cluster RvcOperationalState = 97 {
enum ErrorStateEnum : ENUM8 {
kFailedToFindChargingDock = 64;
kStuck = 65;
kDustBinMissing = 66;
kDustBinFull = 67;
kWaterTankEmpty = 68;
kWaterTankMissing = 69;
kWaterTankLidOpen = 70;
kMopCleaningPadMissing = 71;
}

enum OperationalStateEnum : ENUM8 {
kSeekingCharger = 64;
kCharging = 65;
kDocked = 66;
}

struct ErrorStateStruct {
enum8 errorStateID = 0;
optional char_string<64> errorStateLabel = 1;
optional char_string<64> errorStateDetails = 2;
}

struct OperationalStateStruct {
enum8 operationalStateID = 0;
optional char_string<64> operationalStateLabel = 1;
}

critical event OperationalError = 0 {
ErrorStateStruct errorState = 0;
}

info event OperationCompletion = 1 {
ENUM8 completionErrorCode = 0;
optional nullable elapsed_s totalOperationalTime = 1;
optional nullable elapsed_s pausedTime = 2;
}

readonly attribute nullable CHAR_STRING phaseList[] = 0;
readonly attribute nullable int8u currentPhase = 1;
readonly attribute nullable elapsed_s countdownTime = 2;
readonly attribute OperationalStateStruct operationalStateList[] = 3;
readonly attribute enum8 operationalState = 4;
readonly attribute ErrorStateStruct operationalError = 5;
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;

response struct OperationalCommandResponse = 4 {
ErrorStateStruct commandResponseState = 0;
}

command Pause(): OperationalCommandResponse = 0;
command Resume(): OperationalCommandResponse = 3;
}

/** Attributes and commands for monitoring HEPA filters in a device */
server cluster HepaFilterMonitoring = 113 {
enum ChangeIndicationEnum : ENUM8 {
Expand Down Expand Up @@ -6632,6 +6693,23 @@ endpoint 1 {
ram attribute clusterRevision default = 1;
}

server cluster RvcOperationalState {
emits event OperationalError;
emits event OperationCompletion;
callback attribute phaseList;
callback attribute currentPhase default = 0;
callback attribute countdownTime default = 0;
callback attribute operationalStateList default = 0;
callback attribute operationalState default = 0;
callback attribute operationalError default = 0;
callback attribute generatedCommandList default = 0;
callback attribute acceptedCommandList default = 0;
callback attribute eventList default = 0;
callback attribute attributeList default = 0;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}

server cluster HepaFilterMonitoring {
callback attribute condition;
callback attribute degradationDirection;
Expand Down
288 changes: 288 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 @@ -16043,6 +16043,294 @@
}
]
},
{
"name": "RVC Operational State",
"code": 97,
"mfgCode": null,
"define": "OPERATIONAL_STATE_RVC_CLUSTER",
"side": "client",
"enabled": 0,
"commands": [
{
"name": "Pause",
"code": 0,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "Resume",
"code": 3,
"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": "RVC Operational State",
"code": 97,
"mfgCode": null,
"define": "OPERATIONAL_STATE_RVC_CLUSTER",
"side": "server",
"enabled": 1,
"commands": [
{
"name": "OperationalCommandResponse",
"code": 4,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
}
],
"attributes": [
{
"name": "PhaseList",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CurrentPhase",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "CountdownTime",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "elapsed_s",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "OperationalStateList",
"code": 3,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "OperationalState",
"code": 4,
"mfgCode": null,
"side": "server",
"type": "enum8",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "OperationalError",
"code": 5,
"mfgCode": null,
"side": "server",
"type": "ErrorStateStruct",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"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": "0",
"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": "0",
"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": "0",
"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": "0",
"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": "0",
"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": "OperationalError",
"code": 0,
"mfgCode": null,
"side": "server",
"included": 1
},
{
"name": "OperationCompletion",
"code": 1,
"mfgCode": null,
"side": "server",
"included": 1
}
]
},
{
"name": "HEPA Filter Monitoring",
"code": 113,
Expand Down
Loading

0 comments on commit 1079832

Please sign in to comment.