From b89faba4b55123c84354ee0129aa8452b7dba5b9 Mon Sep 17 00:00:00 2001 From: "Josh V [Apple]" Date: Fri, 11 Mar 2022 06:31:12 -0800 Subject: [PATCH] Add missing commands and attributes for CI (#16090) * Update simulated app to include missing clusters. * Generated code. --- .../placeholder/linux/apps/app1/config.matter | 65 +++++++++++++++++++ .../placeholder/linux/apps/app1/config.zap | 56 ++++++++++------ .../app1/zap-generated/CHIPClusters.h | 7 ++ .../PluginApplicationCallbacks.h | 1 + .../app1/zap-generated/endpoint_config.h | 55 +++++++++++----- .../app1/zap-generated/gen_config.h | 5 ++ 6 files changed, 152 insertions(+), 37 deletions(-) diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index e39670fda270d1..9b8ea2a04e399c 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -9,10 +9,16 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } + struct ApplicationBasicApplication { + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; + } + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; + readonly attribute ApplicationBasicApplication application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; @@ -30,10 +36,16 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } + struct ApplicationBasicApplication { + INT16U catalogVendorId = 0; + CHAR_STRING applicationId = 1; + } + readonly attribute char_string<32> vendorName = 0; readonly attribute int16u vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; + readonly attribute ApplicationBasicApplication application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; @@ -1122,6 +1134,57 @@ server cluster NetworkCommissioning = 49 { command ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; } +client cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : enum8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : enum8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : enum8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + bitmap OnOffFeature : BITMAP32 { + kLighting = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute boolean globalSceneControl = 16384; + attribute int16u onTime = 16385; + attribute int16u offWaitTime = 16386; + attribute enum8 startUpOnOff = 16387; + readonly global attribute bitmap32 featureMap = 65532; + readonly global attribute int16u clusterRevision = 65533; + + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectId = 0; + OnOffDelayedAllOffEffectVariant effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + + command Off(): DefaultSuccess = 0; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command On(): DefaultSuccess = 1; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; + command Toggle(): DefaultSuccess = 2; +} + server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : enum8 { kFadeToOffIn0p8Seconds = 0; @@ -1833,6 +1896,7 @@ endpoint 0 { binding cluster KeypadInput; server cluster KeypadInput; server cluster NetworkCommissioning; + binding cluster OnOff; server cluster OnOff; binding cluster OperationalCredentials; server cluster OperationalCredentials; @@ -1851,6 +1915,7 @@ endpoint 1 { server cluster Groups; server cluster Identify; server cluster LevelControl; + binding cluster OnOff; server cluster OnOff; server cluster Scenes; } diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index b9bf12c600a628..b4d0c4f96f9626 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -42,7 +42,7 @@ "mfgCode": null, "define": "ON_OFF_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "Off", @@ -827,7 +827,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -842,7 +842,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -857,7 +857,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -2981,7 +2981,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3011,7 +3011,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3026,7 +3026,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3041,7 +3041,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3126,7 +3126,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3141,7 +3141,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3156,7 +3156,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3249,7 +3249,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3279,7 +3279,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3294,7 +3294,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3309,7 +3309,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3430,7 +3430,21 @@ "maxInterval": 65534, "reportableChange": 0 }, - + { + "name": "Application", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "Status", "code": 5, @@ -3467,7 +3481,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3482,7 +3496,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3497,7 +3511,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -3512,7 +3526,7 @@ "mfgCode": null, "side": "server", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -4042,7 +4056,7 @@ "mfgCode": null, "define": "ON_OFF_CLUSTER", "side": "client", - "enabled": 0, + "enabled": 1, "commands": [ { "name": "Off", diff --git a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h index c59f0704744494..4399f8c0cf0432 100644 --- a/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h +++ b/zzz_generated/placeholder/app1/zap-generated/CHIPClusters.h @@ -58,6 +58,13 @@ class DLL_EXPORT KeypadInputCluster : public ClusterBase ~KeypadInputCluster() {} }; +class DLL_EXPORT OnOffCluster : public ClusterBase +{ +public: + OnOffCluster() : ClusterBase(app::Clusters::OnOff::Id) {} + ~OnOffCluster() {} +}; + class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase { public: diff --git a/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h b/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h index c73db0e906ef14..950bcbaf3a4f8c 100644 --- a/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h +++ b/zzz_generated/placeholder/app1/zap-generated/PluginApplicationCallbacks.h @@ -38,6 +38,7 @@ MatterKeypadInputPluginServerInitCallback(); \ MatterLevelControlPluginServerInitCallback(); \ MatterNetworkCommissioningPluginServerInitCallback(); \ + MatterOnOffPluginClientInitCallback(); \ MatterOnOffPluginServerInitCallback(); \ MatterOperationalCredentialsPluginClientInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ diff --git a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h index 10d7785531b69e..3d9e7dc00606a8 100644 --- a/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/endpoint_config.h @@ -205,7 +205,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 187 +#define GENERATED_ATTRIBUTE_COUNT 188 #define GENERATED_ATTRIBUTES \ { \ \ @@ -430,11 +430,12 @@ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Application Basic (server) */ \ - { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ - { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* VendorID */ \ - { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* ApplicationName */ \ - { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* ProductID */ \ - { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Status */ \ + { 0x00000000, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* VendorName */ \ + { 0x00000001, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* VendorID */ \ + { 0x00000002, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* ApplicationName */ \ + { 0x00000003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0) }, /* ProductID */ \ + { 0x00000004, ZAP_TYPE(STRUCT), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* Application */ \ + { 0x00000005, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* Status */ \ { 0x00000006, ZAP_TYPE(CHAR_STRING), 33, 0, ZAP_EMPTY_DEFAULT() }, /* ApplicationVersion */ \ { 0x00000007, ZAP_TYPE(ARRAY), 0, ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE), ZAP_EMPTY_DEFAULT() }, /* AllowedVendorList */ \ { 0x0000FFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(1) }, /* ClusterRevision */ \ @@ -718,10 +719,21 @@ // clang-format on #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 29 +#define GENERATED_CLUSTER_COUNT 31 // clang-format off #define GENERATED_CLUSTERS { \ + { \ + /* Endpoint: 0, Cluster: On/Off (client) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(0), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ { \ /* Endpoint: 0, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ @@ -957,7 +969,7 @@ /* Endpoint: 0, Cluster: Application Basic (server) */ \ .clusterId = 0x0000050D, \ .attributes = ZAP_ATTRIBUTE_INDEX(138), \ - .attributeCount = 8, \ + .attributeCount = 9, \ .clusterSize = 106, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ @@ -967,7 +979,7 @@ { \ /* Endpoint: 1, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(146), \ + .attributes = ZAP_ATTRIBUTE_INDEX(147), \ .attributeCount = 3, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -978,7 +990,7 @@ { \ /* Endpoint: 1, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(149), \ + .attributes = ZAP_ATTRIBUTE_INDEX(150), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -989,7 +1001,7 @@ { \ /* Endpoint: 1, Cluster: Scenes (server) */ \ .clusterId = 0x00000005, \ - .attributes = ZAP_ATTRIBUTE_INDEX(151), \ + .attributes = ZAP_ATTRIBUTE_INDEX(152), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -997,10 +1009,21 @@ .clientGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 82 ) ,\ .serverGeneratedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 90 ) ,\ },\ + { \ + /* Endpoint: 1, Cluster: On/Off (client) */ \ + .clusterId = 0x00000006, \ + .attributes = ZAP_ATTRIBUTE_INDEX(158), \ + .attributeCount = 0, \ + .clusterSize = 0, \ + .mask = ZAP_CLUSTER_MASK(CLIENT), \ + .functions = NULL, \ + .clientGeneratedCommandList = nullptr ,\ + .serverGeneratedCommandList = nullptr ,\ + },\ { \ /* Endpoint: 1, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(157), \ + .attributes = ZAP_ATTRIBUTE_INDEX(158), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1011,7 +1034,7 @@ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(159), \ + .attributes = ZAP_ATTRIBUTE_INDEX(160), \ .attributeCount = 2, \ .clusterSize = 3, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1022,7 +1045,7 @@ { \ /* Endpoint: 1, Cluster: Basic (server) */ \ .clusterId = 0x00000028, \ - .attributes = ZAP_ATTRIBUTE_INDEX(161), \ + .attributes = ZAP_ATTRIBUTE_INDEX(162), \ .attributeCount = 20, \ .clusterSize = 39, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1033,7 +1056,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(181), \ + .attributes = ZAP_ATTRIBUTE_INDEX(182), \ .attributeCount = 6, \ .clusterSize = 11, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1052,7 +1075,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 22, 383 }, { ZAP_CLUSTER_INDEX(22), 7, 72 }, \ + { ZAP_CLUSTER_INDEX(0), 23, 383 }, { ZAP_CLUSTER_INDEX(23), 8, 72 }, \ } // Largest attribute size is needed for various buffers diff --git a/zzz_generated/placeholder/app1/zap-generated/gen_config.h b/zzz_generated/placeholder/app1/zap-generated/gen_config.h index 6ae5cf0539b8e0..9c02dfd43083ce 100644 --- a/zzz_generated/placeholder/app1/zap-generated/gen_config.h +++ b/zzz_generated/placeholder/app1/zap-generated/gen_config.h @@ -45,6 +45,7 @@ #define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (2) #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -143,6 +144,10 @@ #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING +// Use this macro to check if the client side of the On/Off cluster is included +#define ZCL_USING_ON_OFF_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_ON_OFF_CLIENT + // Use this macro to check if the server side of the On/Off cluster is included #define ZCL_USING_ON_OFF_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ON_OFF_SERVER