From 888aad0b453b8b5ba0fd7d4811ae090d101d31ea Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Wed, 15 Feb 2023 12:41:15 -0800 Subject: [PATCH] Updated Lighting App ZAP Files with Supported Events (#25025) * Updated Lighting App ZAP Files with Supported Events Fixed Test Script ZAP file: - Removed SoftwareFault event from the Software Diagnostics Cluster, which is not implemented for this app. - Removed all Thread Network Diagnostics Cluster events, which are currently not implemented in the SDK at all. Added Supported Events to the Lighting App ZAP Example File * ZAP REGEN --- .../lighting-common/lighting-app.matter | 15 +++ .../lighting-common/lighting-app.zap | 117 +++++++++++++++++- .../tools/zap/tests/inputs/lighting-app.zap | 25 ---- .../app-templates/endpoint_config.h | 21 ++-- 4 files changed, 138 insertions(+), 40 deletions(-) diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 56185c1e94d00c..a1208b971816eb 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -1846,6 +1846,8 @@ endpoint 0 { } server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; callback attribute acl; callback attribute extension; callback attribute subjectsPerAccessControlEntry default = 4; @@ -1857,6 +1859,9 @@ endpoint 0 { } server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; callback attribute dataModelRevision default = 10; callback attribute vendorName; callback attribute vendorID; @@ -1882,6 +1887,9 @@ endpoint 0 { } server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; callback attribute defaultOTAProviders; ram attribute updatePossible default = 1; ram attribute updateState; @@ -1934,6 +1942,10 @@ endpoint 0 { } server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; callback attribute networkInterfaces; callback attribute rebootCount; callback attribute upTime; @@ -2025,6 +2037,9 @@ endpoint 0 { } server cluster WiFiNetworkDiagnostics { + emits event Disconnection; + emits event AssociationFailure; + emits event ConnectionStatus; callback attribute bssid; callback attribute securityType; callback attribute wiFiVersion; diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index 993b5d90af7611..23a796072a305a 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1130,6 +1130,22 @@ "maxInterval": 65534, "reportableChange": 0 } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -1518,6 +1534,29 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -1804,6 +1843,29 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -2796,6 +2858,36 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -4310,6 +4402,29 @@ "maxInterval": 65344, "reportableChange": 0 } + ], + "events": [ + { + "name": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } ] }, { @@ -8228,4 +8343,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index ea68dc1a323d2b..1285e4840e30e9 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -3030,15 +3030,6 @@ "maxInterval": 65344, "reportableChange": 0 } - ], - "events": [ - { - "name": "SoftwareFault", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - } ] }, { @@ -4125,22 +4116,6 @@ "maxInterval": 65344, "reportableChange": 0 } - ], - "events": [ - { - "name": "ConnectionStatus", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1 - }, - { - "name": "NetworkFaultChange", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1 - } ] }, { diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index 16670c0d7a9957..5e6a4111d16834 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -549,7 +549,7 @@ #define ZAP_GENERATED_COMMANDS_INDEX(index) (&generatedCommands[index]) // clang-format off -#define GENERATED_EVENT_COUNT 18 +#define GENERATED_EVENT_COUNT 15 #define GENERATED_EVENTS { \ /* Endpoint: 0, Cluster: Access Control (server) */ \ /* EventList (index=0) */ \ @@ -571,15 +571,8 @@ 0x00000001, /* RadioFaultChange */ \ 0x00000002, /* NetworkFaultChange */ \ 0x00000003, /* BootReason */ \ - /* Endpoint: 0, Cluster: Software Diagnostics (server) */ \ - /* EventList (index=12) */ \ - 0x00000000, /* SoftwareFault */ \ - /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ - /* EventList (index=13) */ \ - 0x00000000, /* ConnectionStatus */ \ - 0x00000001, /* NetworkFaultChange */ \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ - /* EventList (index=15) */ \ + /* EventList (index=12) */ \ 0x00000000, /* Disconnection */ \ 0x00000001, /* AssociationFailure */ \ 0x00000002, /* ConnectionStatus */ \ @@ -963,8 +956,8 @@ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ) ,\ .generatedCommandList = nullptr ,\ - .eventList = ZAP_GENERATED_EVENTS_INDEX( 12 ), \ - .eventCount = 1, \ + .eventList = nullptr, \ + .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ @@ -976,8 +969,8 @@ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 41 ) ,\ .generatedCommandList = nullptr ,\ - .eventList = ZAP_GENERATED_EVENTS_INDEX( 13 ), \ - .eventCount = 2, \ + .eventList = nullptr, \ + .eventCount = 0, \ },\ { \ /* Endpoint: 0, Cluster: WiFi Network Diagnostics (server) */ \ @@ -989,7 +982,7 @@ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 43 ) ,\ .generatedCommandList = nullptr ,\ - .eventList = ZAP_GENERATED_EVENTS_INDEX( 15 ), \ + .eventList = ZAP_GENERATED_EVENTS_INDEX( 12 ), \ .eventCount = 3, \ },\ { \