Skip to content

Commit

Permalink
Implement PayloadTestRequest command in DGGEN (project-chip#31907)
Browse files Browse the repository at this point in the history
* Add DataModelTest feature to general diagnostics

* Regen ZAP

* Fix TC-DGGEN-1.1

* Restyled by whitespace

* Restyled by clang-format

* Restyled by prettier-json

* Restyled by isort

* Fix integration tests

* Fix Java codegen

* Address review comments

* Fix Java codegen

* Fix Java codegen

* Fix Java codegen golden data

* Fix TC-DGGEN-1.1

* Fix removal of Commands.h

* Fix YAML test

---------

Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and raul-marquez-csa committed Feb 16, 2024
1 parent 9eadaa7 commit 2d5a0e9
Show file tree
Hide file tree
Showing 117 changed files with 3,099 additions and 844 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -815,10 +819,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** Commands to trigger a Node to allow a new Administrator to commission it. */
Expand Down Expand Up @@ -2390,8 +2406,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -768,10 +772,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -2103,8 +2119,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -1753,10 +1757,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -7380,12 +7396,14 @@ endpoint 0 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
handle command TimeSnapshotResponse;
handle command PayloadTestRequest;
handle command PayloadTestResponse;
}

server cluster SoftwareDiagnostics {
Expand Down
16 changes: 16 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 @@ -2863,6 +2863,22 @@
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "PayloadTestRequest",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "PayloadTestResponse",
"code": 4,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -1633,10 +1637,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -6071,12 +6087,14 @@ endpoint 0 {
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
handle command TimeSnapshotResponse;
handle command PayloadTestRequest;
handle command PayloadTestResponse;
}

server cluster SoftwareDiagnostics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2464,6 +2464,22 @@
"source": "server",
"isIncoming": 0,
"isEnabled": 1
},
{
"name": "PayloadTestRequest",
"code": 3,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
},
{
"name": "PayloadTestResponse",
"code": 4,
"mfgCode": null,
"source": "server",
"isIncoming": 0,
"isEnabled": 1
}
],
"attributes": [
Expand Down
20 changes: 18 additions & 2 deletions examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -1218,10 +1222,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -2049,8 +2065,8 @@ endpoint 0 {
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -991,10 +995,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -1753,8 +1769,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
20 changes: 18 additions & 2 deletions examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,10 @@ cluster GeneralDiagnostics = 51 {
kEthernetFault = 6;
}

bitmap Feature : bitmap32 {
kDataModelTest = 0x1;
}

struct NetworkInterface {
char_string<32> name = 0;
boolean isOperational = 1;
Expand Down Expand Up @@ -815,10 +819,22 @@ cluster GeneralDiagnostics = 51 {
nullable posix_ms posixTimeMs = 1;
}

request struct PayloadTestRequestRequest {
octet_string<16> enableKey = 0;
int8u value = 1;
int16u count = 2;
}

response struct PayloadTestResponse = 4 {
octet_string payload = 0;
}

/** Provide a means for certification tests to trigger some test-plan-specific events */
command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0;
/** Take a snapshot of system time and epoch time. */
command TimeSnapshot(): TimeSnapshotResponse = 1;
/** Request a variable length payload response. */
command PayloadTestRequest(PayloadTestRequestRequest): PayloadTestResponse = 3;
}

/** 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. */
Expand Down Expand Up @@ -1443,8 +1459,8 @@ endpoint 0 {
callback attribute activeRadioFaults;
callback attribute activeNetworkFaults;
callback attribute testEventTriggersEnabled default = false;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 0x0002;
callback attribute featureMap;
callback attribute clusterRevision;

handle command TestEventTrigger;
handle command TimeSnapshot;
Expand Down
Loading

0 comments on commit 2d5a0e9

Please sign in to comment.