From b8ecfce42c282c271420142c0d5266286e0ec5bf Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 10:18:45 -0400 Subject: [PATCH 01/20] Initial commit to add some MEI types - specifically a MEI attribute --- .../all-clusters-common/all-clusters-app.zap | 16 ++++ .../mode-select-cluster-test-extended.xml | 76 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 403d95a4cc02d8..3feac61c867bb3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12585,6 +12585,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ManufacturerExtension", + "code": 0xFFF10001, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "255", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml new file mode 100644 index 00000000000000..e2e04535edd920 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + General + Mode Select + 0x0050 + MODE_SELECT_CLUSTER + true + true + Attributes and commands for selecting a mode from a list of supported options. + + Description + StandardNamespace + SupportedModes + CurrentMode + StartUpMode + OnMode + + + ManufacturerExtension + + + + + On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. + + + + + + + + + + + From 300c1e23ea99a315131052cc6828cbc3d763d22e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 10:20:23 -0400 Subject: [PATCH 02/20] Update code to be non-hex --- .../all-clusters-app/all-clusters-common/all-clusters-app.zap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 3feac61c867bb3..212fe99e493b5e 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12587,7 +12587,7 @@ }, { "name": "ManufacturerExtension", - "code": 0xFFF10001, + "code": 4293984257, "mfgCode": null, "side": "server", "type": "int8u", From 43e9ce918866b365f7211c7d114eedba045d631e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 11:26:15 -0400 Subject: [PATCH 03/20] Add an extensions xml file --- .../mode-select-cluster-test-extended.xml | 76 ------------------- .../test/mode-select-extensions.xml | 29 +++++++ src/app/zap-templates/zcl/zcl.json | 3 +- 3 files changed, 31 insertions(+), 77 deletions(-) delete mode 100644 src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml create mode 100644 src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml deleted file mode 100644 index e2e04535edd920..00000000000000 --- a/src/app/zap-templates/zcl/data-model/test/mode-select-cluster-test-extended.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - General - Mode Select - 0x0050 - MODE_SELECT_CLUSTER - true - true - Attributes and commands for selecting a mode from a list of supported options. - - Description - StandardNamespace - SupportedModes - CurrentMode - StartUpMode - OnMode - - - ManufacturerExtension - - - - - On receipt of this command, if the NewMode field matches the Mode field in an entry of the SupportedModes list, the server SHALL set the CurrentMode attribute to the NewMode value, otherwise, the server SHALL respond with an INVALID_COMMAND status response. - - - - - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml new file mode 100644 index 00000000000000..8ceb9f5dde7a31 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml @@ -0,0 +1,29 @@ + + + + + ManufacturerExtension + + + Sample manufacturer specific extension command + + + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index e0c451a858b09d..b0ba63a2367863 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -1,6 +1,6 @@ { "version": "ZCL Test Data", - "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], + "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/", "./data-model/test"], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", @@ -38,6 +38,7 @@ "media-input-cluster.xml", "media-playback-cluster.xml", "mode-select-cluster.xml", + "mode-select-extensions.xml", "network-commissioning-cluster.xml", "onoff-cluster.xml", "operational-credentials-cluster.xml", From 1dce02a7532a03373116a4e6d3a8076aa9197d55 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 11:30:45 -0400 Subject: [PATCH 04/20] Added a manufacturer specific extension, codegen seems to work on all clusters app --- .../all-clusters-app.matter | 2 + .../all-clusters-common/all-clusters-app.zap | 2 +- .../test/mode-select-extensions.xml | 15 ++-- .../zap-generated/endpoint_config.h | 85 ++++++++++--------- 4 files changed, 54 insertions(+), 50 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 184121fda55581..4d00cbf7abd2e3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2170,6 +2170,7 @@ server cluster ModeSelect = 80 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + readonly attribute int8u manufacturerExtension = 4293984257; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -4324,6 +4325,7 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 1; ram attribute clusterRevision default = 1; + ram attribute manufacturerExtension default = 255; } server cluster DoorLock { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 212fe99e493b5e..d6496bf904fdf1 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12592,7 +12592,7 @@ "side": "server", "type": "int8u", "included": 1, - "storageOption": "NVM", + "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "255", diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml index 8ceb9f5dde7a31..f4b04ad15e924a 100644 --- a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml @@ -14,16 +14,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - + + + - ManufacturerExtension - - + ManufacturerExtension + Sample manufacturer specific extension command - - - + + + diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 12cb42bab63ab0..75681c8af254d1 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -376,7 +376,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 725 +#define GENERATED_ATTRIBUTE_COUNT 726 #define GENERATED_ATTRIBUTES \ { \ \ @@ -891,8 +891,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ - { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ + { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ + { 0xFFF10001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(255) }, /* ManufacturerExtension */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ { 0x00000004, ZAP_TYPE(INT8U), 1, \ @@ -2379,8 +2380,8 @@ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ .attributes = ZAP_ATTRIBUTE_INDEX(313), \ - .attributeCount = 8, \ - .clusterSize = 44, \ + .attributeCount = 9, \ + .clusterSize = 45, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayModeSelectServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 122 ) ,\ @@ -2389,7 +2390,7 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(321), \ + .attributes = ZAP_ATTRIBUTE_INDEX(322), \ .attributeCount = 33, \ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2400,7 +2401,7 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(354), \ + .attributes = ZAP_ATTRIBUTE_INDEX(355), \ .attributeCount = 24, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2411,7 +2412,7 @@ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(378), \ + .attributes = ZAP_ATTRIBUTE_INDEX(379), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2422,7 +2423,7 @@ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(385), \ .attributeCount = 25, \ .clusterSize = 52, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2433,7 +2434,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(409), \ + .attributes = ZAP_ATTRIBUTE_INDEX(410), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2444,7 +2445,7 @@ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(429), \ + .attributes = ZAP_ATTRIBUTE_INDEX(430), \ .attributeCount = 13, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2455,7 +2456,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(442), \ + .attributes = ZAP_ATTRIBUTE_INDEX(443), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2466,7 +2467,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(447), \ + .attributes = ZAP_ATTRIBUTE_INDEX(448), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2477,7 +2478,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(501), \ + .attributes = ZAP_ATTRIBUTE_INDEX(502), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2488,7 +2489,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(508), \ + .attributes = ZAP_ATTRIBUTE_INDEX(509), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2499,7 +2500,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(514), \ + .attributes = ZAP_ATTRIBUTE_INDEX(515), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2510,7 +2511,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(519), \ + .attributes = ZAP_ATTRIBUTE_INDEX(520), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2521,7 +2522,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(525), \ + .attributes = ZAP_ATTRIBUTE_INDEX(526), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2532,7 +2533,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(531), \ + .attributes = ZAP_ATTRIBUTE_INDEX(532), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2543,7 +2544,7 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(536), \ + .attributes = ZAP_ATTRIBUTE_INDEX(537), \ .attributeCount = 7, \ .clusterSize = 20, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ @@ -2554,7 +2555,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(543), \ + .attributes = ZAP_ATTRIBUTE_INDEX(544), \ .attributeCount = 3, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2565,7 +2566,7 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(546), \ + .attributes = ZAP_ATTRIBUTE_INDEX(547), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2576,7 +2577,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(549), \ + .attributes = ZAP_ATTRIBUTE_INDEX(550), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2587,7 +2588,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(553), \ + .attributes = ZAP_ATTRIBUTE_INDEX(554), \ .attributeCount = 8, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2598,7 +2599,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(561), \ + .attributes = ZAP_ATTRIBUTE_INDEX(562), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2609,7 +2610,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(565), \ + .attributes = ZAP_ATTRIBUTE_INDEX(566), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2620,7 +2621,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(567), \ + .attributes = ZAP_ATTRIBUTE_INDEX(568), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2631,7 +2632,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(569), \ + .attributes = ZAP_ATTRIBUTE_INDEX(570), \ .attributeCount = 4, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2642,7 +2643,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(573), \ + .attributes = ZAP_ATTRIBUTE_INDEX(574), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2653,7 +2654,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(577), \ + .attributes = ZAP_ATTRIBUTE_INDEX(578), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2664,7 +2665,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(580), \ + .attributes = ZAP_ATTRIBUTE_INDEX(581), \ .attributeCount = 9, \ .clusterSize = 110, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2675,7 +2676,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(589), \ + .attributes = ZAP_ATTRIBUTE_INDEX(590), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2686,7 +2687,7 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(591), \ + .attributes = ZAP_ATTRIBUTE_INDEX(592), \ .attributeCount = 82, \ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2697,7 +2698,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(673), \ + .attributes = ZAP_ATTRIBUTE_INDEX(674), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2708,7 +2709,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(686), \ + .attributes = ZAP_ATTRIBUTE_INDEX(687), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2719,7 +2720,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(689), \ + .attributes = ZAP_ATTRIBUTE_INDEX(690), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2730,7 +2731,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(696), \ + .attributes = ZAP_ATTRIBUTE_INDEX(697), \ .attributeCount = 6, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2741,7 +2742,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(702), \ + .attributes = ZAP_ATTRIBUTE_INDEX(703), \ .attributeCount = 8, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2752,7 +2753,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(710), \ + .attributes = ZAP_ATTRIBUTE_INDEX(711), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2763,7 +2764,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(715), \ + .attributes = ZAP_ATTRIBUTE_INDEX(716), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2782,7 +2783,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3482 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ + { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3483 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ { ZAP_CLUSTER_INDEX(77), 1, 0 }, \ } @@ -2795,7 +2796,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3942) +#define ATTRIBUTE_MAX_SIZE (3943) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) From 9a24b5c922ef421cda161f12e9cc2ad4a6a71c72 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 11:41:32 -0400 Subject: [PATCH 05/20] ran zap regen after adding custom command in zap file --- .../all-clusters-common/all-clusters-app.zap | 8 ++ .../python/chip/clusters/Objects.py | 31 +++++ .../CHIPAttributeTLVValueDecoder.mm | 11 ++ .../CHIP/zap-generated/CHIPClustersObjc.h | 22 ++++ .../CHIP/zap-generated/CHIPClustersObjc.mm | 92 ++++++++++++++ .../zap-generated/CHIPCommandPayloadsObjc.h | 19 +++ .../zap-generated/CHIPCommandPayloadsObjc.mm | 16 +++ .../zap-generated/MatterClusterConstants.h | 2 + .../app-common/zap-generated/attribute-id.h | 1 + .../zap-generated/attributes/Accessors.cpp | 31 +++++ .../zap-generated/attributes/Accessors.h | 5 + .../app-common/zap-generated/callback.h | 6 + .../zap-generated/cluster-objects.cpp | 36 ++++++ .../zap-generated/cluster-objects.h | 50 +++++++- .../app-common/zap-generated/command-id.h | 1 + .../app-common/zap-generated/ids/Attributes.h | 4 + .../app-common/zap-generated/ids/Commands.h | 4 + .../zap-generated/cluster/Commands.h | 93 +++++++++----- .../cluster/logging/DataModelLogger.cpp | 5 + .../cluster/CHIPTestClustersObjc.h | 2 + .../cluster/CHIPTestClustersObjc.mm | 19 +++ .../zap-generated/cluster/Commands.h | 113 ++++++++++++++++++ 22 files changed, 540 insertions(+), 31 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index d6496bf904fdf1..ede7d9b7fa58cf 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12459,6 +12459,14 @@ "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "SampleMfgExtensionCommand", + "code": 4293984257, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 } ], "attributes": [ diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 1bf75324a9049b..2d43f79bb10072 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -15740,6 +15740,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ClusterObjectFieldDescriptor(Label="manufacturerExtension", Tag=0xFFF10001, Type=typing.Optional[uint]), ]) description: 'str' = None @@ -15753,6 +15754,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: attributeList: 'typing.List[uint]' = None featureMap: 'uint' = None clusterRevision: 'uint' = None + manufacturerExtension: 'typing.Optional[uint]' = None class Structs: @@ -15802,6 +15804,19 @@ def descriptor(cls) -> ClusterObjectDescriptor: newMode: 'uint' = 0 + @dataclass + class SampleMfgExtensionCommand(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0050 + command_id: typing.ClassVar[int] = 0x0001 + is_client: typing.ClassVar[bool] = True + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields = [ + ]) + + class Attributes: @dataclass @@ -15980,6 +15995,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + @dataclass + class ManufacturerExtension(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x0050 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0xFFF10001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) + + value: 'typing.Optional[uint]' = None + @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index 1dd23133baa2a8..ca1b53240a37de 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -9150,6 +9150,17 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } + case Attributes::ManufacturerExtension::Id: { + using TypeInfo = Attributes::ManufacturerExtension::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 2827cafaef8d10..07282d91df8ab5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -11040,6 +11040,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)changeToModeWithParams:(CHIPModeSelectClusterChangeToModeParams *)params completionHandler:(StatusCompletion)completionHandler; +- (void)sampleMfgExtensionCommandWithParams:(CHIPModeSelectClusterSampleMfgExtensionCommandParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler; +- (void)sampleMfgExtensionCommandWithCompletionHandler:(StatusCompletion)completionHandler; - (void)readAttributeDescriptionWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -11242,6 +11245,25 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; +- (void)readAttributeManufacturerExtensionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler; +/** + * This API does not support setting autoResubscribe to NO in the + * CHIPSubscribeParams. + */ +- (void)subscribeAttributeManufacturerExtensionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; ++ (void)readAttributeManufacturerExtensionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; + @end /** diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 1f13f6795c8c53..3896fd57a0f5fd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -41530,6 +41530,35 @@ new CHIPCommandSuccessCallbackBridge( }); } +- (void)sampleMfgExtensionCommandWithCompletionHandler:(StatusCompletion)completionHandler +{ + [self sampleMfgExtensionCommandWithParams:nil completionHandler:completionHandler]; +} +- (void)sampleMfgExtensionCommandWithParams:(CHIPModeSelectClusterSampleMfgExtensionCommandParams * _Nullable)params + completionHandler:(StatusCompletion)completionHandler +{ + chip::Optional timedInvokeTimeoutMs; + ListFreer listFreer; + ModeSelect::Commands::SampleMfgExtensionCommand::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + } + + new CHIPCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.InvokeCommand( + request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); + }); +} + - (void)readAttributeDescriptionWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler { @@ -42290,6 +42319,69 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s }); } +- (void)readAttributeManufacturerExtensionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + +- (void)subscribeAttributeManufacturerExtensionWithMinInterval:(NSNumber * _Nonnull)minInterval + maxInterval:(NSNumber * _Nonnull)maxInterval + params:(CHIPSubscribeParams * _Nullable)params + subscriptionEstablished: + (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler + reportHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + new CHIPInt8uAttributeCallbackSubscriptionBridge( + self.callbackQueue, reportHandler, + ^(Cancelable * success, Cancelable * failure) { + if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { + // We don't support disabling auto-resubscribe. + return CHIP_ERROR_INVALID_ARGUMENT; + } + using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, + [minInterval unsignedShortValue], [maxInterval unsignedShortValue], + CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], + params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); + }, + subscriptionEstablishedHandler); +} + ++ (void)readAttributeManufacturerExtensionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completionHandler: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler +{ + new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + @end @implementation CHIPNetworkCommissioning diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index eaf1d61b7e1228..91e801398e820c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -3484,6 +3484,25 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; +- (instancetype)init; +@end +@interface CHIPModeSelectClusterSampleMfgExtensionCommandParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; + - (instancetype)init; @end @interface CHIPDoorLockClusterLockDoorParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index 5741b5c150d0e8..30b9e93e825050 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -3197,6 +3197,22 @@ - (NSString *)description return descriptionString; } +@end +@implementation CHIPModeSelectClusterSampleMfgExtensionCommandParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + } + return self; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + @end @implementation CHIPDoorLockClusterLockDoorParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h index 87cf8a5f6fa778..82e3276e148b35 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h @@ -848,6 +848,7 @@ typedef NS_ENUM(uint32_t, MatterClusterAttributeIDType) { kMatterClusterModeSelectAttributeAttributeListID = kMatterClusterGlobalAttributeAttributeListID, kMatterClusterModeSelectAttributeFeatureMapID = kMatterClusterGlobalAttributeFeatureMapID, kMatterClusterModeSelectAttributeClusterRevisionID = kMatterClusterGlobalAttributeClusterRevisionID, + kMatterClusterModeSelectAttributeManufacturerExtensionID = 0xFFF10001, // Cluster ShadeConfiguration attributes kMatterClusterShadeConfigurationAttributePhysicalClosedLimitID = 0x00000000, @@ -2270,6 +2271,7 @@ typedef NS_ENUM(uint32_t, MatterClusterCommandIDType) { // Cluster ModeSelect commands kMatterClusterModeSelectCommandChangeToModeID = 0x00000000, + kMatterClusterModeSelectCommandSampleMfgExtensionCommandID = 0x00 - EFFFF, // Cluster DoorLock commands kMatterClusterDoorLockCommandLockDoorID = 0x00000000, diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 674ea17b437e66..34681ebafeef7a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -673,6 +673,7 @@ #define ZCL_CURRENT_MODE_ATTRIBUTE_ID (0x0003) #define ZCL_START_UP_MODE_ATTRIBUTE_ID (0x0004) #define ZCL_ON_MODE_ATTRIBUTE_ID (0x0005) +#define ZCL_MEI_EXTENSION_ATTRIBUTE_ID (0xFFF10001) // Attribute ids for cluster: Shade Configuration diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 8997ba86d35fe2..5d98720b8b9bdf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -14056,6 +14056,37 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace ClusterRevision +namespace ManufacturerExtension { + +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace ManufacturerExtension + } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 089500dd37f026..a5bcbf32022c5e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2489,6 +2489,11 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision +namespace ManufacturerExtension { +EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u +EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +} // namespace ManufacturerExtension + } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 20e4c5a0a2cb4a..29a4898cb34729 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -13169,6 +13169,12 @@ bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( bool emberAfModeSelectClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ModeSelect::Commands::ChangeToMode::DecodableType & commandData); +/** + * @brief Mode Select Cluster SampleMfgExtensionCommand Command callback (from client) + */ +bool emberAfModeSelectClusterSampleMfgExtensionCommandCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::ModeSelect::Commands::SampleMfgExtensionCommand::DecodableType & commandData); /** * @brief Door Lock Cluster LockDoor Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 284a683877af59..fe554b3d604337 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -12415,6 +12415,39 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. +namespace SampleMfgExtensionCommand { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace SampleMfgExtensionCommand. } // namespace Commands namespace Attributes { @@ -12455,6 +12488,9 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); break; + case Attributes::ManufacturerExtension::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, manufacturerExtension)); + break; default: break; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 68343842a54cec..50fe3c3ec52199 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -15695,6 +15695,11 @@ struct Type; struct DecodableType; } // namespace ChangeToMode +namespace SampleMfgExtensionCommand { +struct Type; +struct DecodableType; +} // namespace SampleMfgExtensionCommand + } // namespace Commands namespace Commands { @@ -15730,6 +15735,34 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode +namespace SampleMfgExtensionCommand { +enum class Fields +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::SampleMfgExtensionCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::SampleMfgExtensionCommand::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace SampleMfgExtensionCommand } // namespace Commands namespace Attributes { @@ -15839,6 +15872,18 @@ struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInf static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } }; } // namespace ClusterRevision +namespace ManufacturerExtension { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ManufacturerExtension::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ManufacturerExtension struct TypeInfo { @@ -15857,8 +15902,9 @@ struct TypeInfo Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + Attributes::ManufacturerExtension::TypeInfo::DecodableType manufacturerExtension = static_cast(0); }; }; } // namespace Attributes diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 601c4dbc461b6a..763331a9dc44fd 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -230,6 +230,7 @@ // Commands for cluster: Mode Select #define ZCL_CHANGE_TO_MODE_COMMAND_ID (0x00) +#define ZCL_SAMPLE_MFG_EXTENSION_COMMAND_COMMAND_ID (0x01) // Commands for cluster: Door Lock #define ZCL_LOCK_DOOR_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 0e65c09b996e40..944a328d2652e0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2724,6 +2724,10 @@ namespace ClusterRevision { static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision +namespace ManufacturerExtension { +static constexpr AttributeId Id = 0xFFF10001; +} // namespace ManufacturerExtension + } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 44c41b9e76ace3..38ce4a392744e7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -770,6 +770,10 @@ namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode +namespace SampleMfgExtensionCommand { +static constexpr CommandId Id = 0x00 - EFFFF; +} // namespace SampleMfgExtensionCommand + } // namespace Commands } // namespace ModeSelect diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 680e20f7a8660e..10c8ab0a14ad79 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7160,6 +7160,7 @@ class WriteUserLabelLabelList : public WriteAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | +| * SampleMfgExtensionCommand | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -7173,6 +7174,7 @@ class WriteUserLabelLabelList : public WriteAttribute | * AttributeList | 0xFFFB | | * FeatureMap | 0xFFFC | | * ClusterRevision | 0xFFFD | +| * ManufacturerExtension | 0xFFF10001| |------------------------------------------------------------------------------| | Events: | | \*----------------------------------------------------------------------------*/ @@ -7207,6 +7209,36 @@ class ModeSelectChangeToMode : public ClusterCommand chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; +/* + * Command SampleMfgExtensionCommand + */ +class ModeSelectSampleMfgExtensionCommand : public ClusterCommand +{ +public: + ModeSelectSampleMfgExtensionCommand(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("sample-mfg-extension-command", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000001, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000050, 0x00000001, mRequest); + } + +private: + chip::app::Clusters::ModeSelect::Commands::SampleMfgExtensionCommand::Type mRequest; +}; + class WriteModeSelectStartUpMode : public WriteAttribute { public: @@ -21344,38 +21376,41 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // - make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // - make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // + make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, "manufacturer-extension", Attributes::ManufacturerExtension::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // + make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, "manufacturer-extension", Attributes::ManufacturerExtension::Id, credsIssuerConfig), // // // Events // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index c2ae86dcf733a3..9105bb53000332 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7300,6 +7300,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); } + case ModeSelect::Attributes::ManufacturerExtension::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ManufacturerExtension", 1, value); + } } break; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h index 6b499b60008112..93bba6f75caee1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h @@ -922,6 +922,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; +- (void)writeAttributeManufacturerExtensionWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler; @end diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm index e685dbe0682138..2d0ecbb8ea01c6 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -12531,6 +12531,25 @@ new CHIPDefaultSuccessCallbackBridge( }); } +- (void)writeAttributeManufacturerExtensionWithValue:(NSNumber * _Nonnull)value + completionHandler:(StatusCompletion)completionHandler +{ + new CHIPDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completionHandler(error); + }, + ^(Cancelable * success, Cancelable * failure) { + ListFreer listFreer; + using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.unsignedCharValue; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); + }); +} + @end @interface CHIPTestNetworkCommissioning () diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 0368d72f306715..1a47fc086101c1 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -49158,6 +49158,7 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | +| * SampleMfgExtensionCommand | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -49171,6 +49172,7 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute | * AttributeList | 0xFFFB | | * FeatureMap | 0xFFFC | | * ClusterRevision | 0xFFFD | +| * ManufacturerExtension | 0xFFF10001| |------------------------------------------------------------------------------| | Events: | | \*----------------------------------------------------------------------------*/ @@ -49219,6 +49221,46 @@ class ModeSelectChangeToMode : public ClusterCommand { chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; +/* + * Command SampleMfgExtensionCommand + */ +class ModeSelectSampleMfgExtensionCommand : public ClusterCommand { +public: + ModeSelectSampleMfgExtensionCommand() + : ClusterCommand("sample-mfg-extension-command") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + __auto_type * params = [[CHIPModeSelectClusterSampleMfgExtensionCommandParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster sampleMfgExtensionCommandWithCompletionHandler:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + /* * Attribute Description */ @@ -50034,6 +50076,74 @@ class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { } }; +/* + * Attribute ManufacturerExtension + */ +class ReadModeSelectManufacturerExtension : public ReadAttribute { +public: + ReadModeSelectManufacturerExtension() + : ReadAttribute("manufacturer-extension") + { + } + + ~ReadModeSelectManufacturerExtension() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0xFFF10001) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + [cluster readAttributeManufacturerExtensionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.ManufacturerExtension response %@", [value description]); + if (error != nil) { + LogNSError("ModeSelect ManufacturerExtension read Error", error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeModeSelectManufacturerExtension : public SubscribeAttribute { +public: + SubscribeAttributeModeSelectManufacturerExtension() + : SubscribeAttribute("manufacturer-extension") + { + } + + ~SubscribeAttributeModeSelectManufacturerExtension() {} + + CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0xFFF10001) on endpoint %u", endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; + CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; + params.keepPreviousSubscriptions + = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; + params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; + [cluster subscribeAttributeManufacturerExtensionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] + maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] + params:params + subscriptionEstablished:nullptr + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"ModeSelect.ManufacturerExtension response %@", + [value description]); + if (error || !mWait) { + SetCommandExitStatus(error); + } + }]; + + return CHIP_NO_ERROR; + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); + } +}; + /*----------------------------------------------------------------------------*\ | Cluster NetworkCommissioning | 0x0031 | |------------------------------------------------------------------------------| @@ -96998,6 +97108,7 @@ void registerClusterModeSelect(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -97025,6 +97136,8 @@ void registerClusterModeSelect(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // + make_unique(), // }; commands.Register(clusterName, clusterCommands); From f3b5d5afd5654137e2a856ed5f866c4242e97a0a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 11:50:01 -0400 Subject: [PATCH 06/20] Move extensions to separate json ... does not work in generation yet though --- .../all-clusters-app.matter | 2 - .../all-clusters-common/all-clusters-app.zap | 2 +- .../zcl/zcl-with-test-extensions.json | 257 ++++++++++++++++++ src/app/zap-templates/zcl/zcl.json | 3 +- .../python/chip/clusters/Objects.py | 31 --- .../CHIPAttributeTLVValueDecoder.mm | 11 - .../CHIP/zap-generated/CHIPClustersObjc.h | 22 -- .../CHIP/zap-generated/CHIPClustersObjc.mm | 92 ------- .../zap-generated/CHIPCommandPayloadsObjc.h | 19 -- .../zap-generated/CHIPCommandPayloadsObjc.mm | 16 -- .../zap-generated/MatterClusterConstants.h | 2 - .../zap-generated/endpoint_config.h | 85 +++--- .../app-common/zap-generated/attribute-id.h | 1 - .../zap-generated/attributes/Accessors.cpp | 31 --- .../zap-generated/attributes/Accessors.h | 5 - .../app-common/zap-generated/callback.h | 6 - .../zap-generated/cluster-objects.cpp | 36 --- .../zap-generated/cluster-objects.h | 50 +--- .../app-common/zap-generated/command-id.h | 1 - .../app-common/zap-generated/ids/Attributes.h | 4 - .../app-common/zap-generated/ids/Commands.h | 4 - .../zap-generated/cluster/Commands.h | 93 ++----- .../cluster/logging/DataModelLogger.cpp | 5 - .../cluster/CHIPTestClustersObjc.h | 2 - .../cluster/CHIPTestClustersObjc.mm | 19 -- .../zap-generated/cluster/Commands.h | 113 -------- 26 files changed, 332 insertions(+), 580 deletions(-) create mode 100644 src/app/zap-templates/zcl/zcl-with-test-extensions.json diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 4d00cbf7abd2e3..184121fda55581 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2170,7 +2170,6 @@ server cluster ModeSelect = 80 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; - readonly attribute int8u manufacturerExtension = 4293984257; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -4325,7 +4324,6 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 1; ram attribute clusterRevision default = 1; - ram attribute manufacturerExtension default = 255; } server cluster DoorLock { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index ede7d9b7fa58cf..63b3a49cd70fe5 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -18,7 +18,7 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/zcl/zcl.json", + "path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json", "version": "ZCL Test Data", "type": "zcl-properties" }, diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json new file mode 100644 index 00000000000000..b0ba63a2367863 --- /dev/null +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -0,0 +1,257 @@ +{ + "version": "ZCL Test Data", + "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/", "./data-model/test"], + "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", + "xmlFile": [ + "access-control-definitions.xml", + "access-control-cluster.xml", + "account-login-cluster.xml", + "administrator-commissioning-cluster.xml", + "application-basic-cluster.xml", + "application-launcher-cluster.xml", + "audio-output-cluster.xml", + "basic-information-cluster.xml", + "binding-cluster.xml", + "boolean-state-cluster.xml", + "bridged-actions-cluster.xml", + "bridged-device-basic.xml", + "chip-ota.xml", + "chip-types.xml", + "channel-cluster.xml", + "clusters-extensions.xml", + "content-launch-cluster.xml", + "descriptor-cluster.xml", + "diagnostic-logs-cluster.xml", + "door-lock-cluster.xml", + "ethernet-network-diagnostics-cluster.xml", + "fixed-label-cluster.xml", + "flow-measurement-cluster.xml", + "general-commissioning-cluster.xml", + "general-diagnostics-cluster.xml", + "global-attributes.xml", + "group-key-mgmt-cluster.xml", + "identify-cluster.xml", + "illuminance-measurement-cluster.xml", + "keypad-input-cluster.xml", + "localization-configuration-cluster.xml", + "low-power-cluster.xml", + "media-input-cluster.xml", + "media-playback-cluster.xml", + "mode-select-cluster.xml", + "mode-select-extensions.xml", + "network-commissioning-cluster.xml", + "onoff-cluster.xml", + "operational-credentials-cluster.xml", + "pressure-measurement-cluster.xml", + "power-source-cluster.xml", + "power-source-configuration-cluster.xml", + "proxy-configuration-cluster.xml", + "proxy-discovery-cluster.xml", + "proxy-valid-cluster.xml", + "pump-configuration-and-control-cluster.xml", + "pwm-cluster.xml", + "relative-humidity-measurement-cluster.xml", + "scene.xml", + "software-diagnostics-cluster.xml", + "switch-cluster.xml", + "target-navigator-cluster.xml", + "temperature-measurement-cluster.xml", + "test-cluster.xml", + "thermostat-cluster.xml", + "thread-network-diagnostics-cluster.xml", + "time-format-localization-cluster.xml", + "time-synchronization-cluster.xml", + "user-label-cluster.xml", + "unit-localization-cluster.xml", + "wake-on-lan-cluster.xml", + "wifi-network-diagnostics-cluster.xml", + "window-covering.xml", + "matter-devices.xml", + "ami.xml", + "general.xml", + "ha-devices.xml", + "ha.xml", + "lo-devices.xml", + "types.xml", + "zll-devices.xml", + "zll.xml" + ], + "manufacturersXml": "../../../../third_party/zap/repo/zcl-builtin/shared/manufacturers.xml", + "options": { + "text": { + "defaultResponsePolicy": ["Always", "Conditional", "Never"] + }, + "bool": ["commandDiscovery"] + }, + "defaults": { + "text": { + "manufacturerCodes": "0x1002", + "defaultResponsePolicy": "always" + }, + "bool": { + "commandDiscovery": true + } + }, + "listsUseAttributeAccessInterface": true, + "attributeAccessInterfaceAttributes": { + "Access Control": [ + "ClusterRevision", + "SubjectsPerAccessControlEntry", + "TargetsPerAccessControlEntry", + "AccessControlEntriesPerFabric" + ], + "AdministratorCommissioning": [ + "WindowStatus", + "AdminFabricIndex", + "AdminVendorId" + ], + "Basic": [ + "DataModelRevision", + "VendorName", + "VendorID", + "ProductName", + "ProductID", + "Location", + "HardwareVersion", + "HardwareVersionString", + "SoftwareVersion", + "SoftwareVersionString", + "ManufacturingDate", + "PartNumber", + "ProductURL", + "ProductLabel", + "SerialNumber", + "UniqueID", + "CapabilityMinima" + ], + "Descriptor": ["ClusterRevision"], + "Ethernet Network Diagnostics": [ + "PHYRate", + "FullDuplex", + "CarrierDetect", + "TimeSinceReset", + "PacketRxCount", + "PacketTxCount", + "TxErrCount", + "CollisionCount", + "OverrunCount" + ], + "General Commissioning": [ + "RegulatoryConfig", + "LocationCapability", + "BasicCommissioningInfo", + "SupportsConcurrentConnection" + ], + "General Diagnostics": [ + "NetworkInterfaces", + "ActiveHardwareFaults", + "ActiveRadioFaults", + "ActiveNetworkFaults", + "RebootCount", + "UpTime", + "TotalOperationalHours", + "BootReasons" + ], + "Group Key Management": [ + "ClusterRevision", + "MaxGroupsPerFabric", + "MaxGroupKeysPerFabric", + "FeatureMap" + ], + "Operational Credentials": [ + "SupportedFabrics", + "CommissionedFabrics", + "CurrentFabricIndex" + ], + "Software Diagnostics": [ + "CurrentHeapFree", + "CurrentHeapHighWatermark", + "CurrentHeapUsed", + "FeatureMap", + "ThreadMetrics" + ], + "Test Cluster": [ + "struct_attr", + "nullable_struct", + "general_error_boolean", + "cluster_error_boolean" + ], + "Thread Network Diagnostics": [ + "channel", + "RoutingRole", + "NetworkName", + "PanId", + "ExtendedPanId", + "MeshLocalPrefix", + "OverrunCount", + "PartitionId", + "weighting", + "DataVersion", + "StableDataVersion", + "LeaderRouterId", + "DetachedRoleCount", + "ChildRoleCount", + "RouterRoleCount", + "LeaderRoleCount", + "AttachAttemptCount", + "PartitionIdChangeCount", + "BetterPartitionAttachAttemptCount", + "ParentChangeCount", + "TxTotalCount", + "TxUnicastCount", + "TxBroadcastCount", + "TxAckRequestedCount", + "TxAckedCount", + "TxNoAckRequestedCount", + "TxDataCount", + "TxDataPollCount", + "TxBeaconCount", + "TxBeaconRequestCount", + "TxOtherCount", + "TxRetryCount", + "TxDirectMaxRetryExpiryCount", + "TxIndirectMaxRetryExpiryCount", + "TxErrCcaCount", + "TxErrAbortCount", + "TxErrBusyChannelCount", + "RxTotalCount", + "RxUnicastCount", + "RxBroadcastCount", + "RxDataCount", + "RxDataPollCount", + "RxBeaconCount", + "RxBeaconRequestCount", + "RxOtherCount", + "RxAddressFilteredCount", + "RxDestAddrFilteredCount", + "RxDuplicatedCount", + "RxErrNoFrameCount", + "RxErrUnknownNeighborCount", + "RxErrInvalidSrcAddrCount", + "RxErrSecCount", + "RxErrFcsCount", + "RxErrOtherCount", + "ActiveTimestamp", + "PendingTimestamp", + "delay", + "ChannelMask" + ], + "WiFi Network Diagnostics": [ + "bssid", + "SecurityType", + "WiFiVersion", + "ChannelNumber", + "Rssi", + "BeaconLostCount", + "BeaconRxCount", + "PacketMulticastRxCount", + "PacketMulticastTxCount", + "PacketUnicastRxCount", + "PacketUnicastTxCount", + "CurrentMaxRate", + "OverrunCount" + ] + }, + "defaultReportingPolicy": "mandatory", + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"] +} diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index b0ba63a2367863..e0c451a858b09d 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -1,6 +1,6 @@ { "version": "ZCL Test Data", - "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/", "./data-model/test"], + "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", @@ -38,7 +38,6 @@ "media-input-cluster.xml", "media-playback-cluster.xml", "mode-select-cluster.xml", - "mode-select-extensions.xml", "network-commissioning-cluster.xml", "onoff-cluster.xml", "operational-credentials-cluster.xml", diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2d43f79bb10072..1bf75324a9049b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -15740,7 +15740,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ClusterObjectFieldDescriptor(Label="manufacturerExtension", Tag=0xFFF10001, Type=typing.Optional[uint]), ]) description: 'str' = None @@ -15754,7 +15753,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: attributeList: 'typing.List[uint]' = None featureMap: 'uint' = None clusterRevision: 'uint' = None - manufacturerExtension: 'typing.Optional[uint]' = None class Structs: @@ -15804,19 +15802,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: newMode: 'uint' = 0 - @dataclass - class SampleMfgExtensionCommand(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x0050 - command_id: typing.ClassVar[int] = 0x0001 - is_client: typing.ClassVar[bool] = True - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields = [ - ]) - - class Attributes: @dataclass @@ -15995,22 +15980,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 - @dataclass - class ManufacturerExtension(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0050 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0xFFF10001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index ca1b53240a37de..1dd23133baa2a8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -9150,17 +9150,6 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ManufacturerExtension::Id: { - using TypeInfo = Attributes::ManufacturerExtension::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index 07282d91df8ab5..2827cafaef8d10 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -11040,9 +11040,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)changeToModeWithParams:(CHIPModeSelectClusterChangeToModeParams *)params completionHandler:(StatusCompletion)completionHandler; -- (void)sampleMfgExtensionCommandWithParams:(CHIPModeSelectClusterSampleMfgExtensionCommandParams * _Nullable)params - completionHandler:(StatusCompletion)completionHandler; -- (void)sampleMfgExtensionCommandWithCompletionHandler:(StatusCompletion)completionHandler; - (void)readAttributeDescriptionWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler; @@ -11245,25 +11242,6 @@ NS_ASSUME_NONNULL_BEGIN completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; -- (void)readAttributeManufacturerExtensionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler; -/** - * This API does not support setting autoResubscribe to NO in the - * CHIPSubscribeParams. - */ -- (void)subscribeAttributeManufacturerExtensionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler; -+ (void)readAttributeManufacturerExtensionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler; - @end /** diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 3896fd57a0f5fd..1f13f6795c8c53 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -41530,35 +41530,6 @@ new CHIPCommandSuccessCallbackBridge( }); } -- (void)sampleMfgExtensionCommandWithCompletionHandler:(StatusCompletion)completionHandler -{ - [self sampleMfgExtensionCommandWithParams:nil completionHandler:completionHandler]; -} -- (void)sampleMfgExtensionCommandWithParams:(CHIPModeSelectClusterSampleMfgExtensionCommandParams * _Nullable)params - completionHandler:(StatusCompletion)completionHandler -{ - chip::Optional timedInvokeTimeoutMs; - ListFreer listFreer; - ModeSelect::Commands::SampleMfgExtensionCommand::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - } - - new CHIPCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.InvokeCommand( - request, successFn->mContext, successFn->mCall, failureFn->mCall, timedInvokeTimeoutMs); - }); -} - - (void)readAttributeDescriptionWithCompletionHandler:(void (^)( NSString * _Nullable value, NSError * _Nullable error))completionHandler { @@ -42319,69 +42290,6 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s }); } -- (void)readAttributeManufacturerExtensionWithCompletionHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completionHandler -{ - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - -- (void)subscribeAttributeManufacturerExtensionWithMinInterval:(NSNumber * _Nonnull)minInterval - maxInterval:(NSNumber * _Nonnull)maxInterval - params:(CHIPSubscribeParams * _Nullable)params - subscriptionEstablished: - (SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - new CHIPInt8uAttributeCallbackSubscriptionBridge( - self.callbackQueue, reportHandler, - ^(Cancelable * success, Cancelable * failure) { - if (params != nil && params.autoResubscribe != nil && ![params.autoResubscribe boolValue]) { - // We don't support disabling auto-resubscribe. - return CHIP_ERROR_INVALID_ARGUMENT; - } - using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, - [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, - params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], - params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); - }, - subscriptionEstablishedHandler); -} - -+ (void)readAttributeManufacturerExtensionWithAttributeCache:(CHIPAttributeCacheContainer *)attributeCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completionHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - @end @implementation CHIPNetworkCommissioning diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h index 91e801398e820c..eaf1d61b7e1228 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.h @@ -3484,25 +3484,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; -- (instancetype)init; -@end -@interface CHIPModeSelectClusterSampleMfgExtensionCommandParams : NSObject -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (strong, nonatomic, nullable) NSNumber * timedInvokeTimeoutMs; - - (instancetype)init; @end @interface CHIPDoorLockClusterLockDoorParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm index 30b9e93e825050..5741b5c150d0e8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCommandPayloadsObjc.mm @@ -3197,22 +3197,6 @@ - (NSString *)description return descriptionString; } -@end -@implementation CHIPModeSelectClusterSampleMfgExtensionCommandParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - } - return self; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; -} - @end @implementation CHIPDoorLockClusterLockDoorParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h index 82e3276e148b35..87cf8a5f6fa778 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MatterClusterConstants.h @@ -848,7 +848,6 @@ typedef NS_ENUM(uint32_t, MatterClusterAttributeIDType) { kMatterClusterModeSelectAttributeAttributeListID = kMatterClusterGlobalAttributeAttributeListID, kMatterClusterModeSelectAttributeFeatureMapID = kMatterClusterGlobalAttributeFeatureMapID, kMatterClusterModeSelectAttributeClusterRevisionID = kMatterClusterGlobalAttributeClusterRevisionID, - kMatterClusterModeSelectAttributeManufacturerExtensionID = 0xFFF10001, // Cluster ShadeConfiguration attributes kMatterClusterShadeConfigurationAttributePhysicalClosedLimitID = 0x00000000, @@ -2271,7 +2270,6 @@ typedef NS_ENUM(uint32_t, MatterClusterCommandIDType) { // Cluster ModeSelect commands kMatterClusterModeSelectCommandChangeToModeID = 0x00000000, - kMatterClusterModeSelectCommandSampleMfgExtensionCommandID = 0x00 - EFFFF, // Cluster DoorLock commands kMatterClusterDoorLockCommandLockDoorID = 0x00000000, diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 75681c8af254d1..12cb42bab63ab0 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -376,7 +376,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 726 +#define GENERATED_ATTRIBUTE_COUNT 725 #define GENERATED_ATTRIBUTES \ { \ \ @@ -891,9 +891,8 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ - { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ - { 0xFFF10001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(255) }, /* ManufacturerExtension */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ + { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ { 0x00000004, ZAP_TYPE(INT8U), 1, \ @@ -2380,8 +2379,8 @@ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ .attributes = ZAP_ATTRIBUTE_INDEX(313), \ - .attributeCount = 9, \ - .clusterSize = 45, \ + .attributeCount = 8, \ + .clusterSize = 44, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayModeSelectServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 122 ) ,\ @@ -2390,7 +2389,7 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(322), \ + .attributes = ZAP_ATTRIBUTE_INDEX(321), \ .attributeCount = 33, \ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2401,7 +2400,7 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(355), \ + .attributes = ZAP_ATTRIBUTE_INDEX(354), \ .attributeCount = 24, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2412,7 +2411,7 @@ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(379), \ + .attributes = ZAP_ATTRIBUTE_INDEX(378), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2423,7 +2422,7 @@ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(385), \ + .attributes = ZAP_ATTRIBUTE_INDEX(384), \ .attributeCount = 25, \ .clusterSize = 52, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2434,7 +2433,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(410), \ + .attributes = ZAP_ATTRIBUTE_INDEX(409), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2445,7 +2444,7 @@ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(430), \ + .attributes = ZAP_ATTRIBUTE_INDEX(429), \ .attributeCount = 13, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2456,7 +2455,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(443), \ + .attributes = ZAP_ATTRIBUTE_INDEX(442), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2467,7 +2466,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(448), \ + .attributes = ZAP_ATTRIBUTE_INDEX(447), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2478,7 +2477,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(502), \ + .attributes = ZAP_ATTRIBUTE_INDEX(501), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2489,7 +2488,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(509), \ + .attributes = ZAP_ATTRIBUTE_INDEX(508), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2500,7 +2499,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(515), \ + .attributes = ZAP_ATTRIBUTE_INDEX(514), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2511,7 +2510,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(520), \ + .attributes = ZAP_ATTRIBUTE_INDEX(519), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2522,7 +2521,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(526), \ + .attributes = ZAP_ATTRIBUTE_INDEX(525), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2533,7 +2532,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(532), \ + .attributes = ZAP_ATTRIBUTE_INDEX(531), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2544,7 +2543,7 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(537), \ + .attributes = ZAP_ATTRIBUTE_INDEX(536), \ .attributeCount = 7, \ .clusterSize = 20, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ @@ -2555,7 +2554,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(544), \ + .attributes = ZAP_ATTRIBUTE_INDEX(543), \ .attributeCount = 3, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2566,7 +2565,7 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(547), \ + .attributes = ZAP_ATTRIBUTE_INDEX(546), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2577,7 +2576,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(550), \ + .attributes = ZAP_ATTRIBUTE_INDEX(549), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2588,7 +2587,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(554), \ + .attributes = ZAP_ATTRIBUTE_INDEX(553), \ .attributeCount = 8, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2599,7 +2598,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(562), \ + .attributes = ZAP_ATTRIBUTE_INDEX(561), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2610,7 +2609,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(566), \ + .attributes = ZAP_ATTRIBUTE_INDEX(565), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2621,7 +2620,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(568), \ + .attributes = ZAP_ATTRIBUTE_INDEX(567), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2632,7 +2631,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(570), \ + .attributes = ZAP_ATTRIBUTE_INDEX(569), \ .attributeCount = 4, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2643,7 +2642,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(574), \ + .attributes = ZAP_ATTRIBUTE_INDEX(573), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2654,7 +2653,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(578), \ + .attributes = ZAP_ATTRIBUTE_INDEX(577), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2665,7 +2664,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(581), \ + .attributes = ZAP_ATTRIBUTE_INDEX(580), \ .attributeCount = 9, \ .clusterSize = 110, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2676,7 +2675,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(590), \ + .attributes = ZAP_ATTRIBUTE_INDEX(589), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2687,7 +2686,7 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(592), \ + .attributes = ZAP_ATTRIBUTE_INDEX(591), \ .attributeCount = 82, \ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2698,7 +2697,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(674), \ + .attributes = ZAP_ATTRIBUTE_INDEX(673), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2709,7 +2708,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(687), \ + .attributes = ZAP_ATTRIBUTE_INDEX(686), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2720,7 +2719,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(690), \ + .attributes = ZAP_ATTRIBUTE_INDEX(689), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2731,7 +2730,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(697), \ + .attributes = ZAP_ATTRIBUTE_INDEX(696), \ .attributeCount = 6, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2742,7 +2741,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(703), \ + .attributes = ZAP_ATTRIBUTE_INDEX(702), \ .attributeCount = 8, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2753,7 +2752,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(711), \ + .attributes = ZAP_ATTRIBUTE_INDEX(710), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2764,7 +2763,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(716), \ + .attributes = ZAP_ATTRIBUTE_INDEX(715), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2783,7 +2782,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3483 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ + { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3482 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ { ZAP_CLUSTER_INDEX(77), 1, 0 }, \ } @@ -2796,7 +2795,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3943) +#define ATTRIBUTE_MAX_SIZE (3942) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h index 34681ebafeef7a..674ea17b437e66 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-id.h @@ -673,7 +673,6 @@ #define ZCL_CURRENT_MODE_ATTRIBUTE_ID (0x0003) #define ZCL_START_UP_MODE_ATTRIBUTE_ID (0x0004) #define ZCL_ON_MODE_ATTRIBUTE_ID (0x0005) -#define ZCL_MEI_EXTENSION_ATTRIBUTE_ID (0xFFF10001) // Attribute ids for cluster: Shade Configuration diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 5d98720b8b9bdf..8997ba86d35fe2 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -14056,37 +14056,6 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace ClusterRevision -namespace ManufacturerExtension { - -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - *value = Traits::StorageToWorking(temp); - return status; -} -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteServerAttribute(endpoint, Clusters::ModeSelect::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace ManufacturerExtension - } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index a5bcbf32022c5e..089500dd37f026 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -2489,11 +2489,6 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ClusterRevision -namespace ManufacturerExtension { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // int8u -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); -} // namespace ManufacturerExtension - } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 29a4898cb34729..20e4c5a0a2cb4a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -13169,12 +13169,6 @@ bool emberAfGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback( bool emberAfModeSelectClusterChangeToModeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ModeSelect::Commands::ChangeToMode::DecodableType & commandData); -/** - * @brief Mode Select Cluster SampleMfgExtensionCommand Command callback (from client) - */ -bool emberAfModeSelectClusterSampleMfgExtensionCommandCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ModeSelect::Commands::SampleMfgExtensionCommand::DecodableType & commandData); /** * @brief Door Lock Cluster LockDoor Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index fe554b3d604337..284a683877af59 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -12415,39 +12415,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ChangeToMode. -namespace SampleMfgExtensionCommand { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - ReturnErrorOnFailure(reader.EnterContainer(outer)); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - return CHIP_NO_ERROR; -} -} // namespace SampleMfgExtensionCommand. } // namespace Commands namespace Attributes { @@ -12488,9 +12455,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); break; - case Attributes::ManufacturerExtension::TypeInfo::GetAttributeId(): - ReturnErrorOnFailure(DataModel::Decode(reader, manufacturerExtension)); - break; default: break; } diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 50fe3c3ec52199..68343842a54cec 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -15695,11 +15695,6 @@ struct Type; struct DecodableType; } // namespace ChangeToMode -namespace SampleMfgExtensionCommand { -struct Type; -struct DecodableType; -} // namespace SampleMfgExtensionCommand - } // namespace Commands namespace Commands { @@ -15735,34 +15730,6 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ChangeToMode -namespace SampleMfgExtensionCommand { -enum class Fields -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::SampleMfgExtensionCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::SampleMfgExtensionCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace SampleMfgExtensionCommand } // namespace Commands namespace Attributes { @@ -15872,18 +15839,6 @@ struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInf static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } }; } // namespace ClusterRevision -namespace ManufacturerExtension { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ModeSelect::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ManufacturerExtension::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ManufacturerExtension struct TypeInfo { @@ -15902,9 +15857,8 @@ struct TypeInfo Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - Attributes::ManufacturerExtension::TypeInfo::DecodableType manufacturerExtension = static_cast(0); + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); }; }; } // namespace Attributes diff --git a/zzz_generated/app-common/app-common/zap-generated/command-id.h b/zzz_generated/app-common/app-common/zap-generated/command-id.h index 763331a9dc44fd..601c4dbc461b6a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/command-id.h +++ b/zzz_generated/app-common/app-common/zap-generated/command-id.h @@ -230,7 +230,6 @@ // Commands for cluster: Mode Select #define ZCL_CHANGE_TO_MODE_COMMAND_ID (0x00) -#define ZCL_SAMPLE_MFG_EXTENSION_COMMAND_COMMAND_ID (0x01) // Commands for cluster: Door Lock #define ZCL_LOCK_DOOR_COMMAND_ID (0x00) diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 944a328d2652e0..0e65c09b996e40 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -2724,10 +2724,6 @@ namespace ClusterRevision { static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace ClusterRevision -namespace ManufacturerExtension { -static constexpr AttributeId Id = 0xFFF10001; -} // namespace ManufacturerExtension - } // namespace Attributes } // namespace ModeSelect diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 38ce4a392744e7..44c41b9e76ace3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -770,10 +770,6 @@ namespace ChangeToMode { static constexpr CommandId Id = 0x00000000; } // namespace ChangeToMode -namespace SampleMfgExtensionCommand { -static constexpr CommandId Id = 0x00 - EFFFF; -} // namespace SampleMfgExtensionCommand - } // namespace Commands } // namespace ModeSelect diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 10c8ab0a14ad79..680e20f7a8660e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -7160,7 +7160,6 @@ class WriteUserLabelLabelList : public WriteAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * SampleMfgExtensionCommand | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -7174,7 +7173,6 @@ class WriteUserLabelLabelList : public WriteAttribute | * AttributeList | 0xFFFB | | * FeatureMap | 0xFFFC | | * ClusterRevision | 0xFFFD | -| * ManufacturerExtension | 0xFFF10001| |------------------------------------------------------------------------------| | Events: | | \*----------------------------------------------------------------------------*/ @@ -7209,36 +7207,6 @@ class ModeSelectChangeToMode : public ClusterCommand chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; -/* - * Command SampleMfgExtensionCommand - */ -class ModeSelectSampleMfgExtensionCommand : public ClusterCommand -{ -public: - ModeSelectSampleMfgExtensionCommand(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("sample-mfg-extension-command", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointIds.at(0)); - - return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000050, 0x00000001, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on Group %u", groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000050, 0x00000001, mRequest); - } - -private: - chip::app::Clusters::ModeSelect::Commands::SampleMfgExtensionCommand::Type mRequest; -}; - class WriteModeSelectStartUpMode : public WriteAttribute { public: @@ -21376,41 +21344,38 @@ void registerClusterModeSelect(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // - make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique(Id, "manufacturer-extension", Attributes::ManufacturerExtension::Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // - make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // - make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // - make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // - make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique(Id, "manufacturer-extension", Attributes::ManufacturerExtension::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // + make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // + make_unique(Id, "standard-namespace", Attributes::StandardNamespace::Id, credsIssuerConfig), // + make_unique(Id, "supported-modes", Attributes::SupportedModes::Id, credsIssuerConfig), // + make_unique(Id, "current-mode", Attributes::CurrentMode::Id, credsIssuerConfig), // + make_unique(Id, "start-up-mode", Attributes::StartUpMode::Id, credsIssuerConfig), // + make_unique(Id, "on-mode", Attributes::OnMode::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // // // Events // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 9105bb53000332..c2ae86dcf733a3 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -7300,11 +7300,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ClusterRevision", 1, value); } - case ModeSelect::Attributes::ManufacturerExtension::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ManufacturerExtension", 1, value); - } } break; } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h index 93bba6f75caee1..6b499b60008112 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.h @@ -922,8 +922,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)writeAttributeAttributeListWithValue:(NSArray * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeFeatureMapWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; - (void)writeAttributeClusterRevisionWithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler; -- (void)writeAttributeManufacturerExtensionWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler; @end diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm index 2d0ecbb8ea01c6..e685dbe0682138 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/CHIPTestClustersObjc.mm @@ -12531,25 +12531,6 @@ new CHIPDefaultSuccessCallbackBridge( }); } -- (void)writeAttributeManufacturerExtensionWithValue:(NSNumber * _Nonnull)value - completionHandler:(StatusCompletion)completionHandler -{ - new CHIPDefaultSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable ignored, NSError * _Nullable error) { - completionHandler(error); - }, - ^(Cancelable * success, Cancelable * failure) { - ListFreer listFreer; - using TypeInfo = ModeSelect::Attributes::ManufacturerExtension::TypeInfo; - TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); - }); -} - @end @interface CHIPTestNetworkCommissioning () diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 1a47fc086101c1..0368d72f306715 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -49158,7 +49158,6 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute |------------------------------------------------------------------------------| | Commands: | | | * ChangeToMode | 0x00 | -| * SampleMfgExtensionCommand | 0x01 | |------------------------------------------------------------------------------| | Attributes: | | | * Description | 0x0000 | @@ -49172,7 +49171,6 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute | * AttributeList | 0xFFFB | | * FeatureMap | 0xFFFC | | * ClusterRevision | 0xFFFD | -| * ManufacturerExtension | 0xFFF10001| |------------------------------------------------------------------------------| | Events: | | \*----------------------------------------------------------------------------*/ @@ -49221,46 +49219,6 @@ class ModeSelectChangeToMode : public ClusterCommand { chip::app::Clusters::ModeSelect::Commands::ChangeToMode::Type mRequest; }; -/* - * Command SampleMfgExtensionCommand - */ -class ModeSelectSampleMfgExtensionCommand : public ClusterCommand { -public: - ModeSelectSampleMfgExtensionCommand() - : ClusterCommand("sample-mfg-extension-command") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) command (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - __auto_type * params = [[CHIPModeSelectClusterSampleMfgExtensionCommandParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster sampleMfgExtensionCommandWithCompletionHandler:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: -}; - /* * Attribute Description */ @@ -50076,74 +50034,6 @@ class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { } }; -/* - * Attribute ManufacturerExtension - */ -class ReadModeSelectManufacturerExtension : public ReadAttribute { -public: - ReadModeSelectManufacturerExtension() - : ReadAttribute("manufacturer-extension") - { - } - - ~ReadModeSelectManufacturerExtension() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReadAttribute (0xFFF10001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - [cluster readAttributeManufacturerExtensionWithCompletionHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.ManufacturerExtension response %@", [value description]); - if (error != nil) { - LogNSError("ModeSelect ManufacturerExtension read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeModeSelectManufacturerExtension : public SubscribeAttribute { -public: - SubscribeAttributeModeSelectManufacturerExtension() - : SubscribeAttribute("manufacturer-extension") - { - } - - ~SubscribeAttributeModeSelectManufacturerExtension() {} - - CHIP_ERROR SendCommand(CHIPDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000050) ReportAttribute (0xFFF10001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - CHIPModeSelect * cluster = [[CHIPModeSelect alloc] initWithDevice:device endpoint:endpointId queue:callbackQueue]; - CHIPSubscribeParams * params = [[CHIPSubscribeParams alloc] init]; - params.keepPreviousSubscriptions - = mKeepSubscriptions.HasValue() ? [NSNumber numberWithBool:mKeepSubscriptions.Value()] : nil; - params.fabricFiltered = mFabricFiltered.HasValue() ? [NSNumber numberWithBool:mFabricFiltered.Value()] : nil; - [cluster subscribeAttributeManufacturerExtensionWithMinInterval:[NSNumber numberWithUnsignedInt:mMinInterval] - maxInterval:[NSNumber numberWithUnsignedInt:mMaxInterval] - params:params - subscriptionEstablished:nullptr - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ModeSelect.ManufacturerExtension response %@", - [value description]); - if (error || !mWait) { - SetCommandExitStatus(error); - } - }]; - - return CHIP_NO_ERROR; - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mWait ? UINT16_MAX : 10); - } -}; - /*----------------------------------------------------------------------------*\ | Cluster NetworkCommissioning | 0x0031 | |------------------------------------------------------------------------------| @@ -97108,7 +96998,6 @@ void registerClusterModeSelect(Commands & commands) commands_list clusterCommands = { make_unique(Id), // make_unique(), // - make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // @@ -97136,8 +97025,6 @@ void registerClusterModeSelect(Commands & commands) make_unique(), // make_unique(), // make_unique(), // - make_unique(), // - make_unique(), // }; commands.Register(clusterName, clusterCommands); From a32c3ae58b1a967575bfe158e1d8ce871ecbf398 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 12:04:03 -0400 Subject: [PATCH 07/20] Detect zcl path from zap file during generation --- .../all-clusters-app.matter | 2 + scripts/tools/zap/generate.py | 31 ++++++- .../zap-generated/endpoint_config.h | 85 ++++++++++--------- 3 files changed, 72 insertions(+), 46 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 184121fda55581..4d00cbf7abd2e3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2170,6 +2170,7 @@ server cluster ModeSelect = 80 { readonly attribute attrib_id attributeList[] = 65531; readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; + readonly attribute int8u manufacturerExtension = 4293984257; request struct ChangeToModeRequest { INT8U newMode = 0; @@ -4324,6 +4325,7 @@ endpoint 1 { callback attribute attributeList; ram attribute featureMap default = 1; ram attribute clusterRevision default = 1; + ram attribute manufacturerExtension default = 255; } server cluster DoorLock { diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index 6d6b0848e3d1ed..4fa35f69aa67bc 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -57,10 +57,27 @@ def getDirPath(name): checkDirExists(fullpath) return fullpath +def detectZclFile(zapFile): + # FIXME: implement + print(f"Searching for zcl file from {zapFile}") + + path = 'src/app/zap-templates/zcl/zcl.json' + + data = json.load(open(zapFile)) + for package in data["package"]: + if package["type"] != "zcl-properties": + continue + + # found the right path, try to figure out the actual path + if package["pathRelativity"] == "relativeToZap": + path = os.path.abspath(os.path.join(os.path.dirname(zapFile), package["path"])) + else: + path = package["path"] + + return getFilePath(path) def runArgumentsParser(): default_templates = 'src/app/zap-templates/app-templates.json' - default_zcl = 'src/app/zap-templates/zcl/zcl.json' default_output_dir = 'zap-generated/' parser = argparse.ArgumentParser( @@ -68,12 +85,13 @@ def runArgumentsParser(): parser.add_argument('zap', help='Path to the application .zap file') parser.add_argument('-t', '--templates', default=default_templates, help='Path to the .zapt templates records to use for generating artifacts (default: "' + default_templates + '")') - parser.add_argument('-z', '--zcl', default=default_zcl, - help='Path to the zcl templates records to use for generating artifacts (default: "' + default_zcl + '")') + parser.add_argument('-z', '--zcl', + help='Path to the zcl templates records to use for generating artifacts (default: autodetect read from zap file)') parser.add_argument('-o', '--output-dir', default=None, help='Output directory for the generated files (default: automatically selected)') args = parser.parse_args() + # By default, this script assumes that the global CHIP template is used with # a default 'zap-generated/' output folder relative to APP_ROOT_DIR. # If needed, the user may specify a specific template as a second argument. In @@ -86,7 +104,12 @@ def runArgumentsParser(): output_dir = '' zap_file = getFilePath(args.zap) - zcl_file = getFilePath(args.zcl) + + if args.zcl: + zcl_file = getFilePath(args.zcl) + else: + zcl_file = detectZclFile(zap_file) + templates_file = getFilePath(args.templates) output_dir = getDirPath(output_dir) diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 12cb42bab63ab0..75681c8af254d1 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -376,7 +376,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 725 +#define GENERATED_ATTRIBUTE_COUNT 726 #define GENERATED_ATTRIBUTES \ { \ \ @@ -891,8 +891,9 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ - { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_LONG_DEFAULTS_INDEX(20) }, /* Description */ \ + { 0x00000001, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(NULLABLE), ZAP_SIMPLE_DEFAULT(0) }, /* StandardNamespace */ \ + { 0xFFF10001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(255) }, /* ManufacturerExtension */ \ { 0x00000002, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* SupportedModes */ \ { 0x00000003, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(TOKENIZE), ZAP_SIMPLE_DEFAULT(0) }, /* CurrentMode */ \ { 0x00000004, ZAP_TYPE(INT8U), 1, \ @@ -2379,8 +2380,8 @@ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ .attributes = ZAP_ATTRIBUTE_INDEX(313), \ - .attributeCount = 8, \ - .clusterSize = 44, \ + .attributeCount = 9, \ + .clusterSize = 45, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayModeSelectServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 122 ) ,\ @@ -2389,7 +2390,7 @@ { \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ .clusterId = 0x00000101, \ - .attributes = ZAP_ATTRIBUTE_INDEX(321), \ + .attributes = ZAP_ATTRIBUTE_INDEX(322), \ .attributeCount = 33, \ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2400,7 +2401,7 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(354), \ + .attributes = ZAP_ATTRIBUTE_INDEX(355), \ .attributeCount = 24, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2411,7 +2412,7 @@ { \ /* Endpoint: 1, Cluster: Barrier Control (server) */ \ .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(378), \ + .attributes = ZAP_ATTRIBUTE_INDEX(379), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2422,7 +2423,7 @@ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(384), \ + .attributes = ZAP_ATTRIBUTE_INDEX(385), \ .attributeCount = 25, \ .clusterSize = 52, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2433,7 +2434,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(409), \ + .attributes = ZAP_ATTRIBUTE_INDEX(410), \ .attributeCount = 20, \ .clusterSize = 35, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2444,7 +2445,7 @@ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(429), \ + .attributes = ZAP_ATTRIBUTE_INDEX(430), \ .attributeCount = 13, \ .clusterSize = 17, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2455,7 +2456,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(442), \ + .attributes = ZAP_ATTRIBUTE_INDEX(443), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -2466,7 +2467,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(447), \ + .attributes = ZAP_ATTRIBUTE_INDEX(448), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2477,7 +2478,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(501), \ + .attributes = ZAP_ATTRIBUTE_INDEX(502), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2488,7 +2489,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(508), \ + .attributes = ZAP_ATTRIBUTE_INDEX(509), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2499,7 +2500,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(514), \ + .attributes = ZAP_ATTRIBUTE_INDEX(515), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2510,7 +2511,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(519), \ + .attributes = ZAP_ATTRIBUTE_INDEX(520), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2521,7 +2522,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(525), \ + .attributes = ZAP_ATTRIBUTE_INDEX(526), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2532,7 +2533,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(531), \ + .attributes = ZAP_ATTRIBUTE_INDEX(532), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2543,7 +2544,7 @@ { \ /* Endpoint: 1, Cluster: IAS Zone (server) */ \ .clusterId = 0x00000500, \ - .attributes = ZAP_ATTRIBUTE_INDEX(536), \ + .attributes = ZAP_ATTRIBUTE_INDEX(537), \ .attributeCount = 7, \ .clusterSize = 20, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ @@ -2554,7 +2555,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(543), \ + .attributes = ZAP_ATTRIBUTE_INDEX(544), \ .attributeCount = 3, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2565,7 +2566,7 @@ { \ /* Endpoint: 1, Cluster: Channel (server) */ \ .clusterId = 0x00000504, \ - .attributes = ZAP_ATTRIBUTE_INDEX(546), \ + .attributes = ZAP_ATTRIBUTE_INDEX(547), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2576,7 +2577,7 @@ { \ /* Endpoint: 1, Cluster: Target Navigator (server) */ \ .clusterId = 0x00000505, \ - .attributes = ZAP_ATTRIBUTE_INDEX(549), \ + .attributes = ZAP_ATTRIBUTE_INDEX(550), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2587,7 +2588,7 @@ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ .clusterId = 0x00000506, \ - .attributes = ZAP_ATTRIBUTE_INDEX(553), \ + .attributes = ZAP_ATTRIBUTE_INDEX(554), \ .attributeCount = 8, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2598,7 +2599,7 @@ { \ /* Endpoint: 1, Cluster: Media Input (server) */ \ .clusterId = 0x00000507, \ - .attributes = ZAP_ATTRIBUTE_INDEX(561), \ + .attributes = ZAP_ATTRIBUTE_INDEX(562), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2609,7 +2610,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(565), \ + .attributes = ZAP_ATTRIBUTE_INDEX(566), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2620,7 +2621,7 @@ { \ /* Endpoint: 1, Cluster: Keypad Input (server) */ \ .clusterId = 0x00000509, \ - .attributes = ZAP_ATTRIBUTE_INDEX(567), \ + .attributes = ZAP_ATTRIBUTE_INDEX(568), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2631,7 +2632,7 @@ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ .clusterId = 0x0000050A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(569), \ + .attributes = ZAP_ATTRIBUTE_INDEX(570), \ .attributeCount = 4, \ .clusterSize = 10, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2642,7 +2643,7 @@ { \ /* Endpoint: 1, Cluster: Audio Output (server) */ \ .clusterId = 0x0000050B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(573), \ + .attributes = ZAP_ATTRIBUTE_INDEX(574), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2653,7 +2654,7 @@ { \ /* Endpoint: 1, Cluster: Application Launcher (server) */ \ .clusterId = 0x0000050C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(577), \ + .attributes = ZAP_ATTRIBUTE_INDEX(578), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2664,7 +2665,7 @@ { \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(580), \ + .attributes = ZAP_ATTRIBUTE_INDEX(581), \ .attributeCount = 9, \ .clusterSize = 110, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2675,7 +2676,7 @@ { \ /* Endpoint: 1, Cluster: Account Login (server) */ \ .clusterId = 0x0000050E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(589), \ + .attributes = ZAP_ATTRIBUTE_INDEX(590), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2686,7 +2687,7 @@ { \ /* Endpoint: 1, Cluster: Test Cluster (server) */ \ .clusterId = 0x0000050F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(591), \ + .attributes = ZAP_ATTRIBUTE_INDEX(592), \ .attributeCount = 82, \ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2697,7 +2698,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(673), \ + .attributes = ZAP_ATTRIBUTE_INDEX(674), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2708,7 +2709,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(686), \ + .attributes = ZAP_ATTRIBUTE_INDEX(687), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2719,7 +2720,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(689), \ + .attributes = ZAP_ATTRIBUTE_INDEX(690), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2730,7 +2731,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(696), \ + .attributes = ZAP_ATTRIBUTE_INDEX(697), \ .attributeCount = 6, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2741,7 +2742,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(702), \ + .attributes = ZAP_ATTRIBUTE_INDEX(703), \ .attributeCount = 8, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2752,7 +2753,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(710), \ + .attributes = ZAP_ATTRIBUTE_INDEX(711), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -2763,7 +2764,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(715), \ + .attributes = ZAP_ATTRIBUTE_INDEX(716), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -2782,7 +2783,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3482 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ + { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 45, 3483 }, { ZAP_CLUSTER_INDEX(72), 5, 105 }, \ { ZAP_CLUSTER_INDEX(77), 1, 0 }, \ } @@ -2795,7 +2796,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (37) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3942) +#define ATTRIBUTE_MAX_SIZE (3943) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) From 9e8d7a9d8ade295ff0e4cfc422f11e5dd372e2d7 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 13:13:04 -0400 Subject: [PATCH 08/20] Slight update with comment update --- .../zcl/data-model/test/mode-select-extensions.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml index f4b04ad15e924a..8fb50f637ff733 100644 --- a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml @@ -16,6 +16,7 @@ limitations under the License. --> + ManufacturerExtension - + Sample manufacturer specific extension command From e02b4d671020a57564c1f10530982e37527f0f1d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 13:18:14 -0400 Subject: [PATCH 09/20] Update code to generate MEI command --- .../all-clusters-app.matter | 1 + .../test/mode-select-extensions.xml | 2 +- .../zap-generated/IMClusterCommandHandler.cpp | 9 +++ .../zap-generated/endpoint_config.h | 77 ++++++++++--------- 4 files changed, 50 insertions(+), 39 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 4d00cbf7abd2e3..a2f227ec71dce8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2177,6 +2177,7 @@ server cluster ModeSelect = 80 { } command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; + command SampleMfgExtensionCommand(): DefaultSuccess = 4293984257; } server cluster NetworkCommissioning = 49 { diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml index 8fb50f637ff733..2955460807b116 100644 --- a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml @@ -24,7 +24,7 @@ limitations under the License. - Suffix: 0x0001 - Non-global attribute id --> ManufacturerExtension - + Sample manufacturer specific extension command diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index f3d4288c81e781..cc0db6298a5385 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -1151,6 +1151,15 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } + case Commands::SampleMfgExtensionCommand::Id: { + Commands::SampleMfgExtensionCommand::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAfModeSelectClusterSampleMfgExtensionCommandCallback(apCommandObj, aCommandPath, commandData); + } + break; + } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index 75681c8af254d1..f6ad395a2e1ff3 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1747,9 +1747,10 @@ /* Endpoint: 1, Cluster: Mode Select (server) */\ /* AcceptedCommandList (index=122) */ \ 0x00000000 /* ChangeToMode */, \ + 0xFFF10001 /* SampleMfgExtensionCommand */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Door Lock (server) */\ - /* AcceptedCommandList (index=124) */ \ + /* AcceptedCommandList (index=125) */ \ 0x00000000 /* LockDoor */, \ 0x00000001 /* UnlockDoor */, \ 0x00000003 /* UnlockWithTimeout */, \ @@ -1765,7 +1766,7 @@ 0x00000024 /* GetCredentialStatus */, \ 0x00000026 /* ClearCredential */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=139)*/ \ + /* GeneratedCommandList (index=140)*/ \ 0x0000000C /* GetWeekDayScheduleResponse */, \ 0x0000000F /* GetYearDayScheduleResponse */, \ 0x0000001C /* GetUserResponse */, \ @@ -1773,7 +1774,7 @@ 0x00000025 /* GetCredentialStatusResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Window Covering (server) */\ - /* AcceptedCommandList (index=145) */ \ + /* AcceptedCommandList (index=146) */ \ 0x00000000 /* UpOrOpen */, \ 0x00000001 /* DownOrClose */, \ 0x00000002 /* StopMotion */, \ @@ -1783,12 +1784,12 @@ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Barrier Control (server) */\ - /* AcceptedCommandList (index=153) */ \ + /* AcceptedCommandList (index=154) */ \ 0x00000000 /* BarrierControlGoToPercent */, \ 0x00000001 /* BarrierControlStop */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Color Control (server) */\ - /* AcceptedCommandList (index=156) */ \ + /* AcceptedCommandList (index=157) */ \ 0x00000000 /* MoveToHue */, \ 0x00000001 /* MoveHue */, \ 0x00000002 /* StepHue */, \ @@ -1810,36 +1811,36 @@ 0x0000004C /* StepColorTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: IAS Zone (server) */\ - /* AcceptedCommandList (index=176) */ \ + /* AcceptedCommandList (index=177) */ \ 0x00000000 /* ZoneEnrollResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Target Navigator (server) */\ - /* AcceptedCommandList (index=178) */ \ + /* AcceptedCommandList (index=179) */ \ 0x00000000 /* NavigateTarget */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=180)*/ \ + /* GeneratedCommandList (index=181)*/ \ 0x00000001 /* NavigateTargetResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Media Input (server) */\ - /* AcceptedCommandList (index=182) */ \ + /* AcceptedCommandList (index=183) */ \ 0x00000000 /* SelectInput */, \ 0x00000001 /* ShowInputStatus */, \ 0x00000002 /* HideInputStatus */, \ 0x00000003 /* RenameInput */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Low Power (server) */\ - /* AcceptedCommandList (index=187) */ \ + /* AcceptedCommandList (index=188) */ \ 0x00000000 /* Sleep */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Keypad Input (server) */\ - /* AcceptedCommandList (index=189) */ \ + /* AcceptedCommandList (index=190) */ \ 0x00000000 /* SendKey */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=191)*/ \ + /* GeneratedCommandList (index=192)*/ \ 0x00000001 /* SendKeyResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Test Cluster (server) */\ - /* AcceptedCommandList (index=193) */ \ + /* AcceptedCommandList (index=194) */ \ 0x00000000 /* Test */, \ 0x00000001 /* TestNotHandled */, \ 0x00000002 /* TestSpecific */, \ @@ -1859,7 +1860,7 @@ 0x00000014 /* TestEmitTestEventRequest */, \ 0x00000015 /* TestEmitTestFabricScopedEventRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=212)*/ \ + /* GeneratedCommandList (index=213)*/ \ 0x00000000 /* TestSpecificResponse */, \ 0x00000001 /* TestAddArgumentsResponse */, \ 0x00000004 /* TestListInt8UReverseResponse */, \ @@ -1871,7 +1872,7 @@ 0x0000000B /* TestEmitTestFabricScopedEventResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=222) */ \ + /* AcceptedCommandList (index=223) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -1879,20 +1880,20 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=229)*/ \ + /* GeneratedCommandList (index=230)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=234) */ \ + /* AcceptedCommandList (index=235) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=238) */ \ + /* AcceptedCommandList (index=239) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -1900,7 +1901,7 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=245)*/ \ + /* GeneratedCommandList (index=246)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ @@ -2395,8 +2396,8 @@ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 124 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 139 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ @@ -2406,7 +2407,7 @@ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 145 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2417,7 +2418,7 @@ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 154 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2472,7 +2473,7 @@ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2549,7 +2550,7 @@ .clusterSize = 20, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 176 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 177 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2582,8 +2583,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 178 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 180 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 181 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ @@ -2604,7 +2605,7 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 183 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2615,7 +2616,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 188 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2626,8 +2627,8 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 189 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ @@ -2692,8 +2693,8 @@ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 193 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 212 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 194 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 213 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ @@ -2714,8 +2715,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 222 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 229 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 230 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ @@ -2725,7 +2726,7 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 234 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2769,8 +2770,8 @@ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 239 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 246 ) ,\ },\ } From 7c906bc0681815e48c04e6515dc1663089bc2871 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 13:18:33 -0400 Subject: [PATCH 10/20] Update comment --- .../zcl/data-model/test/mode-select-extensions.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml index 2955460807b116..c10c691c357481 100644 --- a/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml +++ b/src/app/zap-templates/zcl/data-model/test/mode-select-extensions.xml @@ -24,6 +24,12 @@ limitations under the License. - Suffix: 0x0001 - Non-global attribute id --> ManufacturerExtension + + Sample manufacturer specific extension command From 35c4fe9b09584594040ef6b8ed537d65da2d6dd4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 13:30:04 -0400 Subject: [PATCH 11/20] Remove custom command - all clusters fails to compile with that. unsure why however assuming constants generated separately in different codegen paths --- .../all-clusters-app.matter | 1 - .../all-clusters-common/all-clusters-app.zap | 8 -- .../zap-generated/IMClusterCommandHandler.cpp | 9 --- .../zap-generated/endpoint_config.h | 77 +++++++++---------- 4 files changed, 38 insertions(+), 57 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index a2f227ec71dce8..4d00cbf7abd2e3 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2177,7 +2177,6 @@ server cluster ModeSelect = 80 { } command ChangeToMode(ChangeToModeRequest): DefaultSuccess = 0; - command SampleMfgExtensionCommand(): DefaultSuccess = 4293984257; } server cluster NetworkCommissioning = 49 { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 63b3a49cd70fe5..3fad9b3f49b164 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12459,14 +12459,6 @@ "source": "client", "incoming": 1, "outgoing": 1 - }, - { - "name": "SampleMfgExtensionCommand", - "code": 4293984257, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 } ], "attributes": [ diff --git a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp index cc0db6298a5385..f3d4288c81e781 100644 --- a/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp +++ b/zzz_generated/all-clusters-app/zap-generated/IMClusterCommandHandler.cpp @@ -1151,15 +1151,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } break; } - case Commands::SampleMfgExtensionCommand::Id: { - Commands::SampleMfgExtensionCommand::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfModeSelectClusterSampleMfgExtensionCommandCallback(apCommandObj, aCommandPath, commandData); - } - break; - } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); diff --git a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h index f6ad395a2e1ff3..75681c8af254d1 100644 --- a/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h +++ b/zzz_generated/all-clusters-app/zap-generated/endpoint_config.h @@ -1747,10 +1747,9 @@ /* Endpoint: 1, Cluster: Mode Select (server) */\ /* AcceptedCommandList (index=122) */ \ 0x00000000 /* ChangeToMode */, \ - 0xFFF10001 /* SampleMfgExtensionCommand */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Door Lock (server) */\ - /* AcceptedCommandList (index=125) */ \ + /* AcceptedCommandList (index=124) */ \ 0x00000000 /* LockDoor */, \ 0x00000001 /* UnlockDoor */, \ 0x00000003 /* UnlockWithTimeout */, \ @@ -1766,7 +1765,7 @@ 0x00000024 /* GetCredentialStatus */, \ 0x00000026 /* ClearCredential */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=140)*/ \ + /* GeneratedCommandList (index=139)*/ \ 0x0000000C /* GetWeekDayScheduleResponse */, \ 0x0000000F /* GetYearDayScheduleResponse */, \ 0x0000001C /* GetUserResponse */, \ @@ -1774,7 +1773,7 @@ 0x00000025 /* GetCredentialStatusResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Window Covering (server) */\ - /* AcceptedCommandList (index=146) */ \ + /* AcceptedCommandList (index=145) */ \ 0x00000000 /* UpOrOpen */, \ 0x00000001 /* DownOrClose */, \ 0x00000002 /* StopMotion */, \ @@ -1784,12 +1783,12 @@ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Barrier Control (server) */\ - /* AcceptedCommandList (index=154) */ \ + /* AcceptedCommandList (index=153) */ \ 0x00000000 /* BarrierControlGoToPercent */, \ 0x00000001 /* BarrierControlStop */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Color Control (server) */\ - /* AcceptedCommandList (index=157) */ \ + /* AcceptedCommandList (index=156) */ \ 0x00000000 /* MoveToHue */, \ 0x00000001 /* MoveHue */, \ 0x00000002 /* StepHue */, \ @@ -1811,36 +1810,36 @@ 0x0000004C /* StepColorTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: IAS Zone (server) */\ - /* AcceptedCommandList (index=177) */ \ + /* AcceptedCommandList (index=176) */ \ 0x00000000 /* ZoneEnrollResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Target Navigator (server) */\ - /* AcceptedCommandList (index=179) */ \ + /* AcceptedCommandList (index=178) */ \ 0x00000000 /* NavigateTarget */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=181)*/ \ + /* GeneratedCommandList (index=180)*/ \ 0x00000001 /* NavigateTargetResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Media Input (server) */\ - /* AcceptedCommandList (index=183) */ \ + /* AcceptedCommandList (index=182) */ \ 0x00000000 /* SelectInput */, \ 0x00000001 /* ShowInputStatus */, \ 0x00000002 /* HideInputStatus */, \ 0x00000003 /* RenameInput */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Low Power (server) */\ - /* AcceptedCommandList (index=188) */ \ + /* AcceptedCommandList (index=187) */ \ 0x00000000 /* Sleep */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Keypad Input (server) */\ - /* AcceptedCommandList (index=190) */ \ + /* AcceptedCommandList (index=189) */ \ 0x00000000 /* SendKey */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=192)*/ \ + /* GeneratedCommandList (index=191)*/ \ 0x00000001 /* SendKeyResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Test Cluster (server) */\ - /* AcceptedCommandList (index=194) */ \ + /* AcceptedCommandList (index=193) */ \ 0x00000000 /* Test */, \ 0x00000001 /* TestNotHandled */, \ 0x00000002 /* TestSpecific */, \ @@ -1860,7 +1859,7 @@ 0x00000014 /* TestEmitTestEventRequest */, \ 0x00000015 /* TestEmitTestFabricScopedEventRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=213)*/ \ + /* GeneratedCommandList (index=212)*/ \ 0x00000000 /* TestSpecificResponse */, \ 0x00000001 /* TestAddArgumentsResponse */, \ 0x00000004 /* TestListInt8UReverseResponse */, \ @@ -1872,7 +1871,7 @@ 0x0000000B /* TestEmitTestFabricScopedEventResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=223) */ \ + /* AcceptedCommandList (index=222) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -1880,20 +1879,20 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=230)*/ \ + /* GeneratedCommandList (index=229)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=235) */ \ + /* AcceptedCommandList (index=234) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=239) */ \ + /* AcceptedCommandList (index=238) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -1901,7 +1900,7 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=246)*/ \ + /* GeneratedCommandList (index=245)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ @@ -2396,8 +2395,8 @@ .clusterSize = 55, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayDoorLockServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 125 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 140 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 124 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 139 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ @@ -2407,7 +2406,7 @@ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayWindowCoveringServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 146 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 145 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2418,7 +2417,7 @@ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 154 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 153 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2473,7 +2472,7 @@ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 157 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 156 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2550,7 +2549,7 @@ .clusterSize = 20, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ .functions = chipFuncArrayIasZoneServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 177 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 176 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2583,8 +2582,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 179 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 181 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 178 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 180 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Media Playback (server) */ \ @@ -2605,7 +2604,7 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 183 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 182 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2616,7 +2615,7 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 188 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 187 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2627,8 +2626,8 @@ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 190 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 192 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 189 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 191 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Content Launcher (server) */ \ @@ -2693,8 +2692,8 @@ .clusterSize = 2289, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 194 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 213 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 193 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 212 ) ,\ },\ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ @@ -2715,8 +2714,8 @@ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 223 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 230 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 222 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 229 ) ,\ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ @@ -2726,7 +2725,7 @@ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 234 ) ,\ .generatedCommandList = nullptr ,\ },\ { \ @@ -2770,8 +2769,8 @@ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 239 ) ,\ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 246 ) ,\ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ) ,\ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ) ,\ },\ } From a565dc167bd97c72f93788ae89b77b04fc2854e4 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 7 Jun 2022 13:31:52 -0400 Subject: [PATCH 12/20] Restyle --- scripts/tools/zap/generate.py | 3 ++- src/app/zap-templates/zcl/zcl-with-test-extensions.json | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index 4fa35f69aa67bc..0116ff870246d6 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -57,6 +57,7 @@ def getDirPath(name): checkDirExists(fullpath) return fullpath + def detectZclFile(zapFile): # FIXME: implement print(f"Searching for zcl file from {zapFile}") @@ -76,6 +77,7 @@ def detectZclFile(zapFile): return getFilePath(path) + def runArgumentsParser(): default_templates = 'src/app/zap-templates/app-templates.json' default_output_dir = 'zap-generated/' @@ -91,7 +93,6 @@ def runArgumentsParser(): help='Output directory for the generated files (default: automatically selected)') args = parser.parse_args() - # By default, this script assumes that the global CHIP template is used with # a default 'zap-generated/' output folder relative to APP_ROOT_DIR. # If needed, the user may specify a specific template as a second argument. In diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index b0ba63a2367863..d99dcd82e89bab 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -1,6 +1,11 @@ { "version": "ZCL Test Data", - "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/", "./data-model/test"], + "xmlRoot": [ + ".", + "./data-model/chip/", + "./data-model/silabs/", + "./data-model/test" + ], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", From adbeb62a0828690ac2f07330cbb8642da3facc1e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 10:44:01 -0400 Subject: [PATCH 13/20] Make run_zaptool.sh be able to use test extensions for all clusters app --- scripts/tools/zap/run_zaptool.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/tools/zap/run_zaptool.sh b/scripts/tools/zap/run_zaptool.sh index c219a6cc560339..39cbed10554d9f 100755 --- a/scripts/tools/zap/run_zaptool.sh +++ b/scripts/tools/zap/run_zaptool.sh @@ -45,9 +45,16 @@ CHIP_ROOT="${SCRIPT_PATH%/scripts/tools/zap/run_zaptool.sh}" npm install fi + echo "ARGS: ${ZAP_ARGS[@]}" + + if [[ "${ZAP_ARGS[@]}" == *"all-clusters-app.zap"* ]]; then + ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl-with-test-extensions.json" + else + ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl.json" + fi + node src-script/zap-start.js --logToStdout \ --gen "$CHIP_ROOT/src/app/zap-templates/app-templates.json" \ - --zcl "$CHIP_ROOT/src/app/zap-templates/zcl/zcl.json" \ + --zcl "$ZCL_FILE" \ "${ZAP_ARGS[@]}" - ) From 98b24521a29c94c52a66758e496cf0ea027195f0 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 10:46:41 -0400 Subject: [PATCH 14/20] add zcl file detection for convert.py as well --- scripts/tools/zap/convert.py | 19 ++++++++++++++++++- scripts/tools/zap/generate.py | 1 - 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/tools/zap/convert.py b/scripts/tools/zap/convert.py index 143bd104d91ea1..cf60495a262d06 100755 --- a/scripts/tools/zap/convert.py +++ b/scripts/tools/zap/convert.py @@ -65,10 +65,27 @@ def runArgumentsParser(): return zap_file +def detectZclFile(zapFile): + print(f"Searching for zcl file from {zapFile}") + + path = 'src/app/zap-templates/zcl/zcl.json' + + data = json.load(open(zapFile)) + for package in data["package"]: + if package["type"] != "zcl-properties": + continue + + # found the right path, try to figure out the actual path + if package["pathRelativity"] == "relativeToZap": + path = os.path.abspath(os.path.join(os.path.dirname(zapFile), package["path"])) + else: + path = package["path"] + + return getFilePath(path) def runConversion(zap_file): templates_file = getFilePath('src/app/zap-templates/app-templates.json') - zcl_file = getFilePath('src/app/zap-templates/zcl/zcl.json') + zcl_file = detectZclFile(zap_file) generator_dir = getDirPath('third_party/zap/repo') os.chdir(generator_dir) diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index 0116ff870246d6..72b63a1c7fbb6c 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -59,7 +59,6 @@ def getDirPath(name): def detectZclFile(zapFile): - # FIXME: implement print(f"Searching for zcl file from {zapFile}") path = 'src/app/zap-templates/zcl/zcl.json' From eae34692154e9b5a39a468b2f174f4d0dd27a70b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 10:47:11 -0400 Subject: [PATCH 15/20] Add json import --- scripts/tools/zap/convert.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/tools/zap/convert.py b/scripts/tools/zap/convert.py index cf60495a262d06..83dd9c7b9eba16 100755 --- a/scripts/tools/zap/convert.py +++ b/scripts/tools/zap/convert.py @@ -16,6 +16,7 @@ # import argparse +import json import os import subprocess import sys From 11a2152e737bb402e2d1c67905e7dfffc8e57fa2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 10:47:56 -0400 Subject: [PATCH 16/20] Ran convert.py on all-clusters --- .../all-clusters-common/all-clusters-app.zap | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 3fad9b3f49b164..7e80e7dfcaf693 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -12585,22 +12585,6 @@ "maxInterval": 65534, "reportableChange": 0 }, - { - "name": "ManufacturerExtension", - "code": 4293984257, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "255", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, { "name": "GeneratedCommandList", "code": 65528, @@ -12680,6 +12664,22 @@ "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 + }, + { + "name": "ManufacturerExtension", + "code": 4293984257, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "255", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 } ] }, @@ -25158,6 +25158,5 @@ "endpointVersion": 1, "deviceIdentifier": 61442 } - ], - "log": [] + ] } \ No newline at end of file From 3101d66da6b856e2606f7b773394374c664160d2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 10:53:21 -0400 Subject: [PATCH 17/20] Restyle --- scripts/tools/zap/convert.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/tools/zap/convert.py b/scripts/tools/zap/convert.py index 83dd9c7b9eba16..1181ebe17d989f 100755 --- a/scripts/tools/zap/convert.py +++ b/scripts/tools/zap/convert.py @@ -66,6 +66,7 @@ def runArgumentsParser(): return zap_file + def detectZclFile(zapFile): print(f"Searching for zcl file from {zapFile}") @@ -84,6 +85,7 @@ def detectZclFile(zapFile): return getFilePath(path) + def runConversion(zap_file): templates_file = getFilePath('src/app/zap-templates/app-templates.json') zcl_file = detectZclFile(zap_file) From 6f363b1709f15e2b30d3554449eadd31d3d8cc13 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 8 Jun 2022 11:10:30 -0400 Subject: [PATCH 18/20] Add extra slash to check for file path for all clusters --- scripts/tools/zap/run_zaptool.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tools/zap/run_zaptool.sh b/scripts/tools/zap/run_zaptool.sh index 39cbed10554d9f..62a9d3de514bca 100755 --- a/scripts/tools/zap/run_zaptool.sh +++ b/scripts/tools/zap/run_zaptool.sh @@ -47,7 +47,7 @@ CHIP_ROOT="${SCRIPT_PATH%/scripts/tools/zap/run_zaptool.sh}" echo "ARGS: ${ZAP_ARGS[@]}" - if [[ "${ZAP_ARGS[@]}" == *"all-clusters-app.zap"* ]]; then + if [[ "${ZAP_ARGS[@]}" == *"/all-clusters-app.zap"* ]]; then ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl-with-test-extensions.json" else ZCL_FILE="$CHIP_ROOT/src/app/zap-templates/zcl/zcl.json" From f9748f00d128ec779dc6b52beaf08d8f13f7a215 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 9 Jun 2022 11:22:15 -0400 Subject: [PATCH 19/20] Add linter rule for ZCL file being in sync --- .github/workflows/lint.yml | 4 ++ scripts/tools/check_zcl_file_sync.py | 71 ++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100755 scripts/tools/check_zcl_file_sync.py diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b5c296573021d7..ce0a12059f6916 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -85,6 +85,10 @@ jobs: if: always() run: scripts/tools/check_includes.sh + - name: Check for zcl.json and extension sync status + if: always() + run: scripts/tools/check_zcl_file_sync.py . + - name: Ensure all PICS are set for tests (to true or false) if: always() run: | diff --git a/scripts/tools/check_zcl_file_sync.py b/scripts/tools/check_zcl_file_sync.py new file mode 100755 index 00000000000000..cef9516f720891 --- /dev/null +++ b/scripts/tools/check_zcl_file_sync.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +# +# Copyright (c) 2022 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +""" +Validates that the json zcl files that are used by the app are in sync. + +Current rule: + - all-clusters app uses an extension on top of the "standard" zcl file. + Ensure that the two fies are in sync EXCEPT the extension. +""" + +import json +import sys +import os +import difflib + +def main(): + if len(sys.argv) != 2: + print('Please pass CHIP_ROOT as an argument (and only chip root)'); + return 1 + + base_name = os.path.join(sys.argv[1], "src", "app", "zap-templates", "zcl", "zcl.json") + ext_name = os.path.join(sys.argv[1], "src", "app", "zap-templates", "zcl", "zcl-with-test-extensions.json") + + base_data = json.load(open(base_name)) + ext_data = json.load(open(ext_name)) + + # ext should be IDENTICAL with base if we add a few things to base: + base_data["xmlRoot"].append("./data-model/test") + base_data["xmlFile"].append("mode-select-extensions.xml") + + # do not care about sorting. mainly do not check if extension xml + # is at the end or in the middle + base_data["xmlFile"].sort() + ext_data["xmlFile"].sort() + + if base_data == ext_data: + return 0 + + print("%s and %s have unexpected differences." % (base_name, ext_name)) + print("Differences between expected and actual:") + + for l in difflib.unified_diff( + json.dumps(ext_data, indent=2).split('\n'), + json.dumps(base_data, indent=2).split('\n'), + fromfile=ext_name, + tofile="", + ): + if l.endswith('\n'): + l = l[:-1] + print(l) + + return 1 + + +if __name__ == '__main__': + sys.exit(main()) From e2a8a90dc70813f073bdcfd0715d971c5a43adf8 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 9 Jun 2022 13:00:45 -0400 Subject: [PATCH 20/20] Restyle --- scripts/tools/check_zcl_file_sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tools/check_zcl_file_sync.py b/scripts/tools/check_zcl_file_sync.py index cef9516f720891..50c520a84f0fce 100755 --- a/scripts/tools/check_zcl_file_sync.py +++ b/scripts/tools/check_zcl_file_sync.py @@ -28,9 +28,10 @@ import os import difflib + def main(): if len(sys.argv) != 2: - print('Please pass CHIP_ROOT as an argument (and only chip root)'); + print('Please pass CHIP_ROOT as an argument (and only chip root)') return 1 base_name = os.path.join(sys.argv[1], "src", "app", "zap-templates", "zcl", "zcl.json")