diff --git a/build/chip/chip_codegen.cmake b/build/chip/chip_codegen.cmake index 708e144208417a..f7e4366a6d9aa8 100644 --- a/build/chip/chip_codegen.cmake +++ b/build/chip/chip_codegen.cmake @@ -161,7 +161,6 @@ function(chip_zapgen TARGET_NAME) # out links of template files and zap files and such SET(EXTRA_DEPENDENCIES "${CHIP_ROOT}/src/app/zap-templates/partials/header.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/access.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/CHIPClusters.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt" diff --git a/build/chip/chip_codegen.gni b/build/chip/chip_codegen.gni index 1a6927bf4686f4..6d40f614fff71c 100644 --- a/build/chip/chip_codegen.gni +++ b/build/chip/chip_codegen.gni @@ -141,7 +141,6 @@ template("_chip_build_time_zapgen") { # out links of template files and zap files and such _extra_dependencies = [ "${_partials_dir}/header.zapt", - "${_partials_dir}/im_command_handler_cluster_commands.zapt", # Application templates, actually generating files "${_template_dir}/access.zapt", diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index dbc688c611658d..d38f1962f5c015 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -1778,7 +1778,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1884,7 +1884,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2040,8 +2040,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -2074,7 +2074,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -2110,7 +2110,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2122,7 +2122,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2134,7 +2134,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2146,7 +2146,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2158,7 +2158,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2170,7 +2170,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2182,7 +2182,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2194,7 +2194,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2206,7 +2206,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2218,7 +2218,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } } 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 39a0026bdee9c5..d8e6f3b01ec04c 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 @@ -191,6 +191,27 @@ server cluster Scenes = 5 { group_id groupID = 0; } + request struct EnhancedAddSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; + INT16U transitionTime = 2; + CHAR_STRING sceneName = 3; + ExtensionFieldSet extensionFieldSets[] = 4; + } + + request struct EnhancedViewSceneRequest { + group_id groupID = 0; + INT8U sceneID = 1; + } + + request struct CopySceneRequest { + ScenesCopyMode mode = 0; + group_id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; + group_id groupIdentifierTo = 3; + INT8U sceneIdentifierTo = 4; + } + response struct AddSceneResponse = 0 { status status = 0; group_id groupID = 1; @@ -230,6 +251,27 @@ server cluster Scenes = 5 { optional INT8U sceneList[] = 3; } + response struct EnhancedAddSceneResponse = 64 { + status status = 0; + group_id groupID = 1; + INT8U sceneID = 2; + } + + response struct EnhancedViewSceneResponse = 65 { + status status = 0; + group_Id groupID = 1; + INT8U sceneID = 2; + optional INT16U transitionTime = 3; + optional CHAR_STRING sceneName = 4; + optional ExtensionFieldSet extensionFieldSets[] = 5; + } + + response struct CopySceneResponse = 66 { + status status = 0; + group_Id groupIdentifierFrom = 1; + INT8U sceneIdentifierFrom = 2; + } + fabric command access(invoke: manage) AddScene(AddSceneRequest): AddSceneResponse = 0; fabric command ViewScene(ViewSceneRequest): ViewSceneResponse = 1; fabric command access(invoke: manage) RemoveScene(RemoveSceneRequest): RemoveSceneResponse = 2; @@ -237,6 +279,9 @@ server cluster Scenes = 5 { fabric command access(invoke: manage) StoreScene(StoreSceneRequest): StoreSceneResponse = 4; fabric command RecallScene(RecallSceneRequest): DefaultSuccess = 5; fabric command GetSceneMembership(GetSceneMembershipRequest): GetSceneMembershipResponse = 6; + fabric command EnhancedAddScene(EnhancedAddSceneRequest): EnhancedAddSceneResponse = 64; + fabric command EnhancedViewScene(EnhancedViewSceneRequest): EnhancedViewSceneResponse = 65; + fabric command CopyScene(CopySceneRequest): CopySceneResponse = 66; } /** Attributes and commands for switching devices between 'On' and 'Off' states. */ @@ -4533,9 +4578,18 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring a lighting ballast. */ server cluster BallastConfiguration = 769 { + bitmap BallastStatusBitmap : BITMAP8 { + kBallastNonOperational = 0x1; + kLampFailure = 0x2; + } + + bitmap LampAlarmModeBitmap : BITMAP8 { + kLampBurnHours = 0x1; + } + readonly attribute int8u physicalMinLevel = 0; readonly attribute int8u physicalMaxLevel = 1; - readonly attribute bitmap8 ballastStatus = 2; + readonly attribute BallastStatusBitmap ballastStatus = 2; attribute int8u minLevel = 16; attribute int8u maxLevel = 17; attribute nullable int8u intrinsicBallastFactor = 20; @@ -4545,7 +4599,7 @@ server cluster BallastConfiguration = 769 { attribute char_string<16> lampManufacturer = 49; attribute nullable int24u lampRatedHours = 50; attribute nullable int24u lampBurnHours = 51; - attribute bitmap8 lampAlarmMode = 52; + attribute LampAlarmModeBitmap lampAlarmMode = 52; attribute nullable int24u lampBurnHoursTripPoint = 53; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -6348,7 +6402,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -6548,8 +6602,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -6679,6 +6733,12 @@ endpoint 1 { handle command RecallScene; handle command GetSceneMembership; handle command GetSceneMembershipResponse; + handle command EnhancedAddScene; + handle command EnhancedAddSceneResponse; + handle command EnhancedViewScene; + handle command EnhancedViewSceneResponse; + handle command CopyScene; + handle command CopySceneResponse; } server cluster OnOff { @@ -6842,7 +6902,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -6857,7 +6917,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -6885,7 +6945,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -6900,7 +6960,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -6939,7 +6999,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -6951,7 +7011,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -7054,7 +7114,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 7; + callback attribute featureMap default = 7; ram attribute clusterRevision default = 1; handle command ResetCondition; @@ -7070,7 +7130,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 7; + callback attribute featureMap default = 7; ram attribute clusterRevision default = 1; handle command ResetCondition; @@ -7431,7 +7491,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7450,7 +7510,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7469,7 +7529,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7488,7 +7548,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7507,7 +7567,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7526,7 +7586,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7545,7 +7605,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7564,7 +7624,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7583,7 +7643,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7602,7 +7662,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7880,6 +7940,7 @@ endpoint 2 { ram attribute currentGroup default = 0x0000; ram attribute sceneValid default = 0x00; ram attribute nameSupport default = 0x80; + ram attribute lastConfiguredBy; ram attribute sceneTableSize default = 16; callback attribute remainingCapacity default = 8; callback attribute generatedCommandList; @@ -7902,6 +7963,12 @@ endpoint 2 { handle command RecallScene; handle command GetSceneMembership; handle command GetSceneMembershipResponse; + handle command EnhancedAddScene; + handle command EnhancedAddSceneResponse; + handle command EnhancedViewScene; + handle command EnhancedViewSceneResponse; + handle command CopyScene; + handle command CopySceneResponse; } server cluster OnOff { 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 1d8a3b0e22df21..0835158762e7e7 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 @@ -6745,6 +6745,54 @@ "source": "server", "isIncoming": 0, "isEnabled": 1 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "EnhancedAddSceneResponse", + "code": 64, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "EnhancedViewSceneResponse", + "code": 65, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CopySceneResponse", + "code": 66, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -15098,7 +15146,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "BallastStatusBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15258,7 +15306,7 @@ "code": 52, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "LampAlarmModeBitmap", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -21905,6 +21953,54 @@ "source": "server", "isIncoming": 0, "isEnabled": 1 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "EnhancedAddSceneResponse", + "code": 64, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "EnhancedViewSceneResponse", + "code": 65, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "CopySceneResponse", + "code": 66, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 } ], "attributes": [ @@ -21988,6 +22084,22 @@ "maxInterval": 65344, "reportableChange": 0 }, + { + "name": "LastConfiguredBy", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "node_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "SceneTableSize", "code": 6, diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp index 39e3516ada4c96..8c69395887af7b 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp @@ -235,13 +235,13 @@ void AllClustersAppCommandHandler::OnGeneralFaultEventHandler(uint32_t eventId) GeneralFaults current; // On Linux Simulation, set following radio faults statically. - ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); + ReturnOnFailure(previous.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kWiFiFault))); + ReturnOnFailure(previous.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kThreadFault))); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_CELLULAR_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_NFC_FAULT)); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kWiFiFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kCellularFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kThreadFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kNFCFault))); Clusters::GeneralDiagnosticsServer::Instance().OnRadioFaultsDetect(previous, current); } else if (eventId == Clusters::GeneralDiagnostics::Events::NetworkFaultChange::Id) diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index f085733a42a563..da532245ff9710 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -2979,6 +2979,15 @@ server cluster ColorControl = 768 { /** Attributes and commands for configuring a lighting ballast. */ server cluster BallastConfiguration = 769 { + bitmap BallastStatusBitmap : BITMAP8 { + kBallastNonOperational = 0x1; + kLampFailure = 0x2; + } + + bitmap LampAlarmModeBitmap : BITMAP8 { + kLampBurnHours = 0x1; + } + readonly attribute int8u physicalMinLevel = 0; readonly attribute int8u physicalMaxLevel = 1; attribute int8u minLevel = 16; @@ -4180,7 +4189,7 @@ endpoint 0 { } server cluster SoftwareDiagnostics { - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -4284,8 +4293,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index f9cfc904bac671..13ffa6eb95fe66 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1644,7 +1644,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1786,7 +1786,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -1945,8 +1945,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1989,7 +1989,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Actions { diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp index 3d73688594c5a9..f9edf960ded512 100644 --- a/examples/bridge-app/linux/main.cpp +++ b/examples/bridge-app/linux/main.cpp @@ -739,10 +739,6 @@ bool emberAfActionsClusterInstantActionCallback(app::CommandHandler * commandObj return true; } -void ApplicationInit() {} - -void ApplicationShutdown() {} - const EmberAfDeviceType gBridgedOnOffDeviceTypes[] = { { DEVICE_TYPE_LO_ON_OFF_LIGHT, DEVICE_VERSION_DEFAULT }, { DEVICE_TYPE_BRIDGED_NODE, DEVICE_VERSION_DEFAULT } }; @@ -891,7 +887,7 @@ void * bridge_polling_thread(void * context) return nullptr; } -int main(int argc, char * argv[]) +void ApplicationInit() { // Clear out the device database memset(gDevices, 0, sizeof(gDevices)); @@ -934,26 +930,6 @@ int main(int argc, char * argv[]) ComposedTempSensor2.SetChangeCallback(&HandleDeviceTempSensorStatusChanged); ComposedPowerSource.SetChangeCallback(&HandleDevicePowerSourceStatusChanged); - if (ChipLinuxAppInit(argc, argv) != 0) - { - return -1; - } - - // Init Data Model and CHIP App Server - static chip::CommonCaseDeviceServerInitParams initParams; - (void) initParams.InitializeStaticResourcesBeforeServerInit(); - -#if CHIP_DEVICE_ENABLE_PORT_PARAMS - // use a different service port to make testing possible with other sample devices running on same host - initParams.operationalServicePort = LinuxDeviceOptions::GetInstance().securedDevicePort; -#endif - - initParams.interfaceId = LinuxDeviceOptions::GetInstance().interfaceId; - chip::Server::GetInstance().Init(initParams); - - // Initialize device attestation config - SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - // Set starting endpoint id where dynamic endpoints will be assigned, which // will be the next consecutive endpoint id after the last fixed endpoint. gFirstDynamicEndpointId = static_cast( @@ -1022,11 +998,17 @@ int main(int argc, char * argv[]) } } - // Run CHIP - - ApplicationInit(); registerAttributeAccessOverride(&gPowerAttrAccess); - chip::DeviceLayer::PlatformMgr().RunEventLoop(); +} +void ApplicationShutdown() {} + +int main(int argc, char * argv[]) +{ + if (ChipLinuxAppInit(argc, argv) != 0) + { + return -1; + } + ChipLinuxAppMainLoop(); return 0; } diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 27e1a51954f438..bc8f4c2d6723cd 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1500,7 +1500,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1605,7 +1605,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1761,8 +1761,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1866,7 +1866,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index a8e2b77f67e6b5..d71d756d0ae0b7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1747,7 +1747,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1882,8 +1882,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1942,7 +1942,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster HepaFilterMonitoring { @@ -1954,7 +1954,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -1967,7 +1967,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -2019,7 +2019,7 @@ endpoint 2 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster AirQuality { @@ -2028,7 +2028,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -2047,7 +2047,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2066,7 +2066,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; } @@ -2085,7 +2085,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2104,7 +2104,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2123,7 +2123,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2142,7 +2142,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2161,7 +2161,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2180,7 +2180,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2199,7 +2199,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -2218,7 +2218,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 3; } } @@ -2250,7 +2250,7 @@ endpoint 3 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster TemperatureMeasurement { @@ -2293,7 +2293,7 @@ endpoint 4 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster RelativeHumidityMeasurement { @@ -2336,7 +2336,7 @@ endpoint 5 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Thermostat { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index 6a13716ac54b74..4bff64e8bf40ad 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -1693,7 +1693,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1821,7 +1821,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1868,8 +1868,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1912,7 +1912,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster AirQuality { @@ -1921,7 +1921,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 15; + callback attribute featureMap default = 15; ram attribute clusterRevision default = 1; } @@ -1967,7 +1967,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -1987,7 +1987,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2007,7 +2007,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2027,7 +2027,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2047,7 +2047,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2067,7 +2067,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2087,7 +2087,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2107,7 +2107,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2127,7 +2127,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } @@ -2147,7 +2147,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 63; + callback attribute featureMap default = 63; ram attribute clusterRevision default = 3; } } diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index 937d3b72434528..2f1dc771d0030d 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -1462,7 +1462,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1590,7 +1590,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1637,8 +1637,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1682,7 +1682,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster WakeOnLan { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index e52be9c443bbff..f02547fb54f711 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -1529,7 +1529,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1642,7 +1642,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1689,8 +1689,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1788,7 +1788,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster ColorControl { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 51f3c991c283b8..fb548e46678ccc 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -1190,7 +1190,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1318,7 +1318,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1365,8 +1365,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1428,7 +1428,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BooleanState { diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index a0a9bc59cadf82..c103ee77b5f45d 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -1366,7 +1366,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1494,7 +1494,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1541,8 +1541,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1646,7 +1646,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index b8f1025ec59ef7..8fd8fb8795c347 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -1027,7 +1027,7 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1228,8 +1228,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index a588b1b3a98369..da5611dd1475aa 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1662,7 +1662,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1790,7 +1790,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1837,8 +1837,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1900,7 +1900,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster DoorLock { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index fcca0c6a997334..d9c7ae42681a6d 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -1593,7 +1593,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1721,7 +1721,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1768,8 +1768,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1872,7 +1872,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster ColorControl { diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index 9efbcc1995bc0b..160625a22e112c 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -1232,7 +1232,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1361,7 +1361,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1408,8 +1408,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1471,7 +1471,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster FanControl { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 5e472a08f8b507..21cbf17be552cb 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -1195,7 +1195,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1323,7 +1323,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1370,8 +1370,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1414,7 +1414,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster FlowMeasurement { diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index df05db0783eedc..f4f80b458c02a1 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -889,7 +889,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1024,8 +1024,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1063,7 +1063,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster Switch { diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 03ec6fbbd2dbcd..e77419c1fda652 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1542,7 +1542,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1670,7 +1670,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1717,8 +1717,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1816,7 +1816,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster FanControl { diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index 181156ac94e96c..1999b1fa6acfdd 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -1195,7 +1195,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1323,7 +1323,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1370,8 +1370,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1414,7 +1414,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster RelativeHumidityMeasurement { diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 64bdf2773ea307..7d4609e57625f4 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -1025,7 +1025,7 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1226,8 +1226,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index 7bf1219f384215..060f82aff6e95c 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -1200,7 +1200,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1328,7 +1328,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1375,8 +1375,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1419,7 +1419,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster IlluminanceMeasurement { diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 173cd29ae1f9e5..1cf507450de2ac 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -1211,7 +1211,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1339,7 +1339,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1386,8 +1386,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1430,7 +1430,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster OccupancySensing { diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index 1a0e748dc47bb2..7b7f62aa3c1744 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -1325,7 +1325,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1453,7 +1453,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1500,8 +1500,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1604,7 +1604,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 934627c916a646..4e9a48fb960014 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -1348,7 +1348,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1476,7 +1476,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1523,8 +1523,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1627,7 +1627,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster SampleMei { diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 0f0a418001a8b9..5f18e76b15edb6 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -1289,7 +1289,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1417,7 +1417,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1464,8 +1464,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1541,7 +1541,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index a2531a6718c0dc..0525082b4a2612 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -1224,7 +1224,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1352,7 +1352,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1399,8 +1399,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1479,7 +1479,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index 1e88b02d12b584..31cfafbab3d935 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -1214,7 +1214,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1342,7 +1342,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1389,8 +1389,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1439,7 +1439,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster PressureMeasurement { diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index e32afb1d32a477..97d132ec75b25a 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -1065,7 +1065,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1224,8 +1224,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1274,7 +1274,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster PumpConfigurationAndControl { diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.matter b/examples/chef/devices/rootnode_pump_a811bb33a0.matter index bde6cc0baefd13..a42d58ed7c2e39 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.matter +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.matter @@ -1017,7 +1017,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1176,8 +1176,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1226,7 +1226,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster PumpConfigurationAndControl { diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index 4c852111d67330..74a8754dfd9c5c 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -992,7 +992,7 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1193,8 +1193,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1233,7 +1233,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster TemperatureControl { @@ -1261,7 +1261,7 @@ endpoint 3 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster TemperatureControl { diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index ea8b7f0dbd2d5f..fc74abb510ae54 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -1195,7 +1195,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1330,8 +1330,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1420,7 +1420,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster RvcRunMode { @@ -1432,7 +1432,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -1448,7 +1448,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index efd1fb46f20902..1f885b220c1317 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1116,7 +1116,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1251,8 +1251,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1324,7 +1324,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Thermostat { diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 976d866cb6e633..617249bcdfa987 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -1247,7 +1247,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1382,8 +1382,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1442,7 +1442,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster PowerSource { diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index a64285f109bc97..a8176f92f6c983 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -1250,7 +1250,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1378,7 +1378,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1425,8 +1425,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1503,7 +1503,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 2c33b26997d25d..a32f757c6a1a76 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -1194,7 +1194,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1322,7 +1322,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1369,8 +1369,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1413,7 +1413,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster TemperatureMeasurement { diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index 835e241f77e421..7f25bece913df2 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1443,7 +1443,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1571,7 +1571,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1618,8 +1618,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1685,7 +1685,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Thermostat { diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 7c425ef7fe6d19..c545f2210414fd 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -1319,7 +1319,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1447,7 +1447,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 0x0001; handle command ResetWatermarks; @@ -1494,8 +1494,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1557,7 +1557,7 @@ endpoint 1 { callback attribute acceptedCommandList default = 0; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster WindowCovering { diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index f8be2148f7f445..3996242be4c4ee 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -1516,7 +1516,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1644,7 +1644,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1800,8 +1800,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index c4ed4973be193f..cdbaa90415f28d 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -1132,7 +1132,7 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1333,8 +1333,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index 2a986b2fada993..ab8a6fa7b01c33 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -2307,7 +2307,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2435,7 +2435,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2623,8 +2623,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -2732,7 +2732,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Switch { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 719a96b5c00ce0..316beb96d8b2ac 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -1664,7 +1664,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1794,7 +1794,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1857,8 +1857,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 611b7d71d355d0..b9aac193e52230 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1796,7 +1796,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1927,7 +1927,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2042,8 +2042,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 62095a61cfd9b8..cdb45e3d44bfcc 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1706,7 +1706,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1836,7 +1836,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1904,8 +1904,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index b0ab2702df5e04..f795148600a756 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -2122,7 +2122,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2253,7 +2253,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2417,8 +2417,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/linux/LightingAppCommandDelegate.cpp b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp index d0b772f6f04845..cafc1df1161359 100644 --- a/examples/lighting-app/linux/LightingAppCommandDelegate.cpp +++ b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp @@ -199,13 +199,13 @@ void LightingAppCommandHandler::OnGeneralFaultEventHandler(uint32_t eventId) GeneralFaults current; // On Linux Simulation, set following radio faults statically. - ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnOnFailure(previous.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); + ReturnOnFailure(previous.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kWiFiFault))); + ReturnOnFailure(previous.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kThreadFault))); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_CELLULAR_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnOnFailure(current.add(EMBER_ZCL_RADIO_FAULT_ENUM_NFC_FAULT)); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kWiFiFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kCellularFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kThreadFault))); + ReturnOnFailure(current.add(to_underlying(GeneralDiagnostics::RadioFaultEnum::kNFCFault))); Clusters::GeneralDiagnosticsServer::Instance().OnRadioFaultsDetect(previous, current); } else if (eventId == Clusters::GeneralDiagnostics::Events::NetworkFaultChange::Id) diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index fd03df9bc7c5e7..930bf24d29585c 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -1350,7 +1350,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1442,7 +1442,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1555,8 +1555,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index d0532d9345b05c..960313847f7e0c 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -1741,7 +1741,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1878,7 +1878,7 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2004,8 +2004,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index f43882a4ed07a6..949561206dc5ba 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -2184,7 +2184,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2307,7 +2307,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2424,8 +2424,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index 579177a1d69428..1ff16f340fa3a5 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -2074,7 +2074,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2197,7 +2197,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2264,8 +2264,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index d7f5157b1aad05..9ed502d5e9d830 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -2313,7 +2313,7 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2492,7 +2492,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2660,8 +2660,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index c872de9db3b43b..fb319dbef0ee10 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -1437,7 +1437,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 3; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1515,7 +1515,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1628,8 +1628,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1665,7 +1665,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster DoorLock { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index cba3a37a38ca2a..b02c457700eb55 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1775,7 +1775,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1912,7 +1912,7 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2038,8 +2038,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/log-source-app/log-source-common/log-source-app.matter b/examples/log-source-app/log-source-common/log-source-app.matter index 0b70fbb3f2bd56..5db3db137408c2 100644 --- a/examples/log-source-app/log-source-common/log-source-app.matter +++ b/examples/log-source-app/log-source-common/log-source-app.matter @@ -434,7 +434,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster GeneralCommissioning { diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index d381b0009afae2..d91233c03a2eab 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -977,7 +977,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster AccessControl { @@ -990,7 +990,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1144,8 +1144,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 1c630f273ca1fa..ba7e12a66500ce 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -1170,7 +1170,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1327,8 +1327,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1407,7 +1407,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } } endpoint 65534 { diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index a1533eaa988843..e336d58c890c3e 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6541,7 +6541,7 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Actions { @@ -6730,7 +6730,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -6932,8 +6932,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -7446,7 +7446,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index da3c9277c8faa5..b8d5564e31455c 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6500,7 +6500,7 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster Actions { @@ -6690,7 +6690,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -6892,8 +6892,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -7408,7 +7408,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index f7ebed2e2b8157..fbd427a20655e3 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -1426,7 +1426,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1610,8 +1610,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 5b396477bc7b02..9da5428737cb0b 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -1426,7 +1426,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1610,8 +1610,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 5b396477bc7b02..9da5428737cb0b 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -1426,7 +1426,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1610,8 +1610,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 52b0275d4bc011..dceeb7c65aadb7 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -1312,7 +1312,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1496,8 +1496,8 @@ endpoint 0 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 6446c714a60f96..c336160caca659 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -937,7 +937,7 @@ endpoint 0 { callback attribute acceptedCommandList default = 0; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1138,8 +1138,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1179,7 +1179,7 @@ endpoint 2 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster TemperatureControl { @@ -1208,7 +1208,7 @@ endpoint 3 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 2; + callback attribute clusterRevision default = 2; } server cluster TemperatureControl { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index 0d5b4b2fdaf403..1a2c3e587b8bbc 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -1682,7 +1682,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1813,7 +1813,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1976,8 +1976,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -2045,7 +2045,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster HepaFilterMonitoring { @@ -2058,7 +2058,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 7; + callback attribute featureMap default = 7; ram attribute clusterRevision default = 1; handle command ResetCondition; @@ -2074,7 +2074,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 7; + callback attribute featureMap default = 7; ram attribute clusterRevision default = 1; handle command ResetCondition; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index 2d4510e11ea346..02ef63a33a9c54 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -1000,7 +1000,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1135,8 +1135,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -1174,7 +1174,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList default = 0; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster RvcRunMode { @@ -1184,7 +1184,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; @@ -1199,7 +1199,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; + callback attribute featureMap default = 0; ram attribute clusterRevision default = 1; handle command ChangeToMode; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 7183bdb0fa0768..8e4ffc74e7691c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -1726,7 +1726,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1847,7 +1847,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -1964,8 +1964,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; @@ -2052,7 +2052,7 @@ endpoint 1 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster PowerSource { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index 6f80acdb81aff8..1e9fa71cd434ca 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -1050,7 +1050,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1166,7 +1166,7 @@ endpoint 0 { server cluster SoftwareDiagnostics { callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -1248,8 +1248,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index ec378702e7df16..1ab27cea371dd3 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1663,7 +1663,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1797,7 +1797,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -1949,8 +1949,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index 608346b80db0f8..d86344bb793f61 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -2457,7 +2457,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2589,7 +2589,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -2741,8 +2741,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index c5ca1f0bce7c0a..7e7be6f39ad5d2 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2014,7 +2014,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2127,7 +2127,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -2209,8 +2209,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index e13263f46ba4a3..67ca9ba72439cf 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -2526,7 +2526,7 @@ endpoint 0 { callback attribute accessControlEntriesPerFabric default = 4; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -2659,7 +2659,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; } @@ -2811,8 +2811,8 @@ endpoint 0 { callback attribute groupTable; callback attribute maxGroupsPerFabric; callback attribute maxGroupKeysPerFabric; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index b901086559f14a..4fff89880dd95c 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1825,7 +1825,7 @@ endpoint 0 { callback attribute eventList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute clusterRevision default = 1; } server cluster BasicInformation { @@ -1998,7 +1998,7 @@ endpoint 0 { callback attribute currentHeapFree default = 0x0000000000000000; callback attribute currentHeapUsed default = 0x0000000000000000; callback attribute currentHeapHighWatermark default = 0x0000000000000000; - ram attribute featureMap default = 1; + callback attribute featureMap default = 1; ram attribute clusterRevision default = 1; handle command ResetWatermarks; @@ -2164,8 +2164,8 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute eventList; callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + callback attribute featureMap default = 0; + callback attribute clusterRevision default = 1; handle command KeySetWrite; handle command KeySetRead; diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp index 851a818e9ec485..c4358e13409225 100644 --- a/examples/window-app/silabs/src/WindowManager.cpp +++ b/examples/window-app/silabs/src/WindowManager.cpp @@ -183,6 +183,7 @@ void WindowManager::DispatchEventAttributeChange(chip::EndpointId endpoint, chip /* ============= Positions for Position Aware ============= */ case Attributes::CurrentPositionLiftPercent100ths::Id: case Attributes::CurrentPositionTiltPercent100ths::Id: + UpdateLEDs(); UpdateLCD(); break; default: diff --git a/scripts/py_matter_idl/matter_idl/README.md b/scripts/py_matter_idl/matter_idl/README.md index 4446760bc5dc90..1cd4a28cc325bb 100644 --- a/scripts/py_matter_idl/matter_idl/README.md +++ b/scripts/py_matter_idl/matter_idl/README.md @@ -130,6 +130,23 @@ server cluster AccessControl = 31 { // commands may have multiple attributes fabric timed command RequiresTimedInvoke(): DefaultSuccess = 7; + + // Items may have a prefix about api stability. + // - "provisional" are generally subject to change + // - "internal" are for internal SDK development/usage/testing + + provisional critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + internal struct SomeInternalStruct {} + + struct StructThatIsBeingChanged { + CHAR_STRING debugText = 1; + provisional INT32S errorValue = 2; + } + + provisional timedwrite attribute int16u attributeInDevelopment = 10; + internal command FactoryReset(): DefaultSuccess = 10; } // A client cluster represents something that is used by an app @@ -150,6 +167,10 @@ client cluster OtaSoftwareUpdateProvider = 41 { ///.... content removed: it is very similar to a server cluster } +// Clusters may be provisional or internal as well +provisional client cluster SomeClusterInDevelopment = 1234 { + /// ... content removed +} // On every endpoint number (non-dynamic) // a series of clusters can be exposed diff --git a/scripts/py_matter_idl/matter_idl/matter_grammar.lark b/scripts/py_matter_idl/matter_idl/matter_grammar.lark index 8e884d6347e593..35581dca4e6ea6 100644 --- a/scripts/py_matter_idl/matter_idl/matter_grammar.lark +++ b/scripts/py_matter_idl/matter_idl/matter_grammar.lark @@ -2,6 +2,14 @@ struct: struct_qualities "struct"i id "{" (struct_field ";")* "}" struct_quality: "fabric_scoped"i -> struct_fabric_scoped struct_qualities: struct_quality* +// Composing elements may be at different maturity level +// This only contains non-stable items. Items without a maturity +// flag are to be assumed "stable" +?maturity: "provisional"i -> provisional_api_maturity + | "internal"i -> internal_api_maturity + | "deprecated"i -> deprecated_api_maturity + | "stable"i -> stable_api_maturity + enum: "enum"i id ":" type "{" constant_entry* "}" bitmap: "bitmap"i id ":" type "{" constant_entry* "}" @@ -53,9 +61,10 @@ command_with_access: "command"i command_access? id command: command_qualities command_with_access "(" id? ")" ":" id "=" positive_integer ";" -cluster: cluster_side "cluster"i id "=" positive_integer "{" (enum|bitmap|event|attribute|struct|request_struct|response_struct|command)* "}" +cluster: [maturity] cluster_side "cluster"i id "=" positive_integer "{" cluster_content* "}" ?cluster_side: "server"i -> server_cluster | "client"i -> client_cluster +?cluster_content: [maturity] (enum|bitmap|event|attribute|struct|request_struct|response_struct|command) endpoint: "endpoint"i positive_integer "{" endpoint_content* "}" ?endpoint_content: endpoint_cluster_binding | endpoint_server_cluster | endpoint_device_type @@ -79,13 +88,13 @@ bool_default: "true"i -> bool_default_true | "false"i -> bool_default_false ?default_value: "default"i "=" (integer | ESCAPED_STRING | bool_default) -constant_entry: id "=" positive_integer ";" +constant_entry: [maturity] id "=" positive_integer ";" positive_integer: POSITIVE_INTEGER | HEX_INTEGER negative_integer: "-" positive_integer integer: positive_integer | negative_integer -struct_field: member_attribute* field +struct_field: [maturity] member_attribute* field member_attribute: "optional"i -> optional | "nullable"i -> nullable diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py index ec2dfcbf28293e..ee165409c1164e 100755 --- a/scripts/py_matter_idl/matter_idl/matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_parser.py @@ -18,11 +18,11 @@ from matter_idl.matter_idl_types import AccessPrivilege -from matter_idl.matter_idl_types import (Attribute, AttributeInstantiation, AttributeOperation, AttributeQuality, AttributeStorage, - Bitmap, Cluster, ClusterSide, Command, CommandInstantiation, CommandQuality, ConstantEntry, - DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, - FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructQuality, - StructTag) +from matter_idl.matter_idl_types import (ApiMaturity, Attribute, AttributeInstantiation, AttributeOperation, AttributeQuality, + AttributeStorage, Bitmap, Cluster, ClusterSide, Command, CommandInstantiation, + CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, + EventQuality, Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, + StructQuality, StructTag) def UnionOfAllFlags(flags_list): @@ -158,6 +158,18 @@ def bool_default_true(self, _): def bool_default_false(self, _): return False + def provisional_api_maturity(self, _): + return ApiMaturity.PROVISIONAL + + def internal_api_maturity(self, _): + return ApiMaturity.INTERNAL + + def deprecated_api_maturity(self, _): + return ApiMaturity.DEPRECATED + + def stable_api_maturity(self, _): + return ApiMaturity.STABLE + def id(self, tokens): """An id is a string containing an identifier """ @@ -182,8 +194,10 @@ def data_type(self, tokens): raise Exception("Unexpected size for data type") @v_args(inline=True) - def constant_entry(self, id, number): - return ConstantEntry(name=id, code=number) + def constant_entry(self, api_maturity, id, number): + if api_maturity is None: + api_maturity = ApiMaturity.STABLE + return ConstantEntry(name=id, code=number, api_maturity=api_maturity) @v_args(inline=True) def enum(self, id, type, *entries): @@ -255,7 +269,9 @@ def struct_field(self, args): # Last argument is the named_member, the rest # are qualities field = args[-1] - field.qualities = UnionOfAllFlags(args[:-1]) or FieldQuality.NONE + field.qualities = UnionOfAllFlags(args[1:-1]) or FieldQuality.NONE + if args[0] is not None: + field.api_maturity = args[0] return field @v_args(meta=True) @@ -454,15 +470,25 @@ def endpoint_server_cluster(self, meta, id, *content): return AddServerClusterToEndpointTransform( ServerClusterInstantiation(parse_meta=meta, name=id, attributes=attributes, events_emitted=events, commands=commands)) + @v_args(inline=True) + def cluster_content(self, api_maturity, element): + if api_maturity is not None: + element.api_maturity = api_maturity + return element + @v_args(inline=True, meta=True) - def cluster(self, meta, side, name, code, *content): + def cluster(self, meta, api_maturity, side, name, code, *content): meta = None if self.skip_meta else ParseMetaData(meta) # shift actual starting position where the doc comment would start if meta and self._cluster_start_pos: meta.start_pos = self._cluster_start_pos - result = Cluster(parse_meta=meta, side=side, name=name, code=code) + if api_maturity is None: + api_maturity = ApiMaturity.STABLE + + result = Cluster(parse_meta=meta, side=side, name=name, + code=code, api_maturity=api_maturity) for item in content: if type(item) == Enum: diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index d5e2d1a513f694..2067cc4c58dab6 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -5,8 +5,16 @@ from lark.tree import Meta +class ApiMaturity(enum.Enum): + STABLE = enum.auto() # default + PROVISIONAL = enum.auto() + INTERNAL = enum.auto() + DEPRECATED = enum.auto() + # Information about parsing location for specific items # Helpful when referencing data items in logs when processing + + @dataclass class ParseMetaData: line: Optional[int] @@ -114,6 +122,7 @@ class Field: name: str is_list: bool = False qualities: FieldQuality = FieldQuality.NONE + api_maturity: ApiMaturity = ApiMaturity.STABLE @property def is_optional(self): @@ -131,6 +140,7 @@ class Attribute: readacl: AccessPrivilege = AccessPrivilege.VIEW writeacl: AccessPrivilege = AccessPrivilege.OPERATE default: Optional[Union[str, int]] = None + api_maturity: ApiMaturity = ApiMaturity.STABLE @property def is_readable(self): @@ -156,6 +166,7 @@ class Struct: tag: Optional[StructTag] = None code: Optional[int] = None # for responses only qualities: StructQuality = StructQuality.NONE + api_maturity: ApiMaturity = ApiMaturity.STABLE @dataclass @@ -167,6 +178,7 @@ class Event: readacl: AccessPrivilege = AccessPrivilege.VIEW qualities: EventQuality = EventQuality.NONE description: Optional[str] = None + api_maturity: ApiMaturity = ApiMaturity.STABLE @property def is_fabric_sensitive(self): @@ -177,6 +189,7 @@ def is_fabric_sensitive(self): class ConstantEntry: name: str code: int + api_maturity: ApiMaturity = ApiMaturity.STABLE @dataclass @@ -184,6 +197,7 @@ class Enum: name: str base_type: str entries: List[ConstantEntry] + api_maturity: ApiMaturity = ApiMaturity.STABLE @dataclass @@ -191,6 +205,7 @@ class Bitmap: name: str base_type: str entries: List[ConstantEntry] + api_maturity: ApiMaturity = ApiMaturity.STABLE @dataclass @@ -202,6 +217,7 @@ class Command: qualities: CommandQuality = CommandQuality.NONE invokeacl: AccessPrivilege = AccessPrivilege.OPERATE description: Optional[str] = None + api_maturity: ApiMaturity = ApiMaturity.STABLE # Parsing meta data missing only when skip meta data is requested parse_meta: Optional[ParseMetaData] = field(default=None) @@ -223,6 +239,7 @@ class Cluster: structs: List[Struct] = field(default_factory=list) commands: List[Command] = field(default_factory=list) description: Optional[str] = None + api_maturity: ApiMaturity = ApiMaturity.STABLE # Parsing meta data missing only when skip meta data is requested parse_meta: Optional[ParseMetaData] = field(default=None) diff --git a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py index 2c14767b05bb61..3196f191e19805 100755 --- a/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_matter_idl_parser.py @@ -26,10 +26,11 @@ import unittest -from matter_idl.matter_idl_types import (AccessPrivilege, Attribute, AttributeInstantiation, AttributeQuality, AttributeStorage, - Bitmap, Cluster, ClusterSide, Command, CommandInstantiation, CommandQuality, ConstantEntry, - DataType, DeviceType, Endpoint, Enum, Event, EventPriority, EventQuality, Field, - FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, StructTag) +from matter_idl.matter_idl_types import (AccessPrivilege, ApiMaturity, Attribute, AttributeInstantiation, AttributeQuality, + AttributeStorage, Bitmap, Cluster, ClusterSide, Command, CommandInstantiation, + CommandQuality, ConstantEntry, DataType, DeviceType, Endpoint, Enum, Event, EventPriority, + EventQuality, Field, FieldQuality, Idl, ParseMetaData, ServerClusterInstantiation, Struct, + StructTag) def parseText(txt, skip_meta=True): @@ -298,6 +299,232 @@ def test_cluster_enum(self): )]) self.assertEqual(actual, expected) + def test_event_field_api_maturity(self): + actual = parseText(""" + server cluster MaturityTest = 1 { + critical event TestEvent = 123 { + nullable int16u someStableMember = 0; + provisional nullable int16u someProvisionalMember = 1; + internal nullable int16u someInternalMember = 2; + } + } + """) + expected = Idl(clusters=[ + Cluster(side=ClusterSide.SERVER, + name="MaturityTest", + code=1, + events=[ + Event(priority=EventPriority.CRITICAL, name="TestEvent", code=123, fields=[ + Field(name="someStableMember", code=0, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE), + Field(name="someProvisionalMember", code=1, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE, api_maturity=ApiMaturity.PROVISIONAL), + Field(name="someInternalMember", code=2, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE, api_maturity=ApiMaturity.INTERNAL), + + ]), + ], + )]) + self.assertEqual(actual, expected) + + def test_enum_constant_maturity(self): + actual = parseText(""" + client cluster WithEnums = 0xab { + enum TestEnum : ENUM16 { + kStable = 0x123; + provisional kProvisional = 0x234; + internal kInternal = 0x345; + } + } + """) + expected = Idl(clusters=[ + Cluster(side=ClusterSide.CLIENT, + name="WithEnums", + code=0xab, + enums=[ + Enum(name="TestEnum", base_type="ENUM16", + entries=[ + ConstantEntry(name="kStable", code=0x123), + ConstantEntry( + name="kProvisional", code=0x234, api_maturity=ApiMaturity.PROVISIONAL), + ConstantEntry( + name="kInternal", code=0x345, api_maturity=ApiMaturity.INTERNAL), + ])], + )]) + self.assertEqual(actual, expected) + + def test_bitmap_constant_maturity(self): + actual = parseText(""" + client cluster Test = 0xab { + bitmap TestBitmap : BITMAP32 { + kStable = 0x1; + internal kInternal = 0x2; + provisional kProvisional = 0x4; + } + } + """) + expected = Idl(clusters=[ + Cluster(side=ClusterSide.CLIENT, + name="Test", + code=0xab, + bitmaps=[ + Bitmap(name="TestBitmap", base_type="BITMAP32", + entries=[ + ConstantEntry(name="kStable", code=0x1), + ConstantEntry( + name="kInternal", code=0x2, api_maturity=ApiMaturity.INTERNAL), + ConstantEntry( + name="kProvisional", code=0x4, api_maturity=ApiMaturity.PROVISIONAL), + ])], + )]) + self.assertEqual(actual, expected) + + def test_struct_field_api_maturity(self): + actual = parseText(""" + server cluster MaturityTest = 1 { + struct TestStruct { + nullable int16u someStableMember = 0; + provisional nullable int16u someProvisionalMember = 1; + internal nullable int16u someInternalMember = 2; + } + } + """) + expected = Idl(clusters=[ + Cluster(side=ClusterSide.SERVER, + name="MaturityTest", + code=1, + structs=[ + Struct(name="TestStruct", fields=[ + Field(name="someStableMember", code=0, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE), + Field(name="someProvisionalMember", code=1, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE, api_maturity=ApiMaturity.PROVISIONAL), + Field(name="someInternalMember", code=2, data_type=DataType( + name="int16u"), qualities=FieldQuality.NULLABLE, api_maturity=ApiMaturity.INTERNAL), + + ]), + ], + )]) + self.assertEqual(actual, expected) + + def test_cluster_entry_maturity(self): + actual = parseText(""" + client cluster Test = 0xab { + enum StableEnum : ENUM16 {} + provisional enum ProvisionalEnum : ENUM16 {} + internal enum InternalEnum : ENUM16 {} + deprecated enum DeprecatedEnum : ENUM16 {} + + bitmap StableBitmap : BITMAP32 {} + provisional bitmap ProvisionalBitmap : BITMAP32 {} + internal bitmap InternalBitmap : BITMAP32 {} + + struct StableStruct {} + provisional struct ProvisionalStruct {} + internal struct InternalStruct {} + + info event StableEvent = 1 {} + provisional info event ProvisionalEvent = 2 {} + internal info event InternalEvent = 3 {} + + request struct StableCommandRequest {} + response struct StableCommandResponse = 200 {} + + provisional request struct ProvisionalCommandRequest {} + provisional response struct ProvisionalCommandResponse = 201 {} + + internal request struct InternalCommandRequest {} + internal response struct InternalCommandResponse = 202 {} + + command StableCommand(StableCommandRequest): StableCommandResponse = 100; + provisional command ProvisionalCommand(ProvisionalCommandRequest): ProvisionalCommandResponse = 101; + internal command InternalCommand(InternalCommandRequest): InternalCommandResponse = 102; + + readonly attribute int8u roStable = 1; + attribute int32u rwStable[] = 2; + provisional readonly attribute int8u roProvisional = 11; + provisional attribute int32u rwProvisional[] = 12; + internal readonly attribute int8u roInternal = 21; + internal attribute int32u rwInternal[] = 22; + stable attribute int32u rwForcedStable[] = 31; + } + """) + expected = Idl(clusters=[ + Cluster(side=ClusterSide.CLIENT, + name="Test", + code=0xab, + enums=[ + Enum(name="StableEnum", base_type="ENUM16", entries=[]), + Enum(name="ProvisionalEnum", base_type="ENUM16", + entries=[], api_maturity=ApiMaturity.PROVISIONAL), + Enum(name="InternalEnum", base_type="ENUM16", + entries=[], api_maturity=ApiMaturity.INTERNAL), + Enum(name="DeprecatedEnum", base_type="ENUM16", + entries=[], api_maturity=ApiMaturity.DEPRECATED), + ], + bitmaps=[ + Bitmap(name="StableBitmap", + base_type="BITMAP32", entries=[]), + Bitmap(name="ProvisionalBitmap", base_type="BITMAP32", + entries=[], api_maturity=ApiMaturity.PROVISIONAL), + Bitmap(name="InternalBitmap", base_type="BITMAP32", + entries=[], api_maturity=ApiMaturity.INTERNAL), + ], + structs=[ + Struct(name="StableStruct", fields=[]), + Struct(name="ProvisionalStruct", fields=[], + api_maturity=ApiMaturity.PROVISIONAL), + Struct(name="InternalStruct", fields=[], + api_maturity=ApiMaturity.INTERNAL), + + Struct(name="StableCommandRequest", + fields=[], tag=StructTag.REQUEST), + Struct(name="StableCommandResponse", fields=[], + tag=StructTag.RESPONSE, code=200), + Struct(name="ProvisionalCommandRequest", fields=[ + ], tag=StructTag.REQUEST, api_maturity=ApiMaturity.PROVISIONAL), + Struct(name="ProvisionalCommandResponse", fields=[ + ], tag=StructTag.RESPONSE, code=201, api_maturity=ApiMaturity.PROVISIONAL), + Struct(name="InternalCommandRequest", fields=[ + ], tag=StructTag.REQUEST, api_maturity=ApiMaturity.INTERNAL), + Struct(name="InternalCommandResponse", fields=[ + ], tag=StructTag.RESPONSE, code=202, api_maturity=ApiMaturity.INTERNAL), + ], + events=[ + Event(priority=EventPriority.INFO, + name="StableEvent", code=1, fields=[]), + Event(priority=EventPriority.INFO, name="ProvisionalEvent", + code=2, fields=[], api_maturity=ApiMaturity.PROVISIONAL), + Event(priority=EventPriority.INFO, name="InternalEvent", + code=3, fields=[], api_maturity=ApiMaturity.INTERNAL), + ], + commands=[ + Command(name="StableCommand", code=100, input_param="StableCommandRequest", + output_param="StableCommandResponse"), + Command(name="ProvisionalCommand", code=101, input_param="ProvisionalCommandRequest", + output_param="ProvisionalCommandResponse", api_maturity=ApiMaturity.PROVISIONAL), + Command(name="InternalCommand", code=102, input_param="InternalCommandRequest", + output_param="InternalCommandResponse", api_maturity=ApiMaturity.INTERNAL), + ], + attributes=[ + Attribute(qualities=AttributeQuality.READABLE, definition=Field( + data_type=DataType(name="int8u"), code=1, name="roStable")), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=2, name="rwStable", is_list=True)), + Attribute(qualities=AttributeQuality.READABLE, definition=Field( + data_type=DataType(name="int8u"), code=11, name="roProvisional"), api_maturity=ApiMaturity.PROVISIONAL), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=12, name="rwProvisional", is_list=True), api_maturity=ApiMaturity.PROVISIONAL), + Attribute(qualities=AttributeQuality.READABLE, definition=Field( + data_type=DataType(name="int8u"), code=21, name="roInternal"), api_maturity=ApiMaturity.INTERNAL), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=22, name="rwInternal", is_list=True), api_maturity=ApiMaturity.INTERNAL), + Attribute(qualities=AttributeQuality.READABLE | AttributeQuality.WRITABLE, definition=Field( + data_type=DataType(name="int32u"), code=31, name="rwForcedStable", is_list=True), api_maturity=ApiMaturity.STABLE), + ] + )]) + self.assertEqual(actual, expected) + def test_cluster_bitmap(self): actual = parseText(""" client cluster Test = 0xab { @@ -501,6 +728,22 @@ def test_multi_endpoints(self): ]) self.assertEqual(actual, expected) + def test_cluster_api_maturity(self): + actual = parseText(""" + provisional server cluster A = 1 { /* Test comment */ } + internal client cluster B = 2 { } + client cluster C = 3 { } + """) + + expected = Idl(clusters=[ + Cluster(side=ClusterSide.SERVER, name="A", code=1, + api_maturity=ApiMaturity.PROVISIONAL), + Cluster(side=ClusterSide.CLIENT, name="B", code=2, + api_maturity=ApiMaturity.INTERNAL), + Cluster(side=ClusterSide.CLIENT, name="C", code=3), + ]) + self.assertEqual(actual, expected) + def test_emits_events(self): actual = parseText(""" endpoint 1 { diff --git a/scripts/py_matter_yamltests/matter_yamltests/constraints.py b/scripts/py_matter_yamltests/matter_yamltests/constraints.py index 88b0d518393e51..69a04b190f6fe5 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/constraints.py +++ b/scripts/py_matter_yamltests/matter_yamltests/constraints.py @@ -689,20 +689,53 @@ def get_reason(self, value, value_type_name) -> str: return f'The response value ({value}) should be lower or equal to the constraint but {value} > {self._max_value}.' +def _values_match(expected_value, received_value): + # TODO: This is a copy of _response_value_validation over in parser.py, + # but with the recursive calls renamed. + if isinstance(expected_value, list): + if len(expected_value) != len(received_value): + return False + + for index, expected_item in enumerate(expected_value): + received_item = received_value[index] + if not _values_match(expected_item, received_item): + return False + return True + elif isinstance(expected_value, dict): + for key, expected_item in expected_value.items(): + received_item = received_value.get(key) + if not _values_match(expected_item, received_item): + return False + return True + else: + return expected_value == received_value + + class _ConstraintContains(BaseConstraint): def __init__(self, context, contains): super().__init__(context, types=[list]) self._contains = contains + def _find_missing_values(self, expected_values, received_values): + # Make a copy of received_values, so that we can remove things from the + # list as they match up against our expected values. + received_values = list(received_values) + missing_values = [] + for expected_value in expected_values: + for index, received_value in enumerate(received_values): + if _values_match(expected_value, received_value): + # We've used up this received value + del received_values[index] + break + else: + missing_values.append(expected_value) + return missing_values + def check_response(self, value, value_type_name) -> bool: - return set(self._contains).issubset(value) + return len(self._find_missing_values(self._contains, value)) == 0 def get_reason(self, value, value_type_name) -> str: - expected_values = [] - - for expected_value in self._contains: - if expected_value not in value: - expected_values.append(expected_value) + expected_values = self._find_missing_values(self._contains, value) return f'The response ({value}) is missing {expected_values}.' @@ -713,14 +746,19 @@ def __init__(self, context, excludes): self._excludes = excludes def check_response(self, value, value_type_name) -> bool: - return set(self._excludes).isdisjoint(value) + for expected_value in self._excludes: + for received_value in value: + if _values_match(expected_value, received_value): + return False + return True def get_reason(self, value, value_type_name) -> str: unexpected_values = [] for unexpected_value in self._excludes: - if unexpected_value in value: - unexpected_values.append(unexpected_value) + for received_value in value: + if _values_match(unexpected_value, received_value): + unexpected_values.append(unexpected_value) return f'The response ({value}) contains {unexpected_values}.' diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index ec4462b4359dd3..01898641a1591f 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -595,6 +595,8 @@ def __init__(self, test: _TestStepWithPlaceholders, step_index: int, runtime_con self._test.endpoint) self._test.group_id = self._config_variable_substitution( self._test.group_id) + self._test.node_id = self._config_variable_substitution( + self._test.node_id) test.update_arguments(self.arguments) test.update_responses(self.responses) diff --git a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py index aba73157e1aa9f..01b9e040f3efd8 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py +++ b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py @@ -89,7 +89,7 @@ def __check_test_step(self, config: dict, content): schema = { 'label': str, 'identity': str, - 'nodeId': int, + 'nodeId': (int, str), # Can be a variable. 'runIf': str, # Should be a variable. 'groupId': (int, str), # Can be a variable. 'endpoint': (int, str), # Can be a variable diff --git a/scripts/py_matter_yamltests/test_yaml_loader.py b/scripts/py_matter_yamltests/test_yaml_loader.py index 41929d95747306..a1739faf49cb58 100644 --- a/scripts/py_matter_yamltests/test_yaml_loader.py +++ b/scripts/py_matter_yamltests/test_yaml_loader.py @@ -246,7 +246,6 @@ def test_key_tests_step_int_keys(self): content = ('tests:\n' ' - {key}: {value}') keys = [ - 'nodeId', 'minInterval', 'maxInterval', 'timedInteractionTimeoutMs', @@ -340,6 +339,23 @@ def test_key_tests_step_group_id_key(self): x = content.format(value=value) self.assertRaises(TestStepInvalidTypeError, load, x) + def test_key_tests_step_node_id_key(self): + load = YamlLoader().load + + content = ('tests:\n' + ' - nodeId: {value}') + + _, _, _, _, tests = load(content.format(value=1)) + self.assertEqual(tests, [{'nodeId': 1}]) + + _, _, _, _, tests = load(content.format(value='TestKey')) + self.assertEqual(tests, [{'nodeId': 'TestKey'}]) + + wrong_values = self._get_wrong_values([str, int], spaces=6) + for value in wrong_values: + x = content.format(value=value) + self.assertRaises(TestStepInvalidTypeError, load, x) + def test_key_tests_step_event_number_key(self): load = YamlLoader().load diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index cd81f89f631595..6441453d10d724 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.10.04-nightly.1"] + "tags": ["version:2@v2023.10.09-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.10.04-nightly.1"] + "tags": ["version:2@v2023.10.09-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 30b95d2b000653..62285c8a118cb4 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.10.04-nightly +v2023.10.09-nightly diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 039211fb318fc0..5e71e8565d6e00 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -534,9 +534,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000001, 8, ZAP_TYPE(INT64U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapFree */ \ { ZAP_EMPTY_DEFAULT(), 0x00000002, 8, ZAP_TYPE(INT64U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapUsed */ \ { ZAP_EMPTY_DEFAULT(), 0x00000003, 8, ZAP_TYPE(INT64U), \ - ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapHighWatermark */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapHighWatermark */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 2, ZAP_TYPE(INT16U), \ @@ -716,9 +716,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupsPerFabric */ \ { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), \ - ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupKeysPerFabric */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupKeysPerFabric */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFD, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* LabelList */ \ @@ -2188,7 +2188,7 @@ .clusterId = 0x00000034, \ .attributes = ZAP_ATTRIBUTE_INDEX(102), \ .attributeCount = 6, \ - .clusterSize = 6, \ + .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 42 ), \ @@ -2266,7 +2266,7 @@ .clusterId = 0x0000003F, \ .attributes = ZAP_ATTRIBUTE_INDEX(212), \ .attributeCount = 6, \ - .clusterSize = 6, \ + .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 68 ), \ @@ -3024,7 +3024,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 27, 355 }, { ZAP_CLUSTER_INDEX(27), 44, 3492 }, { ZAP_CLUSTER_INDEX(71), 7, 127 }, \ + { ZAP_CLUSTER_INDEX(0), 27, 345 }, { ZAP_CLUSTER_INDEX(27), 44, 3492 }, { ZAP_CLUSTER_INDEX(71), 7, 127 }, \ { ZAP_CLUSTER_INDEX(78), 2, 4 }, \ } @@ -3037,7 +3037,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 (3978) +#define ATTRIBUTE_MAX_SIZE (3968) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h index de91e763395913..5b661323d1ff21 100644 --- a/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/lighting-app/app-templates/endpoint_config.h @@ -110,7 +110,7 @@ { ZAP_EMPTY_DEFAULT(), 0x00000004, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* AccessControlEntriesPerFabric */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFD, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Basic Information (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 2, ZAP_TYPE(INT16U), \ @@ -232,9 +232,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000001, 8, ZAP_TYPE(INT64U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapFree */ \ { ZAP_EMPTY_DEFAULT(), 0x00000002, 8, ZAP_TYPE(INT64U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapUsed */ \ { ZAP_EMPTY_DEFAULT(), 0x00000003, 8, ZAP_TYPE(INT64U), \ - ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapHighWatermark */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* CurrentHeapHighWatermark */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */ \ + { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Thread Network Diagnostics (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 2, ZAP_TYPE(INT16U), \ @@ -418,9 +418,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupsPerFabric */ \ { ZAP_EMPTY_DEFAULT(), 0x00000003, 2, ZAP_TYPE(INT16U), \ - ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupKeysPerFabric */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* MaxGroupKeysPerFabric */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* FeatureMap */ \ + { ZAP_EMPTY_DEFAULT(), 0x0000FFFD, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ClusterRevision */ \ \ /* Endpoint: 0, Cluster: Fixed Label (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* LabelList */ \ @@ -798,7 +798,7 @@ .clusterId = 0x0000001F, \ .attributes = ZAP_ATTRIBUTE_INDEX(9), \ .attributeCount = 7, \ - .clusterSize = 6, \ + .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = nullptr, \ @@ -928,7 +928,7 @@ .clusterId = 0x00000034, \ .attributes = ZAP_ATTRIBUTE_INDEX(83), \ .attributeCount = 6, \ - .clusterSize = 6, \ + .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 39 ), \ @@ -1019,7 +1019,7 @@ .clusterId = 0x0000003F, \ .attributes = ZAP_ATTRIBUTE_INDEX(195), \ .attributeCount = 6, \ - .clusterSize = 6, \ + .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 65 ), \ @@ -1153,7 +1153,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 22, 251 }, { ZAP_CLUSTER_INDEX(22), 7, 109 }, \ + { ZAP_CLUSTER_INDEX(0), 22, 239 }, { ZAP_CLUSTER_INDEX(22), 7, 109 }, \ } // Largest attribute size is needed for various buffers @@ -1165,7 +1165,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 (360) +#define ATTRIBUTE_MAX_SIZE (348) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (2) diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 95e421b6b6a30b..2f6098a3184d2e 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.10.4' +MIN_ZAP_VERSION = '2023.10.9' class ZapTool: diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index a0159708922b8c..efffda6fed4735 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -238,7 +238,7 @@ static_library("app") { ":app_config", "${chip_root}/src/access", "${chip_root}/src/app/icd:notifier", - "${chip_root}/src/app/icd:observer-srcs", + "${chip_root}/src/app/icd:observer", "${chip_root}/src/lib/address_resolve", "${chip_root}/src/lib/support", "${chip_root}/src/messaging", @@ -248,7 +248,7 @@ static_library("app") { ] if (chip_enable_icd_server) { - public_deps += [ "${chip_root}/src/app/icd:manager-srcs" ] + public_deps += [ "${chip_root}/src/app/icd:manager" ] } cflags = [ "-Wconversion" ] diff --git a/src/app/ReadHandler.cpp b/src/app/ReadHandler.cpp index 9339a08fae7cab..6bd8072425cf42 100644 --- a/src/app/ReadHandler.cpp +++ b/src/app/ReadHandler.cpp @@ -35,7 +35,7 @@ #include #if CHIP_CONFIG_ENABLE_ICD_SERVER -#include // nogncheck +#include // nogncheck #endif namespace chip { @@ -45,7 +45,7 @@ using Status = Protocols::InteractionModel::Status; uint16_t ReadHandler::GetPublisherSelectedIntervalLimit() { #if CHIP_CONFIG_ENABLE_ICD_SERVER - return static_cast(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()); + return static_cast(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); #else return kSubscriptionMaxIntervalPublisherLimit; #endif diff --git a/src/app/chip_data_model.cmake b/src/app/chip_data_model.cmake index fb18dd8b16c5fc..89cbee6a4cca8c 100644 --- a/src/app/chip_data_model.cmake +++ b/src/app/chip_data_model.cmake @@ -1,17 +1,17 @@ # -# Copyright (c) 2020 Project CHIP Authors +# Copyright (c) 2020 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 +# 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 +# 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. +# 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. # set(CHIP_APP_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) @@ -32,7 +32,7 @@ function(chip_configure_zap_file APP_TARGET ZAP_FILE EXTERNAL_CLUSTERS) find_package(Python3 REQUIRED) set(args --zap_file ${ZAP_FILE}) - if (EXTERNAL_CLUSTERS) + if(EXTERNAL_CLUSTERS) list(APPEND args --external-clusters ${EXTERNAL_CLUSTERS}) endif() @@ -42,11 +42,13 @@ function(chip_configure_zap_file APP_TARGET ZAP_FILE EXTERNAL_CLUSTERS) ERROR_VARIABLE ERROR_MESSAGE RESULT_VARIABLE RC ) - if (NOT RC EQUAL 0) + + if(NOT RC EQUAL 0) message(FATAL_ERROR "Failed to execute zap_cluster_list.py: ${ERROR_MESSAGE}") endif() string(REPLACE "\n" ";" CLUSTER_LIST "${CLUSTER_LIST}") + foreach(CLUSTER ${CLUSTER_LIST}) chip_configure_cluster(${APP_TARGET} ${CLUSTER}) endforeach() @@ -55,26 +57,26 @@ endfunction() # # Configure ${APP_TARGET} based on the selected data model configuration. # Available options are: -# SCOPE CMake scope keyword that defines the scope of included sources. -# The default is PRIVATE scope. -# INCLUDE_SERVER Include source files from src/app/server directory. -# ZAP_FILE Path to the ZAP file, used to determine the list of clusters -# supported by the application. -# IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE -# if not provided -# EXTERNAL_CLUSTERS Clusters with external implementations. The default implementations -# will not be used nor required for these clusters. -# Format: MY_CUSTOM_CLUSTER'. +# SCOPE CMake scope keyword that defines the scope of included sources. +# The default is PRIVATE scope. +# INCLUDE_SERVER Include source files from src/app/server directory. +# ZAP_FILE Path to the ZAP file, used to determine the list of clusters +# supported by the application. +# IDL .matter IDL file to use for codegen. Inferred from ZAP_FILE +# if not provided +# EXTERNAL_CLUSTERS Clusters with external implementations. The default implementations +# will not be used nor required for these clusters. +# Format: MY_CUSTOM_CLUSTER'. # function(chip_configure_data_model APP_TARGET) set(SCOPE PRIVATE) cmake_parse_arguments(ARG "INCLUDE_SERVER" "SCOPE;ZAP_FILE;IDL" "EXTERNAL_CLUSTERS" ${ARGN}) - if (ARG_SCOPE) + if(ARG_SCOPE) set(SCOPE ${ARG_SCOPE}) endif() - if (ARG_INCLUDE_SERVER) + if(ARG_INCLUDE_SERVER) target_sources(${APP_TARGET} ${SCOPE} ${CHIP_APP_BASE_DIR}/server/AclStorage.cpp ${CHIP_APP_BASE_DIR}/server/DefaultAclStorage.cpp @@ -86,26 +88,27 @@ function(chip_configure_data_model APP_TARGET) ) target_compile_options(${APP_TARGET} ${SCOPE} - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" ) endif() - if (ARG_ZAP_FILE) + if(ARG_ZAP_FILE) chip_configure_zap_file(${APP_TARGET} ${ARG_ZAP_FILE} "${ARG_EXTERNAL_CLUSTERS}") - if (NOT ARG_IDL) + + if(NOT ARG_IDL) string(REPLACE ".zap" ".matter" ARG_IDL ${ARG_ZAP_FILE}) endif() endif() - if (ARG_IDL) + if(ARG_IDL) chip_codegen(${APP_TARGET}-codegen - INPUT "${ARG_IDL}" - GENERATOR "cpp-app" - OUTPUTS - "app/PluginApplicationCallbacks.h" - "app/callback-stub.cpp" - OUTPUT_PATH APP_GEN_DIR - OUTPUT_FILES APP_GEN_FILES + INPUT "${ARG_IDL}" + GENERATOR "cpp-app" + OUTPUTS + "app/PluginApplicationCallbacks.h" + "app/callback-stub.cpp" + OUTPUT_PATH APP_GEN_DIR + OUTPUT_FILES APP_GEN_FILES ) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_GEN_DIR}") @@ -115,16 +118,16 @@ function(chip_configure_data_model APP_TARGET) endif() chip_zapgen(${APP_TARGET}-zapgen - INPUT "${ARG_ZAP_FILE}" + INPUT "${ARG_ZAP_FILE}" GENERATOR "app-templates" OUTPUTS - "zap-generated/access.h" - "zap-generated/CHIPClusters.h" - "zap-generated/endpoint_config.h" - "zap-generated/gen_config.h" - "zap-generated/IMClusterCommandHandler.cpp" - OUTPUT_PATH APP_TEMPLATES_GEN_DIR - OUTPUT_FILES APP_TEMPLATES_GEN_FILES + "zap-generated/access.h" + "zap-generated/CHIPClusters.h" + "zap-generated/endpoint_config.h" + "zap-generated/gen_config.h" + "zap-generated/IMClusterCommandHandler.cpp" + OUTPUT_PATH APP_TEMPLATES_GEN_DIR + OUTPUT_FILES APP_TEMPLATES_GEN_FILES ) target_include_directories(${APP_TARGET} ${SCOPE} "${APP_TEMPLATES_GEN_DIR}") add_dependencies(${APP_TARGET} ${APP_TARGET}-zapgen) @@ -136,8 +139,8 @@ function(chip_configure_data_model APP_TARGET) ${CHIP_APP_BASE_DIR}/util/attribute-storage.cpp ${CHIP_APP_BASE_DIR}/util/attribute-table.cpp ${CHIP_APP_BASE_DIR}/util/binding-table.cpp - ${CHIP_APP_BASE_DIR}/icd/IcdMonitoringTable.cpp - ${CHIP_APP_BASE_DIR}/icd/IcdManagementServer.cpp + ${CHIP_APP_BASE_DIR}/icd/ICDMonitoringTable.cpp + ${CHIP_APP_BASE_DIR}/icd/ICDManagementServer.cpp ${CHIP_APP_BASE_DIR}/util/DataModelHandler.cpp ${CHIP_APP_BASE_DIR}/util/ember-compatibility-functions.cpp ${CHIP_APP_BASE_DIR}/util/generic-callback-stubs.cpp diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 54abef97926e04..550c8fbf9ccb1b 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -289,7 +289,7 @@ template("chip_data_model") { } else if (cluster == "icd-management-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp" ] - deps += [ "${chip_root}/src/app/icd:cluster-srcs" ] + deps += [ "${chip_root}/src/app/icd:cluster" ] } else if (cluster == "resource-monitoring-server") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", diff --git a/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerDelegate.cpp b/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerDelegate.cpp index 41062c7cb4fe21..6c50b581e397d7 100644 --- a/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerDelegate.cpp +++ b/src/app/clusters/general-diagnostics-server/GenericFaultTestEventTriggerDelegate.cpp @@ -53,13 +53,14 @@ CHIP_ERROR GenericFaultTestEventTriggerDelegate::HandleEventTrigger(uint64_t eve GeneralFaults radioFaultsPrevious; GeneralFaults radioFaultsCurrent; - ReturnErrorOnFailure(radioFaultsPrevious.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnErrorOnFailure(radioFaultsPrevious.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - - ReturnErrorOnFailure(radioFaultsCurrent.add(EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT)); - ReturnErrorOnFailure(radioFaultsCurrent.add(EMBER_ZCL_RADIO_FAULT_ENUM_CELLULAR_FAULT)); - ReturnErrorOnFailure(radioFaultsCurrent.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnErrorOnFailure(radioFaultsCurrent.add(EMBER_ZCL_RADIO_FAULT_ENUM_NFC_FAULT)); + using app::Clusters::GeneralDiagnostics::RadioFaultEnum; + ReturnErrorOnFailure(radioFaultsPrevious.add(to_underlying(RadioFaultEnum::kWiFiFault))); + ReturnErrorOnFailure(radioFaultsPrevious.add(to_underlying(RadioFaultEnum::kThreadFault))); + + ReturnErrorOnFailure(radioFaultsCurrent.add(to_underlying(RadioFaultEnum::kWiFiFault))); + ReturnErrorOnFailure(radioFaultsCurrent.add(to_underlying(RadioFaultEnum::kCellularFault))); + ReturnErrorOnFailure(radioFaultsCurrent.add(to_underlying(RadioFaultEnum::kThreadFault))); + ReturnErrorOnFailure(radioFaultsCurrent.add(to_underlying(RadioFaultEnum::kNFCFault))); app::Clusters::GeneralDiagnosticsServer::Instance().OnRadioFaultsDetect(radioFaultsPrevious, radioFaultsCurrent); diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp index 10e92c833c0dbf..be5be9be59e6aa 100644 --- a/src/app/clusters/icd-management-server/icd-management-server.cpp +++ b/src/app/clusters/icd-management-server/icd-management-server.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -89,31 +89,31 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & CHIP_ERROR IcdManagementAttributeAccess::ReadIdleModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()); + return encoder.Encode(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()); } CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeInterval(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetActiveModeIntervalMs()); + return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeIntervalMs()); } CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeThreshold(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + return encoder.Encode(ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); } CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder) { - uint16_t supported_clients = IcdManagementServer::GetInstance().GetClientsSupportedPerFabric(); + uint16_t supported_clients = ICDManagementServer::GetInstance().GetClientsSupportedPerFabric(); return encoder.EncodeList([supported_clients](const auto & subEncoder) -> CHIP_ERROR { - IcdMonitoringEntry e; + ICDMonitoringEntry e; const auto & fabricTable = Server::GetInstance().GetFabricTable(); for (const auto & fabricInfo : fabricTable) { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); - IcdMonitoringTable table(storage, fabricInfo.GetFabricIndex(), supported_clients); + ICDMonitoringTable table(storage, fabricInfo.GetFabricIndex(), supported_clients); for (uint16_t i = 0; i < table.Limit(); ++i) { CHIP_ERROR err = table.Get(i, e); @@ -136,12 +136,12 @@ CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoi CHIP_ERROR IcdManagementAttributeAccess::ReadICDCounter(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetICDCounter()); + return encoder.Encode(ICDManagementServer::GetInstance().GetICDCounter()); } CHIP_ERROR IcdManagementAttributeAccess::ReadClientsSupportedPerFabric(EndpointId endpoint, AttributeValueEncoder & encoder) { - return encoder.Encode(IcdManagementServer::GetInstance().GetClientsSupportedPerFabric()); + return encoder.Encode(ICDManagementServer::GetInstance().GetClientsSupportedPerFabric()); } CHIP_ERROR CheckAdmin(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, bool & is_admin) @@ -164,8 +164,8 @@ class IcdManagementFabricDelegate : public chip::FabricTable::Delegate { void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) override { - uint16_t supported_clients = IcdManagementServer::GetInstance().GetClientsSupportedPerFabric(); - IcdMonitoringTable table(chip::Server::GetInstance().GetPersistentStorage(), fabricIndex, supported_clients); + uint16_t supported_clients = ICDManagementServer::GetInstance().GetClientsSupportedPerFabric(); + ICDMonitoringTable table(chip::Server::GetInstance().GetPersistentStorage(), fabricIndex, supported_clients); table.RemoveAll(); } }; @@ -194,7 +194,7 @@ bool emberAfIcdManagementClusterRegisterClientCallback(chip::app::CommandHandler { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - status = IcdManagementServer::GetInstance().RegisterClient(storage, fabric, commandData.checkInNodeID, + status = ICDManagementServer::GetInstance().RegisterClient(storage, fabric, commandData.checkInNodeID, commandData.monitoredSubject, commandData.key, commandData.verificationKey, is_admin); } @@ -203,7 +203,7 @@ bool emberAfIcdManagementClusterRegisterClientCallback(chip::app::CommandHandler { // Response IcdManagement::Commands::RegisterClientResponse::Type response{ .ICDCounter = - IcdManagementServer::GetInstance().GetICDCounter() }; + ICDManagementServer::GetInstance().GetICDCounter() }; commandObj->AddResponse(commandPath, response); return true; } @@ -227,7 +227,7 @@ bool emberAfIcdManagementClusterUnregisterClientCallback(chip::app::CommandHandl { PersistentStorageDelegate & storage = chip::Server::GetInstance().GetPersistentStorage(); FabricIndex fabric = commandObj->GetAccessingFabricIndex(); - status = IcdManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID, + status = ICDManagementServer::GetInstance().UnregisterClient(storage, fabric, commandData.checkInNodeID, commandData.verificationKey, is_admin); } @@ -242,7 +242,7 @@ bool emberAfIcdManagementClusterStayActiveRequestCallback(chip::app::CommandHand const chip::app::ConcreteCommandPath & commandPath, const Commands::StayActiveRequest::DecodableType & commandData) { - InteractionModel::Status status = IcdManagementServer::GetInstance().StayActiveRequest(commandObj->GetAccessingFabricIndex()); + InteractionModel::Status status = ICDManagementServer::GetInstance().StayActiveRequest(commandObj->GetAccessingFabricIndex()); commandObj->AddStatus(commandPath, status); return true; diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 40251139dae555..e62e21a9fce29b 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -6,10 +6,8 @@ WeakEnums: - ColorControlOptions - ColorMode - EnhancedColorMode - - InterfaceTypeEnum - MoveMode - PHYRateEnum - - RadioFaultEnum - StepMode CommandHandlerInterfaceOnlyClusters: diff --git a/src/app/icd/BUILD.gn b/src/app/icd/BUILD.gn index 132518887807cc..0879e296865a04 100644 --- a/src/app/icd/BUILD.gn +++ b/src/app/icd/BUILD.gn @@ -16,7 +16,7 @@ import("//build_overrides/chip.gni") import("icd.gni") # ICD Server sources and configurations -source_set("observer-srcs") { +source_set("observer") { sources = [ "ICDStateObserver.h" ] } @@ -32,28 +32,28 @@ source_set("notifier") { # ICD Manager source-set is broken out of the main source-set to enable unit tests # All sources and configurations used by the ICDManager need to go in this source-set -source_set("manager-srcs") { +source_set("manager") { sources = [ "ICDManager.cpp", "ICDManager.h", ] public_deps = [ - ":cluster-srcs", + ":cluster", ":notifier", - ":observer-srcs", + ":observer", "${chip_root}/src/credentials:credentials", ] } # ICD management cluster source-set is broken out of the main source-set to enable unit tests # All sources and configurations used by the ICD management cluster need to go in this source-set -source_set("cluster-srcs") { +source_set("cluster") { sources = [ - "IcdManagementServer.cpp", - "IcdManagementServer.h", - "IcdMonitoringTable.cpp", - "IcdMonitoringTable.h", + "ICDManagementServer.cpp", + "ICDManagementServer.h", + "ICDMonitoringTable.cpp", + "ICDMonitoringTable.h", ] public_deps = [ diff --git a/src/app/icd/IcdManagementServer.cpp b/src/app/icd/ICDManagementServer.cpp similarity index 83% rename from src/app/icd/IcdManagementServer.cpp rename to src/app/icd/ICDManagementServer.cpp index 1db9006f5f5965..c93056f8041c82 100644 --- a/src/app/icd/IcdManagementServer.cpp +++ b/src/app/icd/ICDManagementServer.cpp @@ -1,21 +1,21 @@ -#include "IcdManagementServer.h" -#include +#include "ICDManagementServer.h" +#include using namespace chip; using namespace chip::Protocols; namespace chip { -IcdManagementServer IcdManagementServer::mInstance; +ICDManagementServer ICDManagementServer::mInstance; -Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, +Status ICDManagementServer::RegisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, uint64_t monitored_subject, chip::ByteSpan key, Optional verification_key, bool is_admin) { - IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); + ICDMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); // Get current entry, if exists - IcdMonitoringEntry entry; + ICDMonitoringEntry entry; CHIP_ERROR err = table.Find(node_id, entry); if (CHIP_NO_ERROR == err) { @@ -48,13 +48,13 @@ Status IcdManagementServer::RegisterClient(PersistentStorageDelegate & storage, return InteractionModel::Status::Success; } -Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, +Status ICDManagementServer::UnregisterClient(PersistentStorageDelegate & storage, FabricIndex fabric_index, chip::NodeId node_id, Optional verificationKey, bool is_admin) { - IcdMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); + ICDMonitoringTable table(storage, fabric_index, GetClientsSupportedPerFabric()); // Get current entry, if exists - IcdMonitoringEntry entry; + ICDMonitoringEntry entry; CHIP_ERROR err = table.Find(node_id, entry); VerifyOrReturnError(CHIP_ERROR_NOT_FOUND != err, InteractionModel::Status::NotFound); VerifyOrReturnError(CHIP_NO_ERROR == err, InteractionModel::Status::Failure); @@ -72,7 +72,7 @@ Status IcdManagementServer::UnregisterClient(PersistentStorageDelegate & storage return InteractionModel::Status::Success; } -Status IcdManagementServer::StayActiveRequest(FabricIndex fabric_index) +Status ICDManagementServer::StayActiveRequest(FabricIndex fabric_index) { // TODO: Implementent stay awake logic for end device return InteractionModel::Status::UnsupportedCommand; diff --git a/src/app/icd/IcdManagementServer.h b/src/app/icd/ICDManagementServer.h similarity index 90% rename from src/app/icd/IcdManagementServer.h rename to src/app/icd/ICDManagementServer.h index cab712e3a340a2..30a38126f86fb9 100644 --- a/src/app/icd/IcdManagementServer.h +++ b/src/app/icd/ICDManagementServer.h @@ -27,7 +27,7 @@ namespace chip { using chip::Protocols::InteractionModel::Status; -class IcdManagementServer +class ICDManagementServer { public: uint32_t GetIdleModeIntervalSec() { return mIdleInterval_s; } @@ -36,9 +36,9 @@ class IcdManagementServer uint16_t GetActiveModeThresholdMs() { return mActiveThreshold_ms; } - uint32_t GetICDCounter() { return mIcdCounter; } + uint32_t GetICDCounter() { return mICDCounter; } - void SetICDCounter(uint32_t count) { mIcdCounter = count; } + void SetICDCounter(uint32_t count) { mICDCounter = count; } uint16_t GetClientsSupportedPerFabric() { return mFabricClientsSupported; } @@ -50,12 +50,12 @@ class IcdManagementServer Status StayActiveRequest(FabricIndex fabric_index); - static IcdManagementServer & GetInstance() { return mInstance; } + static ICDManagementServer & GetInstance() { return mInstance; } private: - IcdManagementServer() = default; + ICDManagementServer() = default; - static IcdManagementServer mInstance; + static ICDManagementServer mInstance; static_assert((CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC) <= 64800, "Spec requires the IdleModeInterval to be equal or inferior to 64800s."); @@ -73,7 +73,7 @@ class IcdManagementServer "Spec requires the ActiveModeThreshold to be equal or greater to 300ms."); uint16_t mActiveThreshold_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS; - uint32_t mIcdCounter = 0; + uint32_t mICDCounter = 0; static_assert((CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC) >= 1, "Spec requires the minimum of supported clients per fabric be equal or greater to 1."); diff --git a/src/app/icd/ICDManager.cpp b/src/app/icd/ICDManager.cpp index d46a166e361172..1d7199cb813b55 100644 --- a/src/app/icd/ICDManager.cpp +++ b/src/app/icd/ICDManager.cpp @@ -18,9 +18,9 @@ #include #include #include +#include #include -#include -#include +#include #include #include #include @@ -55,10 +55,10 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT mStateObserver = stateObserver; VerifyOrDie(ICDNotifier::GetInstance().Subscribe(this) == CHIP_NO_ERROR); - uint32_t activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeIntervalMs(); + uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); VerifyOrDie(kFastPollingInterval.count() < activeModeInterval); - UpdateIcdMode(); + UpdateICDMode(); UpdateOperationState(OperationalState::ActiveMode); } @@ -86,7 +86,7 @@ bool ICDManager::SupportsCheckInProtocol() return success ? ((featureMap & to_underlying(Feature::kCheckInProtocolSupport)) != 0) : false; } -void ICDManager::UpdateIcdMode() +void ICDManager::UpdateICDMode() { assertChipStackLockedByCurrentThread(); @@ -102,7 +102,7 @@ void ICDManager::UpdateIcdMode() for (const auto & fabricInfo : *mFabricTable) { // We only need 1 valid entry to ensure LIT compliance - IcdMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), 1 /*Table entry limit*/); + ICDMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), 1 /*Table entry limit*/); if (!table.IsEmpty()) { tempMode = ICDMode::LIT; @@ -131,9 +131,9 @@ void ICDManager::UpdateOperationState(OperationalState state) mOperationalState = OperationalState::IdleMode; // When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode - if (IcdManagementServer::GetInstance().GetActiveModeIntervalMs() > 0) + if (ICDManagementServer::GetInstance().GetActiveModeIntervalMs() > 0) { - uint32_t idleModeInterval = IcdManagementServer::GetInstance().GetIdleModeIntervalSec(); + uint32_t idleModeInterval = ICDManagementServer::GetInstance().GetIdleModeIntervalSec(); DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(idleModeInterval), OnIdleModeDone, this); } @@ -162,13 +162,13 @@ void ICDManager::UpdateOperationState(OperationalState state) DeviceLayer::SystemLayer().CancelTimer(OnIdleModeDone, this); mOperationalState = OperationalState::ActiveMode; - uint32_t activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeIntervalMs(); + uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs(); if (activeModeInterval == 0 && !mKeepActiveFlags.HasAny()) { // A Network Activity triggered the active mode and activeModeInterval is 0. // Stay active for at least Active Mode Threshold. - activeModeInterval = IcdManagementServer::GetInstance().GetActiveModeThresholdMs(); + activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); } DeviceLayer::SystemLayer().StartTimer(System::Clock::Timeout(activeModeInterval), OnActiveModeDone, this); @@ -187,7 +187,7 @@ void ICDManager::UpdateOperationState(OperationalState state) } else { - uint16_t activeModeThreshold = IcdManagementServer::GetInstance().GetActiveModeThresholdMs(); + uint16_t activeModeThreshold = ICDManagementServer::GetInstance().GetActiveModeThresholdMs(); DeviceLayer::SystemLayer().ExtendTimerTo(System::Clock::Timeout(activeModeThreshold), OnActiveModeDone, this); uint16_t activeModeJitterThreshold = (activeModeThreshold >= ICD_ACTIVE_TIME_JITTER_MS) ? activeModeThreshold - ICD_ACTIVE_TIME_JITTER_MS : 0; @@ -219,33 +219,33 @@ void ICDManager::SetKeepActiveModeRequirements(KeepActiveFlags flag, bool state) void ICDManager::OnIdleModeDone(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); - pIcdManager->UpdateOperationState(OperationalState::ActiveMode); + ICDManager * pICDManager = reinterpret_cast(appState); + pICDManager->UpdateOperationState(OperationalState::ActiveMode); // We only reset this flag when idle mode is complete to avoid re-triggering the check when an event brings us back to active, // which could cause a loop. - pIcdManager->mTransitionToIdleCalled = false; + pICDManager->mTransitionToIdleCalled = false; } void ICDManager::OnActiveModeDone(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); + ICDManager * pICDManager = reinterpret_cast(appState); // Don't go to idle mode when we have a keep active requirement - if (!pIcdManager->mKeepActiveFlags.HasAny()) + if (!pICDManager->mKeepActiveFlags.HasAny()) { - pIcdManager->UpdateOperationState(OperationalState::IdleMode); + pICDManager->UpdateOperationState(OperationalState::IdleMode); } } void ICDManager::OnTransitionToIdle(System::Layer * aLayer, void * appState) { - ICDManager * pIcdManager = reinterpret_cast(appState); + ICDManager * pICDManager = reinterpret_cast(appState); // OnTransitionToIdle will trigger a report message if reporting is needed, which should extend the active mode until the // ack for the report is received. - pIcdManager->mTransitionToIdleCalled = true; - pIcdManager->mStateObserver->OnTransitionToIdle(); + pICDManager->mTransitionToIdleCalled = true; + pICDManager->mStateObserver->OnTransitionToIdle(); } /* ICDListener functions. */ diff --git a/src/app/icd/ICDManager.h b/src/app/icd/ICDManager.h index 852a4b428e9411..8eb62d6f17066b 100644 --- a/src/app/icd/ICDManager.h +++ b/src/app/icd/ICDManager.h @@ -52,7 +52,7 @@ class ICDManager : public ICDListener ICDManager() {} void Init(PersistentStorageDelegate * storage, FabricTable * fabricTable, ICDStateObserver * stateObserver); void Shutdown(); - void UpdateIcdMode(); + void UpdateICDMode(); void UpdateOperationState(OperationalState state); void SetKeepActiveModeRequirements(KeepActiveFlags flag, bool state); bool IsKeepActive() { return mKeepActiveFlags.HasAny(); } diff --git a/src/app/icd/IcdMonitoringTable.cpp b/src/app/icd/ICDMonitoringTable.cpp similarity index 80% rename from src/app/icd/IcdMonitoringTable.cpp rename to src/app/icd/ICDMonitoringTable.cpp index ad8cb7d3c4c550..821cf133060266 100644 --- a/src/app/icd/IcdMonitoringTable.cpp +++ b/src/app/icd/ICDMonitoringTable.cpp @@ -1,4 +1,4 @@ -#include "IcdMonitoringTable.h" +#include "ICDMonitoringTable.h" #include namespace chip { @@ -10,14 +10,14 @@ enum class Fields : uint8_t kKey = 3, }; -CHIP_ERROR IcdMonitoringEntry::UpdateKey(StorageKeyName & skey) +CHIP_ERROR ICDMonitoringEntry::UpdateKey(StorageKeyName & skey) { VerifyOrReturnError(kUndefinedFabricIndex != this->fabricIndex, CHIP_ERROR_INVALID_FABRIC_INDEX); - skey = DefaultStorageKeyAllocator::IcdManagementTableEntry(this->fabricIndex, index); + skey = DefaultStorageKeyAllocator::ICDManagementTableEntry(this->fabricIndex, index); return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringEntry::Serialize(TLV::TLVWriter & writer) const +CHIP_ERROR ICDMonitoringEntry::Serialize(TLV::TLVWriter & writer) const { TLV::TLVType outer; ReturnErrorOnFailure(writer.StartContainer(TLV::AnonymousTag(), TLV::kTLVType_Structure, outer)); @@ -28,7 +28,7 @@ CHIP_ERROR IcdMonitoringEntry::Serialize(TLV::TLVWriter & writer) const return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringEntry::Deserialize(TLV::TLVReader & reader) +CHIP_ERROR ICDMonitoringEntry::Deserialize(TLV::TLVReader & reader) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -63,14 +63,14 @@ CHIP_ERROR IcdMonitoringEntry::Deserialize(TLV::TLVReader & reader) return CHIP_NO_ERROR; } -void IcdMonitoringEntry::Clear() +void ICDMonitoringEntry::Clear() { this->checkInNodeID = kUndefinedNodeId; this->monitoredSubject = kUndefinedNodeId; this->key = ByteSpan(); } -CHIP_ERROR IcdMonitoringTable::Get(uint16_t index, IcdMonitoringEntry & entry) const +CHIP_ERROR ICDMonitoringTable::Get(uint16_t index, ICDMonitoringEntry & entry) const { entry.fabricIndex = this->mFabric; entry.index = index; @@ -79,7 +79,7 @@ CHIP_ERROR IcdMonitoringTable::Get(uint16_t index, IcdMonitoringEntry & entry) c return CHIP_NO_ERROR; } -CHIP_ERROR IcdMonitoringTable::Find(NodeId id, IcdMonitoringEntry & entry) +CHIP_ERROR ICDMonitoringTable::Find(NodeId id, ICDMonitoringEntry & entry) { uint16_t index = 0; while (index < this->Limit()) @@ -94,14 +94,14 @@ CHIP_ERROR IcdMonitoringTable::Find(NodeId id, IcdMonitoringEntry & entry) return CHIP_ERROR_NOT_FOUND; } -CHIP_ERROR IcdMonitoringTable::Set(uint16_t index, const IcdMonitoringEntry & entry) +CHIP_ERROR ICDMonitoringTable::Set(uint16_t index, const ICDMonitoringEntry & entry) { VerifyOrReturnError(index < this->Limit(), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.checkInNodeID, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(kUndefinedNodeId != entry.monitoredSubject, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(entry.key.size() == IcdMonitoringEntry::kKeyMaxSize, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(entry.key.size() == ICDMonitoringEntry::kKeyMaxSize, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(nullptr != entry.key.data(), CHIP_ERROR_INVALID_ARGUMENT); - IcdMonitoringEntry e(this->mFabric, index); + ICDMonitoringEntry e(this->mFabric, index); e.checkInNodeID = entry.checkInNodeID; e.monitoredSubject = entry.monitoredSubject; e.key = entry.key; @@ -109,15 +109,15 @@ CHIP_ERROR IcdMonitoringTable::Set(uint16_t index, const IcdMonitoringEntry & en return e.Save(this->mStorage); } -CHIP_ERROR IcdMonitoringTable::Remove(uint16_t index) +CHIP_ERROR ICDMonitoringTable::Remove(uint16_t index) { - IcdMonitoringEntry entry(this->mFabric, index); + ICDMonitoringEntry entry(this->mFabric, index); // Shift remaining entries down one position while (CHIP_NO_ERROR == this->Get(static_cast(index + 1), entry)) { // WARNING: The key data is held in the entry's serializing buffer - IcdMonitoringEntry copy = entry; + ICDMonitoringEntry copy = entry; this->Set(index++, copy); } @@ -127,9 +127,9 @@ CHIP_ERROR IcdMonitoringTable::Remove(uint16_t index) return entry.Delete(this->mStorage); } -CHIP_ERROR IcdMonitoringTable::RemoveAll() +CHIP_ERROR ICDMonitoringTable::RemoveAll() { - IcdMonitoringEntry entry(this->mFabric); + ICDMonitoringEntry entry(this->mFabric); uint16_t index = 0; while (index < this->Limit()) { @@ -145,13 +145,13 @@ CHIP_ERROR IcdMonitoringTable::RemoveAll() return CHIP_NO_ERROR; } -bool IcdMonitoringTable::IsEmpty() +bool ICDMonitoringTable::IsEmpty() { - IcdMonitoringEntry entry(this->mFabric); + ICDMonitoringEntry entry(this->mFabric); return (this->Get(0, entry) == CHIP_ERROR_NOT_FOUND); } -uint16_t IcdMonitoringTable::Limit() const +uint16_t ICDMonitoringTable::Limit() const { return mLimit; } diff --git a/src/app/icd/IcdMonitoringTable.h b/src/app/icd/ICDMonitoringTable.h similarity index 88% rename from src/app/icd/IcdMonitoringTable.h rename to src/app/icd/ICDMonitoringTable.h index 86186aec594d07..de97610dd01f30 100644 --- a/src/app/icd/IcdMonitoringTable.h +++ b/src/app/icd/ICDMonitoringTable.h @@ -25,13 +25,13 @@ namespace chip { -inline constexpr size_t kIcdMonitoringBufferSize = 40; +inline constexpr size_t kICDMonitoringBufferSize = 40; -struct IcdMonitoringEntry : public PersistentData +struct ICDMonitoringEntry : public PersistentData { static constexpr size_t kKeyMaxSize = 16; - IcdMonitoringEntry(FabricIndex fabric = kUndefinedFabricIndex, NodeId nodeId = kUndefinedNodeId) + ICDMonitoringEntry(FabricIndex fabric = kUndefinedFabricIndex, NodeId nodeId = kUndefinedNodeId) { this->fabricIndex = fabric; this->checkInNodeID = nodeId; @@ -51,8 +51,8 @@ struct IcdMonitoringEntry : public PersistentData }; /** - * @brief IcdMonitoringTable exists to manage the persistence of entries in the IcdManagement Cluster. - * To access persisted data with the IcdMonitoringTable class, instantiate an instance of this class + * @brief ICDMonitoringTable exists to manage the persistence of entries in the IcdManagement Cluster. + * To access persisted data with the ICDMonitoringTable class, instantiate an instance of this class * and call the LoadFromStorage function. * * This class can only manage one fabric at a time. The flow is load a fabric, execute necessary operations, @@ -62,9 +62,9 @@ struct IcdMonitoringEntry : public PersistentData * https://github.com/project-chip/connectedhomeip/issues/24288 */ -struct IcdMonitoringTable +struct ICDMonitoringTable { - IcdMonitoringTable(PersistentStorageDelegate & storage, FabricIndex fabric, uint16_t limit) : + ICDMonitoringTable(PersistentStorageDelegate & storage, FabricIndex fabric, uint16_t limit) : mStorage(&storage), mFabric(fabric), mLimit(limit) {} @@ -75,7 +75,7 @@ struct IcdMonitoringTable * @return CHIP_NO_ERROR on success, * CHIP_ERROR_NOT_FOUND if index is greater than the index of the last entry on the table. */ - CHIP_ERROR Get(uint16_t index, IcdMonitoringEntry & entry) const; + CHIP_ERROR Get(uint16_t index, ICDMonitoringEntry & entry) const; /** * @brief Stores the MonitoringRegistrationStruct entry at the given position, @@ -84,7 +84,7 @@ struct IcdMonitoringTable * @param entry On success, contains the MonitoringRegistrationStruct matching the given index. * @return CHIP_NO_ERROR on success */ - CHIP_ERROR Set(uint16_t index, const IcdMonitoringEntry & entry); + CHIP_ERROR Set(uint16_t index, const ICDMonitoringEntry & entry); /** * @brief Search the registered clients for an entry on the fabric whose checkInNodeID matches the given id. @@ -94,7 +94,7 @@ struct IcdMonitoringTable * If CHIP_ERROR_NOT_FOUND is returned, entry.index contains the total number of entries in the table. * @return CHIP_NO_ERROR if found, CHIP_ERROR_NOT_FOUND if no checkInNodeID matches the provided id. */ - CHIP_ERROR Find(NodeId id, IcdMonitoringEntry & entry); + CHIP_ERROR Find(NodeId id, ICDMonitoringEntry & entry); /** * @brief Removes the MonitoringRegistrationStruct entry at the given position, diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index e56a91aaff1383..122e87bc550ffb 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -139,7 +139,7 @@ chip_test_suite_using_nltest("tests") { "TestExtensionFieldSets.cpp", "TestFabricScopedEventLogging.cpp", "TestICDManager.cpp", - "TestIcdMonitoringTable.cpp", + "TestICDMonitoringTable.cpp", "TestInteractionModelEngine.cpp", "TestMessageDef.cpp", "TestNumericAttributeTraits.cpp", @@ -201,7 +201,7 @@ chip_test_suite_using_nltest("tests") { ":time-sync-data-provider-test-srcs", "${chip_root}/src/app", "${chip_root}/src/app/common:cluster-objects", - "${chip_root}/src/app/icd:manager-srcs", + "${chip_root}/src/app/icd:manager", "${chip_root}/src/app/tests:helpers", "${chip_root}/src/app/util/mock:mock_ember", "${chip_root}/src/lib/core", diff --git a/src/app/tests/TestICDManager.cpp b/src/app/tests/TestICDManager.cpp index 5d57be4245f116..76c8cd345cb0c4 100644 --- a/src/app/tests/TestICDManager.cpp +++ b/src/app/tests/TestICDManager.cpp @@ -16,10 +16,10 @@ * limitations under the License. */ #include +#include #include #include #include -#include #include #include #include @@ -115,20 +115,20 @@ class TestICDManager // After the init we should be in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // Active mode interval expired, ICDManager transitioned to the IdleMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); - AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(IcdManagementServer::GetInstance().GetIdleModeIntervalSec()) + 1); + AdvanceClockAndRunEventLoop(ctx, secondsToMilliseconds(ICDManagementServer::GetInstance().GetIdleModeIntervalSec()) + 1); // Idle mode interval expired, ICDManager transitioned to the ActiveMode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Events updating the Operation to Active mode can extend the current active mode time by 1 Active mode threshold. // Kick an active Threshold just before the end of the Active interval and validate that the active mode is extended. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() - 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() - 1); ICDNotifier::GetInstance().BroadcastNetworkActivityNotification(); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeThresholdMs() / 2); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeThresholdMs() / 2); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); } @@ -142,7 +142,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kCommissioningWindowOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time so active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // Requirement flag still set. We stay in active mode NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); @@ -156,12 +156,12 @@ class TestICDManager // Advance time, but by less than the active mode interval and remove the requirement. // We should stay in active mode. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() / 2); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() / 2); notifier.BroadcastActiveRequestWithdrawal(ActiveFlag::kFailSafeArmed); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // Advance time again, The activemode interval is completed. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::IdleMode); // Set two requirements @@ -169,7 +169,7 @@ class TestICDManager notifier.BroadcastActiveRequestNotification(ActiveFlag::kExchangeContextOpen); NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); // advance time so the active mode interval expires. - AdvanceClockAndRunEventLoop(ctx, IcdManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); + AdvanceClockAndRunEventLoop(ctx, ICDManagementServer::GetInstance().GetActiveModeIntervalMs() + 1); // A requirement flag is still set. We stay in active mode. NL_TEST_ASSERT(aSuite, ctx->mICDManager.mOperationalState == ICDManager::OperationalState::ActiveMode); diff --git a/src/app/tests/TestIcdMonitoringTable.cpp b/src/app/tests/TestICDMonitoringTable.cpp similarity index 96% rename from src/app/tests/TestIcdMonitoringTable.cpp rename to src/app/tests/TestICDMonitoringTable.cpp index 5cfdadd01ccbbc..4aca4ff4e1d7c6 100644 --- a/src/app/tests/TestIcdMonitoringTable.cpp +++ b/src/app/tests/TestICDMonitoringTable.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ -#include +#include #include #include #include @@ -61,9 +61,9 @@ constexpr uint8_t kKeyBuffer3a[] = { void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable saving(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable loading(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringEntry entry; + ICDMonitoringTable saving(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable loading(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert first entry @@ -139,8 +139,8 @@ void TestSaveAndLoadRegistrationValue(nlTestSuite * aSuite, void * aContext) void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringEntry entry; + ICDMonitoringTable table(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringEntry entry; CHIP_ERROR err; // Invalid checkInNodeID @@ -182,9 +182,9 @@ void TestSaveAllInvalidRegistrationValues(nlTestSuite * aSuite, void * aContext) void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void * aContext) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); - IcdMonitoringEntry entry; + ICDMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert in first fabric @@ -246,9 +246,9 @@ void TestSaveLoadRegistrationValueForMultipleFabrics(nlTestSuite * aSuite, void void TestDeleteValidEntryFromStorage(nlTestSuite * aSuite, void * context) { TestPersistentStorageDelegate storage; - IcdMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); - IcdMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); - IcdMonitoringEntry entry; + ICDMonitoringTable table1(storage, kTestFabricIndex1, kMaxTestClients1); + ICDMonitoringTable table2(storage, kTestFabricIndex2, kMaxTestClients2); + ICDMonitoringEntry entry; CHIP_ERROR err; // Insert first entry diff --git a/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml b/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml index 9890afb851586c..c92eea094e3a79 100644 --- a/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml +++ b/src/app/tests/suites/Test_AddNewFabricFromExistingFabric.yaml @@ -17,6 +17,9 @@ name: Test config: nodeId: 0x12344321 endpoint: 0 + nodeId2: + type: node_id + defaultValue: 0x43211234 tests: - label: "Wait for the alpha device to be retrieved " @@ -91,7 +94,7 @@ tests: - name: "Elements" value: NOCSRElements - name: "nodeId" - value: 0x43211234 + value: nodeId2 response: values: - name: "NOC" @@ -130,11 +133,27 @@ tests: value: 0 - label: "Send Commissioning Complete command from beta" - nodeId: 0x43211234 + nodeId: nodeId2 identity: "beta" cluster: "General Commissioning" command: "CommissioningComplete" + - label: "Read alpha fabric index" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "CurrentFabricIndex" + response: + saveAs: AlphaFabricIndex + + - label: "Read beta fabric index" + identity: "beta" + nodeId: nodeId2 + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "CurrentFabricIndex" + response: + saveAs: BetaFabricIndex + - label: "Read the fabrics list again from alpha" command: "readAttribute" cluster: "Operational Credentials" @@ -144,13 +163,81 @@ tests: constraints: type: list + - label: "Read the fabrics list again from alpha without fabric-filtering" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + value: + [ + { Label: "", NodeID: nodeId, FabricIndex: AlphaFabricIndex }, + { Label: "", NodeID: nodeId2, FabricIndex: BetaFabricIndex }, + ] + constraints: + type: list + + - label: + "Read the fabrics list again from alpha without fabric-filtering, + checking contains constraint" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + constraints: + type: list + # Flip the order to test the constraint better. + contains: + [ + { + Label: "", + NodeID: nodeId2, + FabricIndex: BetaFabricIndex, + }, + { + Label: "", + NodeID: nodeId, + FabricIndex: AlphaFabricIndex, + }, + ] + excludes: + [ + { + Label: "", + NodeID: nodeId, + FabricIndex: BetaFabricIndex, + }, + { + Label: "", + NodeID: nodeId2, + FabricIndex: AlphaFabricIndex, + }, + ] + - label: "Read the fabrics list from beta this time" identity: "beta" - nodeId: 0x43211234 + nodeId: nodeId2 + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + response: + value: [{ Label: "", NodeID: nodeId2 }] + constraints: + type: list + + - label: "Read the fabrics list from beta without fabric-filtering" + identity: "beta" + nodeId: nodeId2 command: "readAttribute" cluster: "Operational Credentials" attribute: "Fabrics" + fabricFiltered: false response: - value: [{ Label: "", NodeID: 0x43211234 }] + value: + [ + { Label: "", NodeID: nodeId, FabricIndex: AlphaFabricIndex }, + { Label: "", NodeID: nodeId2, FabricIndex: BetaFabricIndex }, + ] constraints: type: list diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml index efe21c12ec5090..8a38c7cd50a750 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml @@ -17,7 +17,7 @@ name: Server PICS: - - SMOKECO.S + - SMOKECO.S.F00 config: nodeId: 0x12344321 @@ -145,7 +145,7 @@ tests: value: "y" - label: "Step 10: TH reads TestInProgress attribute from DUT" - PICS: SMOKECO.S.A0005 + PICS: SMOKECO.S.A0005 && SMOKECO.M.ManuallyControlledTest command: "readAttribute" attribute: "TestInProgress" response: diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml index eb98f64d53f4b0..fe0dcfb4f70b9a 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml @@ -16,7 +16,7 @@ name: 4.2.3. [TC-SMOKECO-2.3] Primary Functionality - CO Alarm with DUT as Server PICS: - - SMOKECO.S + - SMOKECO.S.F01 config: nodeId: 0x12344321 @@ -144,7 +144,7 @@ tests: value: "y" - label: "Step 10: TH reads TestInProgress attribute from DUT" - PICS: SMOKECO.S.A0005 + PICS: SMOKECO.S.A0005 && SMOKECO.M.ManuallyControlledTest command: "readAttribute" attribute: "TestInProgress" response: diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml index d9374a8fa82a78..96002edde3cb38 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml @@ -511,7 +511,7 @@ tests: - label: "Step 38: TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds" - PICS: SMOKECO.S.A0005 + PICS: SMOKECO.S.A0005 && SMOKECO.M.ManuallyControlledTest command: "waitForReport" attribute: "TestInProgress" timeout: 180 @@ -521,7 +521,7 @@ tests: type: boolean - label: "Step 39: TH reads ExpressedState attribute from DUT" - PICS: SMOKECO.S.A0000 + PICS: SMOKECO.S.A0000 && SMOKECO.M.ManuallyControlledTest command: "readAttribute" attribute: "ExpressedState" response: @@ -532,7 +532,7 @@ tests: - label: "Step 40: TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds" - PICS: SMOKECO.S.A0005 + PICS: SMOKECO.S.A0005 && SMOKECO.M.ManuallyControlledTest command: "waitForReport" attribute: "TestInProgress" timeout: 180 @@ -542,7 +542,7 @@ tests: type: boolean - label: "Step 41: TH reads SelfTestComplete event from DUT" - PICS: SMOKECO.S.E05 + PICS: SMOKECO.S.E05 && SMOKECO.M.ManuallyControlledTest command: "readEvent" event: "SelfTestComplete" eventNumber: "LastReceivedEventNumber + 1" @@ -550,7 +550,7 @@ tests: value: {} - label: "Step 42: TH reads ExpressedState attribute from DUT" - PICS: SMOKECO.S.A0000 + PICS: SMOKECO.S.A0000 && SMOKECO.M.ManuallyControlledTest command: "readAttribute" attribute: "ExpressedState" response: @@ -559,7 +559,7 @@ tests: type: enum8 - label: "Step 43: TH reads AllClear event from DUT" - PICS: SMOKECO.S.E0a + PICS: SMOKECO.S.E0a && SMOKECO.M.ManuallyControlledTest command: "readEvent" event: "AllClear" eventNumber: "LastReceivedEventNumber + 1" diff --git a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml b/src/app/tests/suites/certification/Test_TC_S_1_1.yaml index 93be11fdee2487..0fdc16b325b0d7 100644 --- a/src/app/tests/suites/certification/Test_TC_S_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_1_1.yaml @@ -41,99 +41,81 @@ tests: constraints: type: int16u - - label: "Step 3: Read FeatureMap (global attribute 65532)" + - label: "Step 3a: Read FeatureMap (global attribute 65532)" PICS: (!S.S.F00) command: "readAttribute" attribute: "FeatureMap" response: - value: 0 constraints: type: bitmap32 + hasMasksSet: [0x1] + # This needs to be changed in the Name Support PR: https://github.com/project-chip/connectedhomeip/pull/29639 + # Issue in Test plan repo: https://github.com/CHIP-Specifications/chip-test-plans/issues/3515 + #hasMasksClear: [0x1] - - label: "Step 3: Read FeatureMap (global attribute 65532)" + - label: "Step 3a: Read FeatureMap (global attribute 65532)" PICS: S.S.F00 command: "readAttribute" attribute: "FeatureMap" response: - value: 1 constraints: type: bitmap32 + hasMasksSet: [0x1] - label: - "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is - true" - PICS: S.S.A0005 && PICS_EVENT_LIST_ENABLED + "Step 4: Read Mandatory attributes in AttributeList (global attribute + 65531)" + PICS: S.S command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] + contains: [4, 65528, 65529, 65531, 65532, 65533] - label: - "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is - true" - PICS: S.S.A0005 && !PICS_EVENT_LIST_ENABLED + "Step 4b: Read optional attributes(SceneCount, CurrentScene, + CurrentGroup, SceneValid) in AttributeList (global attribute 65531)" + PICS: (!S.S.F03) command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: - [0, 1, 2, 3, 4, 5, 6, 7, 65528, 65529, 65531, 65532, 65533] + contains: [0, 1, 2, 3] - label: - "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is - false" - PICS: " !S.S.A0005 && PICS_EVENT_LIST_ENABLED" + "Step 4c: Read optinnal attribute(LastConfiguredBy) in AttributeList + (global attribute 65531)" + PICS: S.S.A0005 command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: - [ - 0, - 1, - 2, - 3, - 4, - 6, - 7, - 65528, - 65529, - 65530, - 65531, - 65532, - 65533, - ] + contains: [5] - label: - "Step 4: Read AttributeList (global attribute 65531) if S.S.A0005 is - false" - PICS: " !S.S.A0005 && !PICS_EVENT_LIST_ENABLED" + "Step 4d: Read optionnal attribute(SceneTableSize) in AttributeList + (global attribute 65531)" + PICS: S.S.F02 command: "readAttribute" attribute: "AttributeList" response: constraints: type: list - contains: [0, 1, 2, 3, 4, 6, 7, 65528, 65529, 65531, 65532, 65533] + contains: [6] + + - label: + "Step 4e: Read optional attribute(FabricSceneInfo) in AttributeList + (global attribute 65531)" + PICS: S.S.F03 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [7] - label: "Step 5: Read EventList (global attribute 65530)" PICS: PICS_EVENT_LIST_ENABLED @@ -144,41 +126,49 @@ tests: type: list contains: [] - - label: "Step 6a: Read AcceptedCommandList (global attribute 65529)" - PICS: S.S.C40.Rsp + - label: + "Step 6a: Read Mandatory commands in AcceptedCommandList (global + attribute 65529)" + PICS: S.S command: "readAttribute" attribute: "AcceptedCommandList" response: constraints: type: list - contains: [0, 1, 2, 3, 4, 5, 6, 40, 41, 42] + contains: [0, 1, 2, 3, 4, 5, 6] - - label: "Step 6b: Read AcceptedCommandList (global attribute 65529)" - PICS: (!S.S.C40.Rsp) + - label: + "Step 6b: Read optional command(EnhancedAddSceneResponse) + AcceptedCommandList (global attribute 65529)" + PICS: S.S.C40.Rsp command: "readAttribute" attribute: "AcceptedCommandList" response: constraints: type: list - contains: [0, 1, 2, 3, 4, 5, 6] + contains: [64] - - label: "Step 6c: Read AcceptedCommandList (global attribute 65529)" - PICS: S.C.C40.Tx + - label: + "Step 6c: Read optional command(EnhancedViewSceneResponse) + AcceptedCommandList (global attribute 65529)" + PICS: S.S.C41.Rsp command: "readAttribute" attribute: "AcceptedCommandList" response: constraints: type: list - contains: [0, 1, 2, 3, 4, 5, 6, 40, 41, 42] + contains: [65] - - label: "Step 6d: Read AcceptedCommandList (global attribute 65529)" - PICS: (!S.C.C40.Tx) + - label: + "Step 6d: Read optional command(CopySceneResponse) AcceptedCommandList + (global attribute 65529)" + PICS: S.S.C42.Rsp command: "readAttribute" attribute: "AcceptedCommandList" response: constraints: type: list - contains: [0, 1, 2, 3, 4, 5, 6] + contains: [66] - label: "Step 7a: Read GeneratedCommandList (global attribute 65528)" command: "readAttribute" @@ -186,7 +176,7 @@ tests: response: constraints: type: list - contains: [0, 1, 2, 3, 4, 5, 6] + contains: [0, 1, 2, 3, 4, 6] - label: "Step 7b: Read optional command(EnhancedAddSceneResponse) in @@ -197,7 +187,7 @@ tests: response: constraints: type: list - contains: [40] + contains: [64] - label: "Step 7c: Read optional command(EnhancedViewSceneResponse) in @@ -208,7 +198,7 @@ tests: response: constraints: type: list - contains: [41] + contains: [65] - label: "Step 7d: Read optional command(CopySceneResponse) in @@ -219,4 +209,4 @@ tests: response: constraints: type: list - contains: [42] + contains: [66] diff --git a/src/app/tests/suites/certification/Test_TC_S_2_1.yaml b/src/app/tests/suites/certification/Test_TC_S_2_1.yaml index 039309538b5097..ec9a9c3871768a 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_1.yaml @@ -56,7 +56,7 @@ tests: attribute: "CurrentGroup" response: constraints: - type: groupid + type: group_id - label: "Step 5: TH reads from the DUT the (0x0003) SceneValid attribute" PICS: S.S.A0003 @@ -64,7 +64,7 @@ tests: attribute: "SceneValid" response: constraints: - type: int8u + type: boolean - label: "Step 6: TH reads from the DUT the (0x0004) NameSupport attribute" PICS: S.S.A0003 && S.S.F00 @@ -91,7 +91,7 @@ tests: attribute: "LastConfiguredBy" response: constraints: - type: nodeId + type: node_id - label: "Step 8: TH reads from the DUT the (0x0006) SceneTableSize attribute" @@ -100,7 +100,7 @@ tests: attribute: "SceneTableSize" response: constraints: - type: uint16 + type: int16u - label: "Step 9: TH reads from the DUT the (0x0007) RemainingCapacity diff --git a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml index a33f9d9752b168..a63a94b08262e9 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_2.yaml @@ -22,6 +22,12 @@ config: nodeId: 0x12344321 cluster: "Scenes" endpoint: 1 + G1: + type: int16u + defaultValue: 0x0001 + G2: + type: int16u + defaultValue: 0x0002 GroupKeyManagement.Endpoint: 0 Groups.Endpoint: 1 @@ -57,12 +63,12 @@ tests: { GroupKeySetID: 0x01a1, GroupKeySecurityPolicy: 0, - EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime0: 2220000, - EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime1: 2220001, - EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime2: 2220002, + EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf", + EpochStartTime0: 1110000, + EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", + EpochStartTime1: 1110001, + EpochKey2: "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + EpochStartTime2: 1110002, } - label: @@ -75,8 +81,8 @@ tests: arguments: value: [ - { FabricIndex: 1, GroupId: 0x0001, GroupKeySetID: 0x01a1 }, - { FabricIndex: 1, GroupId: 0x0002, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: G1, GroupKeySetID: 0x01a1 }, + { FabricIndex: 1, GroupId: G2, GroupKeySetID: 0x01a1 }, ] - label: "Step 0c: TH sends a RemoveAllGroups command to DUT." @@ -87,14 +93,14 @@ tests: - label: "Step 1a: TH sends a AddGroup command to DUT with the GroupID field - set to 0x0001." + set to G1." PICS: G.S.C00.Rsp cluster: "Groups" command: "AddGroup" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "GroupName" value: "Group1" response: @@ -102,33 +108,33 @@ tests: - name: "Status" value: 0 - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 1b: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C03.Rsp command: "RemoveAllScenes" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" - value: 0 + value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 1c: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0001." + GroupID field set to G1." PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -136,7 +142,7 @@ tests: - name: "Capacity" value: ( maxScenes / 2 ) - name: "GroupID" - value: 0x0001 + value: G1 - label: "STep 2a: TH configures AC1 on DUT for all implemented application @@ -174,13 +180,13 @@ tests: - label: "Step 2b: TH sends a StoreScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C04.Rsp command: "StoreScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -188,7 +194,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -228,13 +234,13 @@ tests: - label: "Step 3b: TH sends a RecallScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -262,9 +268,9 @@ tests: command: "readAttribute" attribute: "CurrentGroup" response: - value: 0x0001 + value: G1 constraints: - type: groupid + type: group_id - label: "Step 3f: TH reads the SceneValid attribute from DUT." PICS: S.S.A0000 && S.S.A0001 && S.S.A0002 && S.S.A0003 && !S.S.F03 @@ -273,7 +279,7 @@ tests: response: value: true constraints: - type: int8u + type: boolean - label: "Step 3g: TH reads attribute SceneTableSize from DUT." PICS: S.S.F03 && S.S.F02 @@ -316,7 +322,7 @@ tests: # value: { # SceneCount: SceneCountValue, # CurrentScene: 0x01, - # CurrentGroup: 0x0001, + # CurrentGroup: G1, # SceneValid: true, # RemainingCapacity: ( SceneTableSizeValue/2 ), # } @@ -384,25 +390,25 @@ tests: - label: "Step 4d: TH sends a RecallScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - label: "Step 5: TH sends a ViewScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C01.Rsp && PICS_SDK_CI_ONLY command: "ViewScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -410,7 +416,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - name: "TransitionTime" @@ -425,29 +431,77 @@ tests: }, { ClusterID: 0x0008, + AttributeValueList: + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + }, + { + ClusterID: 0x0300, AttributeValueList: [ { - AttributeID: 0x0000, - AttributeValue: 0x64, + AttributeID: 0x0003, + AttributeValue: 0x616b, + }, + { + AttributeID: 0x0004, + AttributeValue: 0x607d, + }, + { + AttributeID: 0x4000, + AttributeValue: 0x0000, }, { AttributeID: 0x0001, AttributeValue: 0x00, }, + { + AttributeID: 0x4002, + AttributeValue: 0x00, + }, + { + AttributeID: 0x4003, + AttributeValue: 0x00, + }, + { + AttributeID: 0x4004, + AttributeValue: 0x0019, + }, + { + AttributeID: 0x0007, + AttributeValue: 0x00, + }, + { + AttributeID: 0x4001, + AttributeValue: 0x02, + }, ], }, ] + #TODO : Need to change the check for a check like below if possible + # constraints: + # type: list + # contains: [ + # { + # ClusterID: 0x0006, + # AttributeValueList: + # [{ AttributeID: 0x0000, AttributeValue: 0x01 }], + # }, + # { + # ClusterID: 0x0008, + # AttributeValueList: + # [{ AttributeID: 0x0000, AttributeValue: 0x64 }], + # }, + # ] - label: "Step 5: TH sends a ViewScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C01.Rsp && PICS_SKIP_SAMPLE_APP command: "ViewScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -455,7 +509,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - name: "TransitionTime" @@ -463,13 +517,13 @@ tests: - label: "Step 6: TH sends a GetSceneMembership command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -477,35 +531,35 @@ tests: - name: "Capacity" value: ( maxScenes / 2 ) - 1 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneList" value: [0x01] - label: "Step 7a: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C03.Rsp command: "RemoveAllScenes" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" value: 0 - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 7b: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0001." + GroupID field set to G1." PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -514,20 +568,20 @@ tests: constraints: anyOf: [( maxScenes / 2 ), 0xfe, 0x89] - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 8a: TH sends a AddScene command to DUT with the GroupID field - set to 0x0001, the SceneID field set to 0x01, the TransitionTime field - set to 0x0001 and a set of extension fields appropriate to AC1." + set to G1, the SceneID field set to 0x01, the TransitionTime field set + to 0x0001 and a set of extension fields appropriate to AC1." PICS: S.S.C00.Rsp && PICS_SDK_CI_ONLY command: "AddScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" - value: 0x0001 + value: 0x01 - name: "TransitionTime" value: 0x0001 - name: "SceneName" @@ -543,16 +597,7 @@ tests: { ClusterID: 0x0008, AttributeValueList: - [ - { - AttributeID: 0x0000, - AttributeValue: 0x64, - }, - { - AttributeID: 0x0001, - AttributeValue: 0x00, - }, - ], + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], }, ] response: @@ -560,14 +605,14 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - label: "Step 8a: TH sends a AddScene command to DUT with the GroupID field - set to 0x0001, the SceneID field set to 0x01, the TransitionTime field - set to 0x0001 and a set of extension fields appropriate to AC1." + set to G1, the SceneID field set to 0x01, the TransitionTime field set + to 0x0001 and a set of extension fields appropriate to AC1." verification: | Execute the following command in TH to generate the pre-condition to execute this test case: @@ -628,13 +673,13 @@ tests: - label: "Step 8b: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0001." + GroupID field set to G1." PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -643,39 +688,39 @@ tests: constraints: anyOf: [( maxScenes / 2 ) - 1, 0xfe, 0x89] - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneList" value: [0x01] - label: "Step 9a: TH sends a RemoveScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C02.Rsp command: "RemoveScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" - value: 0x0001 + value: 0x01 response: values: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - label: "Step 9b: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0001." + GroupID field set to G1." PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -684,7 +729,7 @@ tests: constraints: anyOf: [( maxScenes / 2 ), 0xfe, 0x89] - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 10a: TH configures AC2 on DUT for all implemented application @@ -722,13 +767,13 @@ tests: - label: "Step 10b: TH sends a RecallScene command to DUT with the GroupID - field set to 0x0001 and the SceneID field set to 0x01." + field set to G1 and the SceneID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -770,13 +815,13 @@ tests: - label: "Step 11b: TH sends a StoreScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C04.Rsp command: "StoreScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -784,7 +829,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -824,13 +869,13 @@ tests: - label: "Step 12b: TH sends a StoreScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x02." + set to G1 and the SceneID field set to 0x02." PICS: S.S.C04.Rsp command: "StoreScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x02 response: @@ -840,7 +885,7 @@ tests: constraints: anyOf: [0x00, 0x89] - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x02 @@ -862,14 +907,14 @@ tests: - label: "Step 12c: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0001." + GroupID field set to G1." runIf: ContinueTest PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" @@ -877,13 +922,13 @@ tests: - name: "Capacity" value: ( maxScenes / 2 ) - 2 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneList" value: [0x01, 0x02] - label: "Step 13a: If capacity allows, TH sends a AddGroup command to DUT with - the GroupID field set to 0x0002." + the GroupID field set to G2." runIf: ContinueTest PICS: G.S.C00.Rsp cluster: "Groups" @@ -891,7 +936,7 @@ tests: arguments: values: - name: "GroupID" - value: 0x0002 + value: G2 - name: "GroupName" value: "Group2" response: @@ -899,35 +944,35 @@ tests: - name: "Status" value: 0 - name: "GroupID" - value: 0x0002 + value: G2 - label: "Step 13b: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0002." + field set to G2." runIf: ContinueTest PICS: S.S.C03.Rsp command: "RemoveAllScenes" arguments: values: - name: "GroupID" - value: 0x0002 + value: G2 response: values: - name: "Status" value: 0 - name: "GroupID" - value: 0x0002 + value: G2 - label: "Step 13c: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0002." + GroupID field set to G2." runIf: ContinueTest PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0002 + value: G2 response: values: - name: "Status" @@ -935,7 +980,7 @@ tests: - name: "Capacity" value: ( maxScenes / 2 ) - 2 - name: "GroupID" - value: 0x0002 + value: G2 - label: "Step 14a: TH configures AC3 on DUT for all implemented application @@ -975,14 +1020,14 @@ tests: - label: "Step 14b: TH sends a StoreScene command to DUT with the GroupID field - set to 0x0002 and the SceneID field set to 0x03." + set to G2 and the SceneID field set to 0x03." runIf: ContinueTest PICS: S.S.C04.Rsp command: "StoreScene" arguments: values: - name: "GroupID" - value: 0x0002 + value: G2 - name: "SceneID" value: 0x03 response: @@ -992,7 +1037,7 @@ tests: constraints: anyOf: [0x00, 0x89] - name: "GroupID" - value: 0x0002 + value: G2 - name: "SceneID" value: 0x03 @@ -1015,14 +1060,14 @@ tests: - label: "Step 14c: TH sends a GetSceneMembership command to DUT with the - GroupID field set to 0x0002." + GroupID field set to G2." runIf: ContinueTest PICS: S.S.C06.Rsp command: "GetSceneMembership" arguments: values: - name: "GroupID" - value: 0x0002 + value: G2 response: values: - name: "Status" @@ -1030,7 +1075,7 @@ tests: - name: "Capacity" value: ( maxScenes / 2 ) - 3 - name: "GroupID" - value: 0x0002 + value: G2 - name: "SceneList" value: [0x03] diff --git a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml index cc019818fcc4a1..b91f6eee39f3e3 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_3.yaml @@ -24,7 +24,7 @@ config: endpoint: 1 G1: type: int16u - defaultValue: 0x0001 + defaultValue: 0x0101 GroupKeyManagement.Endpoint: 0 tests: @@ -58,12 +58,12 @@ tests: { GroupKeySetID: 0x01a1, GroupKeySecurityPolicy: 0, - EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime0: 2220000, - EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime1: 2220001, - EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime2: 2220002, + EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf", + EpochStartTime0: 1110000, + EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", + EpochStartTime1: 1110001, + EpochKey2: "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + EpochStartTime2: 1110002, } - label: @@ -87,14 +87,39 @@ tests: - name: "GroupID" value: G1 - name: "GroupName" - value: "Group1" + value: "Group #1" response: values: - name: "Status" - value: 0 + value: 0x00 - name: "GroupID" value: G1 + - label: "Install ACLs" + cluster: "Access Control" + endpoint: GroupKeyManagement.Endpoint + command: "writeAttribute" + attribute: "ACL" + arguments: + value: [ + # Any CASE can administer + { + FabricIndex: 0, + Privilege: 5, # administer + AuthMode: 2, # case + Subjects: null, + Targets: null, + }, + # Any group can manage + { + FabricIndex: 0, + Privilege: 4, # manage + AuthMode: 3, # group + Subjects: null, + Targets: null, + }, + ] + - label: "Step 1b: TH sends a RemoveAllScenes command to DUT with the GroupID field set to G1." @@ -107,7 +132,7 @@ tests: response: values: - name: "Status" - value: 0 + value: 0x00 - name: "GroupID" value: G1 @@ -125,7 +150,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: (maxScenes/2) + value: maxScenes / 2 - name: "GroupID" value: G1 - name: "SceneList" @@ -143,7 +168,7 @@ tests: - name: "GroupID" value: G1 - name: "SceneID" - value: 0x0001 + value: 0x01 - name: "TransitionTime" value: 0x000a - name: "SceneName" @@ -159,16 +184,7 @@ tests: { ClusterID: 0x0008, AttributeValueList: - [ - { - AttributeID: 0x0000, - AttributeValue: 0x64, - }, - { - AttributeID: 0x0001, - AttributeValue: 0x00, - }, - ], + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], }, ] response: @@ -184,14 +200,15 @@ tests: "Step 2b: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set to 0x0001 (1s) and a set of extension fields appropriate to AC1." - PICS: S.S.C40.Rsp && PICS_SDK_CI_ONLY + # This step is overwriting Step 2a, we need to add PICS !S.S.C40.Rsp here, see issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3509 + PICS: S.S.C00.Rsp && PICS_SDK_CI_ONLY command: "AddScene" arguments: values: - name: "GroupID" value: G1 - name: "SceneID" - value: 0x0001 + value: 0x01 - name: "TransitionTime" value: 0x0001 - name: "SceneName" @@ -207,16 +224,7 @@ tests: { ClusterID: 0x0008, AttributeValueList: - [ - { - AttributeID: 0x0000, - AttributeValue: 0x64, - }, - { - AttributeID: 0x0001, - AttributeValue: 0x00, - }, - ], + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], }, ] response: @@ -274,7 +282,7 @@ tests: [1670970505.890328][5742:5744] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Command 0x0000_0040 [1670970505.890458][5742:5744] CHIP:TOO: EnhancedAddSceneResponse: { [1670970505.890551][5742:5744] CHIP:TOO: status: 0 - [1670970505.890608][5742:5744] CHIP:TOO: groupId: 1 + [1670970505.890608][5742:5744] CHIP:TOO: groupId: 257 [1670970505.890717][5742:5744] CHIP:TOO: sceneId: 1 [1670970505.890774][5742:5744] CHIP:TOO: } cluster: "LogCommands" @@ -293,7 +301,7 @@ tests: - label: "Step 2b: TH sends a AddScene command to DUT with the GroupID field set to G1, the SceneID field set to 0x01, the TransitionTime field set - to 0x0001 and a set of extension fields appropriate to AC1." + to G1 and a set of extension fields appropriate to AC1." verification: | Execute the following command in TH to generate the pre-condition to execute this test case: @@ -336,12 +344,13 @@ tests: [1670970505.890328][5742:5744] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Command 0x0000_0000 [1670970505.890458][5742:5744] CHIP:TOO: AddSceneResponse: { [1670970505.890551][5742:5744] CHIP:TOO: status: 0 - [1670970505.890608][5742:5744] CHIP:TOO: groupId: 1 + [1670970505.890608][5742:5744] CHIP:TOO: groupId: 257 [1670970505.890717][5742:5744] CHIP:TOO: sceneId: 1 [1670970505.890774][5742:5744] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" - PICS: (!S.S.C40.Rsp) && PICS_SKIP_SAMPLE_APP + # This step is overwriting Step 2a, we need to add PICS !S.S.C40.Rsp here, see issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3509 + PICS: S.S.C00.Rsp && PICS_SKIP_SAMPLE_APP arguments: values: - name: "message" @@ -384,23 +393,15 @@ tests: { ClusterID: 0x0008, AttributeValueList: - [ - { - AttributeID: 0x0000, - AttributeValue: 0x64, - }, - { - AttributeID: 0x0001, - AttributeValue: 0x00, - }, - ], + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], }, ] - label: "Step 3b: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." - PICS: S.S.C41.Rsp && PICS_SDK_CI_ONLY + # This step is redundant with Step 3a, we should add PICS !S.S.C41.Rsp here, see issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3509 + PICS: S.S.C01.Rsp && PICS_SDK_CI_ONLY command: "ViewScene" arguments: values: @@ -429,16 +430,7 @@ tests: { ClusterID: 0x0008, AttributeValueList: - [ - { - AttributeID: 0x0000, - AttributeValue: 0x64, - }, - { - AttributeID: 0x0001, - AttributeValue: 0x00, - }, - ], + [{ AttributeID: 0x0000, AttributeValue: 0x64 }], }, ] @@ -455,7 +447,7 @@ tests: Verify that the extension fields in the log match the ones expected and that Status = 0x00 - GroupID = 0x0001 + GroupID = G1 SceneID = 0x01 TransitionTime = 0x000a cluster: "LogCommands" @@ -473,7 +465,8 @@ tests: - label: "Step 3b: TH sends a ViewScene command to DUT with the GroupID field set to G1 and the SceneID field set to 0x01." - PICS: (!S.S.C41.Rsp) && PICS_SKIP_SAMPLE_APP + # This step is redundant with Step 3a, we should add PICS !S.S.C41.Rsp here, see issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3509 + PICS: S.S.C01.Rsp && PICS_SKIP_SAMPLE_APP verification: | Execute the following command in TH to generate the pre-condition to execute this test case: @@ -483,7 +476,7 @@ tests: Verify that the extension fields in the log match the ones expected and that Status = 0x00 - GroupID = 0x0001 + GroupID = G1 SceneID = 0x01 TransitionTime = 0x0001 cluster: "LogCommands" @@ -513,7 +506,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: (maxScenes/2) - 1 + value: ( maxScenes / 2 ) - 1 - name: "GroupID" value: G1 - name: "SceneList" @@ -558,7 +551,8 @@ tests: field set to G1 and the scene ID field set to 0x01." PICS: S.S.C05.Rsp command: "RecallScene" - groupId: 0x0001 + # This value should be changed to G1 instead of 0x101 when it is supported, Issue opened here https://github.com/project-chip/connectedhomeip/issues/29637 + groupId: 0x101 arguments: values: - name: "GroupID" @@ -573,11 +567,11 @@ tests: arguments: values: - name: "ms" - value: 1000 + value: 1050 - label: "TH confirm the DUT reached AC1 (on level control cluster) after 1s" - PICS: S.S.C40.Rsp + PICS: PICS_SDK_CI_ONLY && S.S.C05.Rsp cluster: "Level Control" command: "readAttribute" attribute: "CurrentLevel" @@ -639,7 +633,7 @@ tests: - name: "Status" value: 0x00 - name: "Capacity" - value: (maxScenes/2) - 2 + value: ( maxScenes / 2 ) - 2 - name: "GroupID" value: G1 - name: "SceneList" diff --git a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml index 2cf0d603da4ba1..12657fc8dd8cce 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml @@ -24,6 +24,9 @@ config: endpoint: 1 GroupKeyManagement.Endpoint: 0 + G1: + type: int16u + defaultValue: 0x0001 Groups.Endpoint: 1 tests: @@ -48,12 +51,12 @@ tests: { GroupKeySetID: 0x01a1, GroupKeySecurityPolicy: 0, - EpochKey0: "hex:d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime0: 2220000, - EpochKey1: "hex:d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime1: 2220001, - EpochKey2: "hex:d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", - EpochStartTime2: 2220002, + EpochKey0: "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf", + EpochStartTime0: 1110000, + EpochKey1: "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf", + EpochStartTime1: 1110001, + EpochKey2: "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf", + EpochStartTime2: 1110002, } - label: @@ -64,7 +67,7 @@ tests: command: "writeAttribute" attribute: "GroupKeyMap" arguments: - value: [{ FabricIndex: 1, GroupId: 0x0001, GroupKeySetID: 0x01a1 }] + value: [{ FabricIndex: 1, GroupId: G1, GroupKeySetID: 0x01a1 }] - label: "Step 0c: TH sends a RemoveAllGroups command to DUT." PICS: G.S.C04.Rsp @@ -74,14 +77,14 @@ tests: - label: "Step 2a: TH sends a AddGroup command to DUT with the GroupID field - set to 0x0001." + set to G1." PICS: G.S.C00.Rsp cluster: "Groups" command: "AddGroup" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "GroupName" value: "Group1" response: @@ -89,36 +92,36 @@ tests: - name: "Status" value: 0 - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 2b: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C03.Rsp command: "RemoveAllScenes" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 response: values: - name: "Status" value: 0 - name: "GroupID" - value: 0x0001 + value: G1 - label: "Step 3: TH sends a AddScene command to DUT with the GroupID field set - to 0x0001, the SceneID field set to 0x01, the TransitionTime field set - to 0x0001 and a set of extension fields appropriate to AC1." + to G1, the SceneID field set to 0x01, the TransitionTime field set to + 0x0001 and a set of extension fields appropriate to AC1." PICS: S.S.C00.Rsp command: "AddScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" - value: 0x0001 + value: 0x01 - name: "TransitionTime" value: 0x0014 - name: "SceneName" @@ -131,7 +134,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -171,13 +174,13 @@ tests: - label: "Step 4b: TH sends a StoreScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C04.Rsp command: "StoreScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 response: @@ -185,7 +188,7 @@ tests: - name: "Status" value: 0x00 - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -243,14 +246,14 @@ tests: - label: "Step 5b: TH sends a RecallScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01 and the TransitionTime + set to G1 and the SceneID field set to 0x01 and the TransitionTime field omitted." PICS: S.S.C05.Rsp command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 @@ -260,7 +263,7 @@ tests: arguments: values: - name: "ms" - value: 20000 + value: 20500 - label: "TH confirm the DUT reached AC1 (on level control cluster) after 20s" @@ -320,30 +323,33 @@ tests: - label: "Step 6b: TH sends a RecallScene command to DUT with the GroupID field - set to 0x0001, the SceneID field set to 0x01 and the TransitionTime - field set to 0x0032 (5s)." + set to G1, the SceneID field set to 0x01 and the TransitionTime field + set to 0x0032 (5s)." PICS: S.S.C05.Rsp && PICS_SC_RECALL_SCENE_TRANSITION_TIME command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - name: "TransitionTime" value: 0x0032 - label: "Wait 5s" + PICS: S.S.C05.Rsp && PICS_SC_RECALL_SCENE_TRANSITION_TIME cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 5000 + value: 5500 - label: "TH confirm the DUT reached AC2 (on level control cluster) after 5s" - PICS: PICS_SDK_CI_ONLY + PICS: + S.S.C05.Rsp && PICS_SC_RECALL_SCENE_TRANSITION_TIME && + PICS_SDK_CI_ONLY cluster: "Level Control" command: "readAttribute" attribute: "CurrentLevel" @@ -399,20 +405,18 @@ tests: - label: "Step 7b: TH sends a RecallScene command to DUT with the GroupID field - set to 0x0001, the SceneID field set to 0x01 and the TransitionTime - field set to null (no transition time override)." + set to G1, the SceneID field set to 0x01 and the TransitionTime field + set to null (no transition time override)." PICS: S.S.C05.Rsp command: "RecallScene" arguments: values: - name: "GroupID" - value: 0x0001 + value: G1 - name: "SceneID" value: 0x01 - name: "TransitionTime" value: null - response: - error: SUCCESS - label: "Step 8: TH removes the Group key set that was added by sending a diff --git a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml index 6f7a235bf0922b..49dda66b14df29 100644 --- a/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_WAKEONLAN_1_5.yaml @@ -56,7 +56,7 @@ tests: response: constraints: type: list - contains: [65528, 65529, 65530, 65531, 65531, 65533] + contains: [65528, 65529, 65530, 65531, 65532, 65533] - label: "Step 3a: Read the global attribute: AttributeList" PICS: "!PICS_EVENT_LIST_ENABLED" @@ -65,7 +65,7 @@ tests: response: constraints: type: list - contains: [65528, 65529, 65531, 65531, 65533] + contains: [65528, 65529, 65531, 65532, 65533] - label: "Step 3b: Read the optional attribute(MACAddress) in AttributeList" PICS: WAKEONLAN.S.A0000 diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 63caa7841d3ccf..4869039cf87fef 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -598,7 +598,7 @@ G.S.C00.Rsp=1 G.S.C01.Rsp=1 G.S.C02.Rsp=1 G.S.C03.Rsp=1 -G.S.C04.Rsp=0 +G.S.C04.Rsp=1 G.S.C05.Rsp=0 G.S.C00.Tx=1 G.S.C01.Tx=1 @@ -656,30 +656,29 @@ I.C.AO-READ=0 I.C.AO-WRITE=0 # Scenes Cluster -S.S=0 -S.S.A0000=0 -S.S.A0001=0 -S.S.A0002=0 -S.S.A0003=0 -S.S.A0004=0 -S.S.A0005=0 -S.S.A0006=0 +S.S=1 +S.S.A0000=1 +S.S.A0001=1 +S.S.A0002=1 +S.S.A0003=1 +S.S.A0004=1 +S.S.A0005=1 +S.S.A0006=1 S.S.A0007=0 -S.S.C00.Rsp=0 -S.S.C01.Rsp=0 -S.S.C02.Rsp=0 -S.S.C03.Rsp=0 -S.S.C04.Rsp=0 -S.S.C05.Rsp=0 -S.S.C06.Rsp=0 -S.S.C40.Rsp=0 -S.S.C41.Rsp=0 -S.S.C42.Rsp=0 -S.S.C05.Rsp=0 +S.S.C00.Rsp=1 +S.S.C01.Rsp=1 +S.S.C02.Rsp=1 +S.S.C03.Rsp=1 +S.S.C04.Rsp=1 +S.S.C05.Rsp=1 +S.S.C06.Rsp=1 +S.S.C40.Rsp=1 +S.S.C41.Rsp=1 +S.S.C42.Rsp=1 S.S.AM=0 S.S.AO=0 -S.S.F00=0 -S.S.F01=0 +S.S.F00=1 +S.S.F01=1 S.S.F02=0 S.S.F03=0 PICS_SC_RECALL_SCENE_TRANSITION_TIME=1 diff --git a/src/app/zap-templates/app-templates.json b/src/app/zap-templates/app-templates.json index d83717e1ba76f2..07434029be2120 100644 --- a/src/app/zap-templates/app-templates.json +++ b/src/app/zap-templates/app-templates.json @@ -17,10 +17,6 @@ { "name": "header", "path": "partials/header.zapt" - }, - { - "name": "im_command_handler_cluster_commands", - "path": "partials/im_command_handler_cluster_commands.zapt" } ], "templates": [ diff --git a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt b/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt deleted file mode 100644 index 2f0b429f6a3337..00000000000000 --- a/src/app/zap-templates/partials/im_command_handler_cluster_commands.zapt +++ /dev/null @@ -1,91 +0,0 @@ -{{#if (isServer parent.clusterSide)}} -Commands::{{asUpperCamelCase commandName}}::DecodableType commandData; -TLVError = DataModel::Decode(aDataTlv, commandData); -if (TLVError == CHIP_NO_ERROR) { -wasHandled = emberAf{{asUpperCamelCase parent.clusterName}}Cluster{{asUpperCamelCase commandName}}Callback(apCommandObj, aCommandPath, commandData); -} -{{else}} -{{#if (zcl_command_arguments_count this.id)}} -expectArgumentCount = {{ zcl_command_arguments_count this.id }}; -{{#zcl_command_arguments}} - {{#if isArray}} - {{asUnderlyingZclType type}} {{asSymbol label}}; - {{else}} - {{#if_is_struct type}} - {{zapTypeToDecodableClusterObjectType type ns=parent.parent.clusterName}} {{asSymbol label}}; - {{else}} - {{asUnderlyingZclType type}} {{asSymbol label}}; - {{/if_is_struct}} - {{/if}} -{{/zcl_command_arguments}} -bool argExists[{{zcl_command_arguments_count this.id}}]; - -memset(argExists, 0, sizeof argExists); - -while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) -{ - // Since call to aDataTlv.Next() is CHIP_NO_ERROR, the read head always points to an element. - // Skip this element if it is not a ContextTag, not consider it as an error if other values are valid. - if (!TLV::IsContextTag(aDataTlv.GetTag())) - { - continue; - } - currentDecodeTagId = TLV::TagNumFromTag(aDataTlv.GetTag()); - if (currentDecodeTagId < {{zcl_command_arguments_count this.id}}) - { - if (argExists[currentDecodeTagId]) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB; - break; - } - else - { - argExists[currentDecodeTagId] = true; - validArgumentCount++; - } - } - switch (currentDecodeTagId) - { -{{#zcl_command_arguments}} - case {{fieldIdentifier}}: -{{#if isArray}} - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast({{asSymbol label}})); -{{else}} - {{#if_is_struct type}} - // Not supported, just error out. - TLVUnpackError = CHIP_ERROR_UNEXPECTED_TLV_ELEMENT; - {{else}} - TLVUnpackError = aDataTlv.Get({{asSymbol label}}); - {{/if_is_struct}} -{{/if}} - break; -{{/zcl_command_arguments}} - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (CHIP_NO_ERROR != TLVUnpackError) - { - break; - } -} - -if (CHIP_END_OF_TLV == TLVError) -{ - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; -} -{{/if}} - -{{#if (zcl_command_arguments_count this.id)}} -if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && {{zcl_command_arguments_count this.id}} == validArgumentCount) -{ -{{/if}} -wasHandled = emberAf{{asUpperCamelCase parent.clusterName}}Cluster{{asUpperCamelCase commandName}}Callback(aCommandPath.mEndpointId, apCommandObj{{#zcl_command_arguments}}, {{asSymbol label}}{{/zcl_command_arguments}}); -{{#if (zcl_command_arguments_count this.id)}} -} -{{/if}} -{{/if}} diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index e41e9328fac98d..734f34ce184dcd 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -36,7 +36,12 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP { {{/first}} case Commands::{{asUpperCamelCase commandName}}::Id: { - {{> im_command_handler_cluster_commands}} + Commands::{{asUpperCamelCase commandName}}::DecodableType commandData; + TLVError = DataModel::Decode(aDataTlv, commandData); + if (TLVError == CHIP_NO_ERROR) + { + wasHandled = emberAf{{asUpperCamelCase parent.clusterName}}Cluster{{asUpperCamelCase commandName}}Callback(apCommandObj, aCommandPath, commandData); + } break; } {{#last}} diff --git a/src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml index 90fb658802194f..c555247ad7a031 100644 --- a/src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/ballast-configuration-cluster.xml @@ -17,6 +17,17 @@ limitations under the License. + + + + + + + + + + + Ballast Configuration Lighting @@ -32,7 +43,7 @@ limitations under the License. PhysicalMinLevel PhysicalMaxLevel - BallastStatus + BallastStatus MinLevel MaxLevel @@ -46,7 +57,7 @@ limitations under the License. LampManufacturer LampRatedHours LampBurnHours - LampAlarmMode + LampAlarmMode LampBurnHoursTripPoint diff --git a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml index 0f1570465195f2..bab77e99dfe84e 100644 --- a/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/software-diagnostics-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index e8730291e5cece..8a794ee5701783 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -5042,9 +5042,18 @@ client cluster ColorControl = 768 { /** Attributes and commands for configuring a lighting ballast. */ client cluster BallastConfiguration = 769 { + bitmap BallastStatusBitmap : BITMAP8 { + kBallastNonOperational = 0x1; + kLampFailure = 0x2; + } + + bitmap LampAlarmModeBitmap : BITMAP8 { + kLampBurnHours = 0x1; + } + readonly attribute int8u physicalMinLevel = 0; readonly attribute int8u physicalMaxLevel = 1; - readonly attribute optional bitmap8 ballastStatus = 2; + readonly attribute optional BallastStatusBitmap ballastStatus = 2; attribute int8u minLevel = 16; attribute int8u maxLevel = 17; attribute optional nullable int8u intrinsicBallastFactor = 20; @@ -5054,7 +5063,7 @@ client cluster BallastConfiguration = 769 { attribute optional char_string<16> lampManufacturer = 49; attribute optional nullable int24u lampRatedHours = 50; attribute optional nullable int24u lampBurnHours = 51; - attribute optional bitmap8 lampAlarmMode = 52; + attribute optional LampAlarmModeBitmap lampAlarmMode = 52; attribute optional nullable int24u lampBurnHoursTripPoint = 53; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index b223c8522bc158..40196587dc825b 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -21938,7 +21938,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -22118,7 +22118,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index 9a97be24f17b40..0dbbe20286896c 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -7882,8 +7882,8 @@ JNI_METHOD(void, BallastConfigurationCluster, writeLampAlarmModeAttribute) std::vector> cleanupByteArrays; std::vector> cleanupStrings; - cppValue = - static_cast>(chip::JniReferences::GetInstance().IntegerToPrimitive(value)); + cppValue.SetRaw(static_cast::IntegerType>( + chip::JniReferences::GetInstance().IntegerToPrimitive(value))); std::unique_ptr onSuccess( Platform::New(callback), Platform::Delete); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index ccd8eff0932925..300e8b56cb66c7 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -26925,6 +26925,14 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None + class Bitmaps: + class BallastStatusBitmap(IntFlag): + kBallastNonOperational = 0x1 + kLampFailure = 0x2 + + class LampAlarmModeBitmap(IntFlag): + kLampBurnHours = 0x1 + class Attributes: @dataclass class PhysicalMinLevel(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h index 5bc302c6e39714..b584e30738740c 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.h @@ -30,6 +30,12 @@ typedef NS_ENUM(NSInteger, MTRAsyncWorkOutcome) { /// being cancelled). typedef BOOL (^MTRAsyncWorkCompletionBlock)(MTRAsyncWorkOutcome outcome); +typedef NS_ENUM(NSInteger, MTRBatchingOutcome) { + MTRNotBatched = 0, + MTRBatchedPartially, // some work was batched but the source item has work remaining + MTRBatchedFully, // the source item is now empty and can be dropped from the queue +}; + /// An optional handler that controls batching of MTRAsyncWorkItem. /// /// When a work item is dequeued to run, if it is of a type that can be @@ -47,15 +53,16 @@ typedef BOOL (^MTRAsyncWorkCompletionBlock)(MTRAsyncWorkOutcome outcome); /// `opaqueDataNext` is the data for the next item. The `fullyMerged` parameter /// will be initialized to NO by the caller. /// -/// The handler is expected to mutate the data as needed to achieve batching. -/// -/// If after the data mutations opaqueDataNext no longer requires any work, the -/// handler should set `fullyMerged` to YES to indicate that the next item can -/// be dropped from the queue. In this case, the handler may be called again to -/// possibly also batch the work item after the one that was dropped. +/// The handler is expected to mutate the data as needed to achieve batching, +/// and return an `MTRBatchingOutcome` to indicate if any or all of the work +/// from the next item was merged into the current item. A return value of +/// `MTRBatchedFully` indicates that `opaqueDataNext` no longer requires any +/// work and should be dropped from the queue. In this case, the handler may be +/// called again to possibly also batch the work item after the one that was +/// dropped. /// /// @see MTRAsyncWorkItem -typedef void (^MTRAsyncWorkBatchingHandler)(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged); +typedef MTRBatchingOutcome (^MTRAsyncWorkBatchingHandler)(id opaqueDataCurrent, id opaqueDataNext); /// An optional handler than enables duplicate checking for MTRAsyncWorkItem. /// @@ -100,6 +107,10 @@ MTR_TESTABLE /// Creates a work item that will run on the specified dispatch queue. - (instancetype)initWithQueue:(dispatch_queue_t)queue; +/// A unique (modulo overflow) ID automatically assigned to each work item for +/// the purpose of correlating log messages from the work queue. +@property (readonly, nonatomic) uint64_t uniqueID; + /// Called by the work queue to start this work item. /// /// Will be called on the dispatch queue associated with this item. @@ -188,6 +199,14 @@ MTR_TESTABLE /// re-used. - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item; +/// Same as `enqueueWorkItem:` but includes the description in queue logging. +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item + description:(nullable NSString *)description; + +/// Convenience for `enqueueWorkItem:description:` with a formatted string. +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item + descriptionWithFormat:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3); + /// Checks whether the queue already contains a work item matching the provided /// details. A client may call this method to avoid enqueueing duplicate work. /// diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm index 4de523ec0cd889..ff7242c3582377 100644 --- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm +++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm @@ -19,8 +19,11 @@ #import "MTRDefines_Internal.h" #import "MTRLogging_Internal.h" +#import #import +NS_ASSUME_NONNULL_BEGIN + typedef NS_ENUM(NSInteger, MTRAsyncWorkItemState) { MTRAsyncWorkItemMutable, MTRAsyncWorkItemComplete, @@ -29,6 +32,20 @@ typedef NS_ENUM(NSInteger, MTRAsyncWorkItemState) { MTRAsyncWorkItemRetryCountBase = MTRAsyncWorkItemRunning, // values >= MTRAsyncWorkItemRunning encode retryCount }; +// A helper struct that facilitates access to _context while +// - only reading the _context weak reference once and retaining a strong +// reference for the duration of a particular queue method call +// - avoiding calls to `[context description]` under our lock +struct ContextSnapshot { + id _Nullable reference; + NSString * _Nullable description; + ContextSnapshot(id _Nullable context) + { + reference = context; + description = [context description]; + } +}; + MTR_DIRECT_MEMBERS @implementation MTRAsyncWorkItem { dispatch_queue_t _queue; @@ -41,19 +58,21 @@ - (instancetype)initWithQueue:(dispatch_queue_t)queue { NSParameterAssert(queue); if (self = [super init]) { + static std::atomic nextUniqueID(1); + _uniqueID = nextUniqueID++; _queue = queue; _state = MTRAsyncWorkItemMutable; } return self; } -- (void)setReadyHandler:(void (^)(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion))readyHandler +- (void)setReadyHandler:(nullable void (^)(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion))readyHandler { [self assertMutable]; _readyHandler = readyHandler; } -- (void)setCancelHandler:(void (^)(void))cancelHandler +- (void)setCancelHandler:(nullable void (^)(void))cancelHandler { [self assertMutable]; _cancelHandler = cancelHandler; @@ -103,7 +122,6 @@ - (NSInteger)retryCount - (void)callReadyHandlerWithContext:(id)context completion:(MTRAsyncWorkCompletionBlock)completion { - // NSAssert(_state >= MTRAsyncWorkItemEnqueued, @"work item is not enqueued (%ld)", (long) _state); NSInteger retryCount = 0; if (_state == MTRAsyncWorkItemEnqueued) { @@ -117,8 +135,14 @@ - (void)callReadyHandlerWithContext:(id)context completion:(MTRAsyncWorkCompleti // Always dispatch even if there is no readyHandler as this avoids synchronously // re-entering the MTRAsyncWorkQueueCode, simplifying the implementation. + auto uniqueID = _uniqueID; auto readyHandler = _readyHandler; dispatch_async(_queue, ^{ + if (!retryCount) { + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> executing work item [%llu]", context, uniqueID); + } else { + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> executing work item [%llu] (retry %zd)", context, uniqueID, retryCount); + } if (readyHandler) { readyHandler(context, retryCount, completion); } else { @@ -160,6 +184,25 @@ - (void)markComplete _duplicateCheckHandler = nil; } +- (NSString *)description +{ + NSString * state; + switch (_state) { + case MTRAsyncWorkItemMutable: + state = @"mutable"; + break; + case MTRAsyncWorkItemComplete: + state = @"complete"; + break; + case MTRAsyncWorkItemEnqueued: + state = @"enqueued"; + break; + default: + return [NSString stringWithFormat:@"<%@ %llu running retry: %tu>", self.class, _uniqueID, self.retryCount]; + } + return [NSString stringWithFormat:@"<%@ %llu %@>", self.class, _uniqueID, state]; +} + @end MTR_DIRECT_MEMBERS @@ -182,29 +225,56 @@ - (instancetype)initWithContext:(id)context - (NSString *)description { + NSUInteger itemsCount; os_unfair_lock_lock(&_lock); - auto * result = [NSString stringWithFormat:@"<%@ context: %@ items count: %tu>", self.class, _context, _items.count]; + itemsCount = _items.count; os_unfair_lock_unlock(&_lock); - return result; + return [NSString stringWithFormat:@"<%@ context: %@ items count: %tu>", self.class, _context, itemsCount]; +} + +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item +{ + [self enqueueWorkItem:item description:nil]; +} + +- (void)enqueueWorkItem:(MTRAsyncWorkItem *)item descriptionWithFormat:(NSString *)format, ... +{ + va_list args; + va_start(args, format); + NSString * description = [[NSString alloc] initWithFormat:format arguments:args]; + va_end(args); + [self enqueueWorkItem:item description:description]; } - (void)enqueueWorkItem:(MTRAsyncWorkItem *)item + description:(nullable NSString *)description { NSParameterAssert(item); - NSAssert(_context, @"context has been lost"); + ContextSnapshot context(_context); // outside of lock + NSAssert(context.reference, @"context has been lost"); os_unfair_lock_lock(&_lock); [item markEnqueued]; [_items addObject:item]; - [self _callNextReadyWorkItem]; + + if (description) { + // Logging the description once is enough because other log messages + // related to the work item (execution, completion etc) can easily be + // correlated using the unique id. + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> enqueued work item [%llu]: %@", context.description, item.uniqueID, description); + } else { + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> enqueued work item [%llu]", context.description, item.uniqueID); + } + + [self _callNextReadyWorkItemWithContext:context]; os_unfair_lock_unlock(&_lock); } - (void)invalidate { - NSString * contextDescription = [_context description]; // outside of lock + ContextSnapshot context(_context); // outside of lock os_unfair_lock_lock(&_lock); - MTR_LOG_INFO("MTRAsyncWorkQueue<%@> invalidate %tu items", contextDescription, _items.count); + MTR_LOG_INFO("MTRAsyncWorkQueue<%@> invalidate %tu items", context.description, _items.count); for (MTRAsyncWorkItem * item in _items) { [item cancel]; } @@ -212,7 +282,9 @@ - (void)invalidate os_unfair_lock_unlock(&_lock); } -- (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem retry:(BOOL)retry +- (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem + context:(ContextSnapshot const &)context + retry:(BOOL)retry { os_unfair_lock_assert_owner(&_lock); @@ -222,18 +294,20 @@ - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem retry:(BOOL)retry return; } - // if work item is done (no need to retry), remove from queue and call ready on the next item - if (!retry) { + if (retry) { + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> retry needed for work item [%llu]", context.description, workItem.uniqueID); + } else { [workItem markComplete]; [_items removeObjectAtIndex:0]; + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> completed work item [%llu]", context.description, workItem.uniqueID); } // when "concurrency width" is implemented this will be decremented instead _runningWorkItemCount = 0; - [self _callNextReadyWorkItem]; + [self _callNextReadyWorkItemWithContext:context]; } -- (void)_callNextReadyWorkItem +- (void)_callNextReadyWorkItemWithContext:(ContextSnapshot const &)context { os_unfair_lock_assert_owner(&_lock); @@ -246,9 +320,8 @@ - (void)_callNextReadyWorkItem return; // nothing to run } - id context = _context; - if (!context) { - MTR_LOG_ERROR("MTRAsyncWorkQueue context has been lost, dropping queued work items"); + if (!context.reference) { + MTR_LOG_ERROR("MTRAsyncWorkQueue<%@> context has been lost, dropping queued work items", (id) nil); [_items removeAllObjects]; return; } @@ -264,27 +337,35 @@ - (void)_callNextReadyWorkItem while (_items.count >= 2) { MTRAsyncWorkItem * nextWorkItem = _items[1]; if (!nextWorkItem.batchingHandler || nextWorkItem.batchingID != workItem.batchingID) { - break; // next item is not eligible to merge with this one + goto done; // next item is not eligible to merge with this one } - BOOL fullyMerged = NO; - batchingHandler(workItem.batchableData, nextWorkItem.batchableData, &fullyMerged); - if (!fullyMerged) { - break; // not removing the next item, so we can't merge anything else + switch (batchingHandler(workItem.batchableData, nextWorkItem.batchableData)) { + case MTRNotBatched: + goto done; // can't merge anything else + case MTRBatchedPartially: + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> partially merged work item [%llu] into %llu", + context.description, nextWorkItem.uniqueID, workItem.uniqueID); + goto done; // can't merge anything else + case MTRBatchedFully: + MTR_LOG_DEFAULT("MTRAsyncWorkQueue<%@> fully merged work item [%llu] into %llu", + context.description, nextWorkItem.uniqueID, workItem.uniqueID); + [_items removeObjectAtIndex:1]; + continue; // try to batch the next item (if any) } - - [_items removeObjectAtIndex:1]; } + done:; } mtr_weakify(self); - [workItem callReadyHandlerWithContext:context completion:^(MTRAsyncWorkOutcome outcome) { + [workItem callReadyHandlerWithContext:context.reference completion:^(MTRAsyncWorkOutcome outcome) { mtr_strongify(self); BOOL handled = NO; if (self) { + ContextSnapshot context(self->_context); // re-acquire a new snapshot os_unfair_lock_lock(&self->_lock); if (!workItem.isComplete) { - [self _postProcessWorkItem:workItem retry:(outcome == MTRAsyncWorkNeedsRetry)]; + [self _postProcessWorkItem:workItem context:context retry:(outcome == MTRAsyncWorkNeedsRetry)]; handled = YES; } os_unfair_lock_unlock(&self->_lock); @@ -315,3 +396,5 @@ - (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id } @end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index d5d7040a927681..b4e73c8f97e044 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -46,4 +46,14 @@ _Pragma("clang diagnostic ignored \"-Wshadow\"") \ __strong typeof(local) _Nullable local = _mtr_weak_##local \ _Pragma("clang diagnostic pop") + +/// Declares an unused local of unspecified type, to prevent accidental +/// references to a shadowed variable of the same name. Note that hiding +/// `self` does not prevent implicit references to self due to ivar access. +#define mtr_hide(local) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wshadow\"") \ + __attribute__((unused)) variable_hidden_by_mtr_hide local; \ + _Pragma("clang diagnostic pop") +typedef struct {} variable_hidden_by_mtr_hide; // clang-format on diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 28874a560b287f..26f52986e8d239 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -857,7 +857,6 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) attributeID:(NSNumber *)attributeID params:(MTRReadParams *)params { - NSString * logPrefix = [NSString stringWithFormat:@"%@ read %@ %@ %@", self, endpointID, clusterID, attributeID]; MTRAttributePath * attributePath = [MTRAttributePath attributePathWithEndpointID:endpointID clusterID:clusterID attributeID:attributeID]; @@ -894,46 +893,43 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // Create work item, set ready handler to perform task, then enqueue the work MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; - [workItem setBatchingID:MTRDeviceWorkItemBatchingReadID data:readRequests handler:^(id opaqueDataCurrent, id opaqueDataNext, BOOL * fullyMerged) { + uint64_t workItemID = workItem.uniqueID; // capture only the ID, not the work item + [workItem setBatchingID:MTRDeviceWorkItemBatchingReadID data:readRequests handler:^(id opaqueDataCurrent, id opaqueDataNext) { + mtr_hide(self); // don't capture self accidentally NSMutableArray * readRequestsCurrent = opaqueDataCurrent; NSMutableArray * readRequestsNext = opaqueDataNext; - // Can only read up to 9 paths at a time, per spec - if (readRequestsCurrent.count >= 9) { - MTR_LOG_DEFAULT("%@ batching cannot add more", logPrefix); - return; - } - + MTRBatchingOutcome outcome = MTRNotBatched; while (readRequestsNext.count) { + // Can only read up to 9 paths at a time, per spec + if (readRequestsCurrent.count >= 9) { + MTR_LOG_INFO("Batching read attribute work item [%llu]: cannot add more work, item is full", workItemID); + return outcome; + } + // if params don't match then they cannot be merged if (![readRequestsNext[0][MTRDeviceReadRequestFieldParamsIndex] isEqual:readRequestsCurrent[0][MTRDeviceReadRequestFieldParamsIndex]]) { - MTR_LOG_DEFAULT("%@ batching merged all possible items", logPrefix); - return; + MTR_LOG_INFO("Batching read attribute work item [%llu]: cannot add more work, parameter mismatch", workItemID); + return outcome; } // merge the next item's first request into the current item's list - [readRequestsCurrent addObject:readRequestsNext[0]]; - MTR_LOG_INFO("%@ batching merging %@ => %lu total", logPrefix, readRequestsNext[0], - (unsigned long) readRequestsCurrent.count); + auto readItem = readRequestsNext.firstObject; [readRequestsNext removeObjectAtIndex:0]; - - // Can only read up to 9 paths at a time, per spec - if (readRequestsCurrent.count == 9) { - MTR_LOG_DEFAULT("%@ batching to max paths allowed", logPrefix); - break; - } - } - - if (readRequestsNext.count == 0) { - MTR_LOG_DEFAULT("%@ batching - fully merged next item", logPrefix); - *fullyMerged = YES; + [readRequestsCurrent addObject:readItem]; + MTR_LOG_INFO("Batching read attribute work item [%llu]: added %@ (now %tu requests total)", + workItemID, readItem, readRequestsCurrent.count); + outcome = MTRBatchedPartially; } + NSCAssert(readRequestsNext.count == 0, @"should have batched everything or returned early"); + return MTRBatchedFully; }]; [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { + mtr_hide(self); // don't capture self accidentally for (NSArray * readItem in readRequests) { if ([readItem isEqual:opaqueItemData]) { - MTR_LOG_DEFAULT("%@ duplicate check found %@ - report duplicate", logPrefix, readItem); + MTR_LOG_DEFAULT("Read attribute work item [%llu] report duplicate %@", workItemID, readItem); *isDuplicate = YES; *stop = YES; return; @@ -941,12 +937,10 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) } *stop = NO; }]; - [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); - + [workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { // Sanity check if (readRequests.count == 0) { - MTR_LOG_ERROR("%@ dequeueWorkItem no read requests", logPrefix); + MTR_LOG_ERROR("Read attribute work item [%llu] contained no read requests", workItemID); completion(MTRAsyncWorkComplete); return; } @@ -954,12 +948,7 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) // Build the attribute paths from the read requests NSMutableArray * attributePaths = [NSMutableArray array]; for (NSArray * readItem in readRequests) { - // Sanity check - if (readItem.count < 2) { - MTR_LOG_ERROR("%@ dequeueWorkItem read item missing info %@", logPrefix, readItem); - completion(MTRAsyncWorkComplete); - return; - } + NSAssert(readItem.count == 2, @"invalid read attribute item"); [attributePaths addObject:readItem[MTRDeviceReadRequestFieldPathIndex]]; } // If param is the NSNull stand-in, then just use nil @@ -976,22 +965,21 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) if (values) { // Since the format is the same data-value dictionary, this looks like an // attribute report - MTR_LOG_INFO("%@ completion values %@", logPrefix, values); + MTR_LOG_INFO("Read attribute work item [%llu] result: %@", workItemID, values); [self _handleAttributeReport:values]; } // TODO: better retry logic if (error && (retryCount < 2)) { - MTR_LOG_ERROR("%@ completion error %@ retryWork %lu", logPrefix, error, (unsigned long) retryCount); + MTR_LOG_ERROR("Read attribute work item [%llu] failed (will retry): %@", workItemID, error); completion(MTRAsyncWorkNeedsRetry); } else { - MTR_LOG_DEFAULT("%@ completion error %@ endWork", logPrefix, error); + MTR_LOG_DEFAULT("Read attribute work item [%llu] failed (giving up): %@", workItemID, error); completion(MTRAsyncWorkComplete); } }]; }]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); - [_asyncWorkQueue enqueueWorkItem:workItem]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"read %@ %@ %@", endpointID, clusterID, attributeID]; } return attributeValueToReturn; @@ -1004,7 +992,6 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID expectedValueInterval:(NSNumber *)expectedValueInterval timedWriteTimeout:(NSNumber * _Nullable)timeout { - NSString * logPrefix = [NSString stringWithFormat:@"%@ write %@ %@ %@", self, endpointID, clusterID, attributeID]; if (timeout) { timeout = MTRClampedNumber(timeout, @(1), @(UINT16_MAX)); } @@ -1020,14 +1007,14 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID expectedValueID:&expectedValueID]; MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; + uint64_t workItemID = workItem.uniqueID; // capture only the ID, not the work item // The write operation will install a duplicate check handler, to return NO for "isDuplicate". Since a write operation may // change values, only read requests after this should be considered for duplicate requests. [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { *isDuplicate = NO; *stop = YES; }]; - [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); + [workItem setReadyHandler:^(MTRDevice * self, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { MTRBaseDevice * baseDevice = [self newBaseDevice]; [baseDevice writeAttributeWithEndpointID:endpointID @@ -1037,15 +1024,14 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID timedWriteTimeout:timeout queue:self.queue completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { - MTR_LOG_DEFAULT("%@ completion error %@ endWork", logPrefix, error); if (error) { + MTR_LOG_ERROR("Write attribute work item [%llu] failed: %@", workItemID, error); [self removeExpectedValueForAttributePath:attributePath expectedValueID:expectedValueID]; } completion(MTRAsyncWorkComplete); }]; }]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); - [_asyncWorkQueue enqueueWorkItem:workItem]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"write %@ %@ %@", endpointID, clusterID, attributeID]; } - (void)invokeCommandWithEndpointID:(NSNumber *)endpointID @@ -1085,7 +1071,6 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { - NSString * logPrefix = [NSString stringWithFormat:@"%@ command %@ %@ %@", self, endpointID, clusterID, commandID]; if (!expectedValueInterval || ([expectedValueInterval compare:@(0)] == NSOrderedAscending)) { expectedValues = nil; } else { @@ -1105,6 +1090,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID } } MTRAsyncWorkItem * workItem = [[MTRAsyncWorkItem alloc] initWithQueue:self.queue]; + uint64_t workItemID = workItem.uniqueID; // capture only the ID, not the work item // The command operation will install a duplicate check handler, to return NO for "isDuplicate". Since a command operation may // change values, only read requests after this should be considered for duplicate requests. [workItem setDuplicateTypeID:MTRDeviceWorkItemDuplicateReadTypeID handler:^(id opaqueItemData, BOOL * isDuplicate, BOOL * stop) { @@ -1112,7 +1098,6 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID *stop = YES; }]; [workItem setReadyHandler:^(MTRDevice * device, NSInteger retryCount, MTRAsyncWorkCompletionBlock workCompletion) { - MTR_LOG_DEFAULT("%@ dequeueWorkItem %@", logPrefix, self->_asyncWorkQueue); MTRBaseDevice * baseDevice = [self newBaseDevice]; [baseDevice _invokeCommandWithEndpointID:endpointID @@ -1125,19 +1110,17 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID completion:^(NSArray *> * _Nullable values, NSError * _Nullable error) { // Log the data at the INFO level (not usually persisted permanently), // but make sure we log the work completion at the DEFAULT level. - MTR_LOG_INFO("%@ received response: %@ error: %@", logPrefix, values, error); + MTR_LOG_INFO("Invoke work item [%llu] received command response: %@ error: %@", workItemID, values, error); dispatch_async(queue, ^{ completion(values, error); }); if (error && expectedValues) { [self removeExpectedValuesForAttributePaths:attributePaths expectedValueID:expectedValueID]; } - MTR_LOG_DEFAULT("%@ endWork", logPrefix); workCompletion(MTRAsyncWorkComplete); }]; }]; - MTR_LOG_DEFAULT("%@ enqueueWorkItem %@", logPrefix, _asyncWorkQueue); - [_asyncWorkQueue enqueueWorkItem:workItem]; + [_asyncWorkQueue enqueueWorkItem:workItem descriptionWithFormat:@"invoke %@ %@ %@", endpointID, clusterID, commandID]; } - (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3eb535d3373401..7bfe5c0ebae565 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7633,6 +7633,10 @@ BarrierControl: - BarrierControlCapabilities - BarrierControlSafetyStatus + BallastConfiguration: + # The BallastConfiguration cluster is provisional for now, but not marked that way. + - BallastStatusBitmap + - LampAlarmModeBitmap attributes: GeneralDiagnostics: # Not in the spec yet. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index aa6b075c9e3cf0..f02f0d8f61c62b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -9605,7 +9605,7 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster(Attribute return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::MinLevel::Id: { @@ -9741,7 +9741,7 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster(Attribute return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::LampBurnHoursTripPoint::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index a57d1e9eb588c5..22657490eb413b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -15340,6 +15340,15 @@ typedef NS_OPTIONS(uint32_t, MTRColorControlFeature) { MTRColorControlFeatureColorTemperature MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x10, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRBallastConfigurationBallastStatusBitmap) { + MTRBallastConfigurationBallastStatusBitmapBallastNonOperational MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRBallastConfigurationBallastStatusBitmapLampFailure MTR_PROVISIONALLY_AVAILABLE = 0x2, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint8_t, MTRBallastConfigurationLampAlarmModeBitmap) { + MTRBallastConfigurationLampAlarmModeBitmapLampBurnHours MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRIlluminanceMeasurementLightSensorType) { MTRIlluminanceMeasurementLightSensorTypePhotodiode MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRIlluminanceMeasurementLightSensorTypeCMOS MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 0a5b259f062b7c..26e3d6accbdc38 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -72342,7 +72342,7 @@ - (void)readAttributeBallastStatusWithCompletion:(void (^)(NSNumber * _Nullable { MTRReadParams * params = [[MTRReadParams alloc] init]; using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; - return MTRReadAttribute(params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -72352,13 +72352,13 @@ - (void)subscribeAttributeBallastStatusWithParams:(MTRSubscribeParams * _Nonnull reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } + (void)readAttributeBallastStatusWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + auto * bridge = new MTRBallastConfigurationBallastStatusAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BallastConfigurationBallastStatusAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; using TypeInfo = BallastConfiguration::Attributes::BallastStatus::TypeInfo; @@ -73014,7 +73014,7 @@ - (void)readAttributeLampAlarmModeWithCompletion:(void (^)(NSNumber * _Nullable { MTRReadParams * params = [[MTRReadParams alloc] init]; using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; - return MTRReadAttribute(params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } @@ -73045,7 +73045,7 @@ - (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value params:( ListFreer listFreer; using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); @@ -73058,13 +73058,13 @@ - (void)subscribeAttributeLampAlarmModeWithParams:(MTRSubscribeParams * _Nonnull reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } + (void)readAttributeLampAlarmModeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - auto * bridge = new MTRInt8uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(Int8uAttributeCallback successCb, MTRErrorCallback failureCb) { + auto * bridge = new MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, ^(BallastConfigurationLampAlarmModeAttributeCallback successCb, MTRErrorCallback failureCb) { if (clusterStateCacheContainer.cppClusterStateCache) { chip::app::ConcreteAttributePath path; using TypeInfo = BallastConfiguration::Attributes::LampAlarmMode::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index cefe10ff1e2aea..5fb75a86607979 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -1399,6 +1399,10 @@ typedef void (*ColorControlEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ColorControlAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*BallastConfigurationBallastStatusAttributeCallback)( + void *, chip::BitMask); +typedef void (*BallastConfigurationLampAlarmModeAttributeCallback)( + void *, chip::BitMask); typedef void (*BallastConfigurationGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*BallastConfigurationAcceptedCommandListListAttributeCallback)( @@ -13509,6 +13513,72 @@ class MTRColorControlAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTRBallastConfigurationBallastStatusAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationBallastStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRBallastConfigurationBallastStatusAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRBallastConfigurationBallastStatusAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationBallastStatusAttributeCallbackBridge +{ +public: + MTRBallastConfigurationBallastStatusAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationBallastStatusAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRBallastConfigurationBallastStatusAttributeCallbackBridge::KeepAliveOnCallback; + using MTRBallastConfigurationBallastStatusAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, chip::BitMask value); +}; + +class MTRBallastConfigurationLampAlarmModeAttributeCallbackSubscriptionBridge + : public MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge +{ +public: + MTRBallastConfigurationLampAlarmModeAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge::KeepAliveOnCallback; + using MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index cd3d0947ea5379..d34f244c92f528 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -13167,6 +13167,50 @@ } } +void MTRBallastConfigurationBallastStatusAttributeCallbackBridge::OnSuccessFn(void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationBallastStatusAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRBallastConfigurationLampAlarmModeAttributeCallbackBridge::OnSuccessFn(void * context, chip::BitMask value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void MTRBallastConfigurationLampAlarmModeAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRBallastConfigurationGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value) { NSArray * _Nonnull objCValue; diff --git a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m index d7154afe996d77..031c45380496f0 100644 --- a/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m +++ b/src/darwin/Framework/CHIPTests/MTRAsyncWorkQueueTests.m @@ -50,7 +50,7 @@ - (void)testRunItem counter++; [expectation fulfill]; }; - [workQueue enqueueWorkItem:workItem1]; + [workQueue enqueueWorkItem:workItem1 description:@"work item 1"]; // Check for leaks. MTRAsyncWorkItem * __weak weakItem = workItem1; @@ -77,7 +77,7 @@ - (void)testRunItemsSerialized counter++; completion(MTRAsyncWorkComplete); }; - [workQueue enqueueWorkItem:workItem1]; + [workQueue enqueueWorkItem:workItem1 descriptionWithFormat:@"work item %d", 1]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { @@ -87,7 +87,7 @@ - (void)testRunItemsSerialized } completion(MTRAsyncWorkComplete); }; - [workQueue enqueueWorkItem:workItem2]; + [workQueue enqueueWorkItem:workItem2 description:@"work item 2"]; [self waitForExpectationsWithTimeout:2 handler:nil]; @@ -114,7 +114,7 @@ - (void)testRunItemsRetry completion(MTRAsyncWorkNeedsRetry); } }; - [workQueue enqueueWorkItem:workItem1]; + [workQueue enqueueWorkItem:workItem1 description:@"needs a retry"]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; workItem2.readyHandler = ^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { @@ -144,7 +144,7 @@ - (void)testRunItemsAfterDrain completion(MTRAsyncWorkComplete); [expectation1 fulfill]; }; - [workQueue enqueueWorkItem:workItem1]; + [workQueue enqueueWorkItem:workItem1 description:@"workItem1"]; [self waitForExpectations:@[ expectation1 ] timeout:2]; @@ -153,7 +153,7 @@ - (void)testRunItemsAfterDrain [expectation2 fulfill]; completion(MTRAsyncWorkComplete); }; - [workQueue enqueueWorkItem:workItem2]; + [workQueue enqueueWorkItem:workItem2 description:@"workItem2"]; [self waitForExpectationsWithTimeout:2 handler:nil]; } @@ -243,12 +243,12 @@ - (void)testBatching }]; [workItem1 setBatchingID:1 data:@(1) - handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond, BOOL * _Nonnull fullyMerged) { + handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond) { XCTAssertEqualObjects(opaqueDataFirst, @(1)); XCTAssertEqualObjects(opaqueDataSecond, @(2)); - *fullyMerged = YES; + return MTRBatchedFully; }]; - [workQueue enqueueWorkItem:workItem1]; + [workQueue enqueueWorkItem:workItem1 description:@"workItem1"]; MTRAsyncWorkItem * workItem2 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; [workItem2 setReadyHandler:^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { @@ -257,17 +257,18 @@ - (void)testBatching }]; [workItem2 setBatchingID:1 data:@(2) - handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond, BOOL * _Nonnull fullyMerged) { + handler:^(id _Nonnull opaqueDataFirst, id _Nonnull opaqueDataSecond) { workItem2BatchingCalled = YES; + return MTRBatchedPartially; }]; - [workQueue enqueueWorkItem:workItem2]; + [workQueue enqueueWorkItem:workItem2 description:@"workItem2"]; MTRAsyncWorkItem * workItem3 = [[MTRAsyncWorkItem alloc] initWithQueue:dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)]; [workItem3 setReadyHandler:^(id context, NSInteger retryCount, MTRAsyncWorkCompletionBlock completion) { [workItem3ReadyExpectation fulfill]; completion(MTRAsyncWorkComplete); }]; - [workQueue enqueueWorkItem:workItem3]; + [workQueue enqueueWorkItem:workItem3 description:@"workItem3"]; completion(MTRAsyncWorkComplete); }; diff --git a/src/lib/support/DefaultStorageKeyAllocator.h b/src/lib/support/DefaultStorageKeyAllocator.h index 6715f0298531f2..c33e1127015e39 100644 --- a/src/lib/support/DefaultStorageKeyAllocator.h +++ b/src/lib/support/DefaultStorageKeyAllocator.h @@ -185,7 +185,7 @@ class DefaultStorageKeyAllocator // ICD Management - static StorageKeyName IcdManagementTableEntry(chip::FabricIndex fabric, uint16_t index) + static StorageKeyName ICDManagementTableEntry(chip::FabricIndex fabric, uint16_t index) { return StorageKeyName::Formatted("f/%x/icd/%x", fabric, index); } diff --git a/src/messaging/BUILD.gn b/src/messaging/BUILD.gn index cd805fb52facae..cd32155d71a5d7 100644 --- a/src/messaging/BUILD.gn +++ b/src/messaging/BUILD.gn @@ -79,6 +79,6 @@ static_library("messaging") { ] if (chip_enable_icd_server) { - public_deps += [ "${chip_root}/src/app/icd:manager-srcs" ] + public_deps += [ "${chip_root}/src/app/icd:manager" ] } } diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index bd1eb2a3fc073c..652531c8ee8567 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -28,8 +28,8 @@ #include #if CHIP_CONFIG_ENABLE_ICD_SERVER +#include // nogncheck #include // nogncheck -#include // nogncheck #endif namespace chip { @@ -75,7 +75,7 @@ Optional GetLocalMRPConfig() // which the device can be at sleep and not be able to receive any messages). config.mIdleRetransTimeout += app::ICDManager::GetSlowPollingInterval(); config.mActiveRetransTimeout += app::ICDManager::GetFastPollingInterval(); - config.mActiveThresholdTime = System::Clock::Milliseconds16(IcdManagementServer::GetInstance().GetActiveModeThresholdMs()); + config.mActiveThresholdTime = System::Clock::Milliseconds16(ICDManagementServer::GetInstance().GetActiveModeThresholdMs()); #endif #if CONFIG_BUILD_FOR_HOST_UNIT_TEST diff --git a/src/platform/ASR/DiagnosticDataProviderImpl.cpp b/src/platform/ASR/DiagnosticDataProviderImpl.cpp index e5a14da8a5a1cd..621db3a19a21f7 100755 --- a/src/platform/ASR/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ASR/DiagnosticDataProviderImpl.cpp @@ -165,9 +165,9 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->name = CharSpan::fromCharString(ifp->Name); ifp->isOperational = true; if ((ifa->flags) & NETIF_FLAG_ETHERNET) - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet; else - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); diff --git a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp index ab1f2438639675..99d1928ef9c52f 100644 --- a/src/platform/Ameba/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Ameba/DiagnosticDataProviderImpl.cpp @@ -199,9 +199,9 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->name = CharSpan::fromCharString(ifp->Name); ifp->isOperational = true; if ((ifa->flags) & NETIF_FLAG_ETHERNET) - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet; else - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); diff --git a/src/platform/Beken/DiagnosticDataProviderImpl.cpp b/src/platform/Beken/DiagnosticDataProviderImpl.cpp index 95ee472fd8da90..2efe0729d78db7 100644 --- a/src/platform/Beken/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Beken/DiagnosticDataProviderImpl.cpp @@ -134,7 +134,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** Platform::CopyString(ifp->Name, netif->hostname); ifp->name = CharSpan::fromCharString(ifp->Name); - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; ifp->offPremiseServicesReachableIPv4.SetNonNull(false); ifp->offPremiseServicesReachableIPv6.SetNonNull(false); memcpy(ifp->MacAddress, netif->hwaddr, sizeof(netif->hwaddr)); diff --git a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp index 0afc494ac6cc29..6180eb77a9e37b 100644 --- a/src/platform/ESP32/DiagnosticDataProviderImpl.cpp +++ b/src/platform/ESP32/DiagnosticDataProviderImpl.cpp @@ -53,12 +53,12 @@ namespace { InterfaceTypeEnum GetInterfaceType(const char * if_desc) { if (strncmp(if_desc, "ap", strnlen(if_desc, 2)) == 0 || strncmp(if_desc, "sta", strnlen(if_desc, 3)) == 0) - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + return InterfaceTypeEnum::kWiFi; if (strncmp(if_desc, "openthread", strnlen(if_desc, 10)) == 0) - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + return InterfaceTypeEnum::kThread; if (strncmp(if_desc, "eth", strnlen(if_desc, 3)) == 0) - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + return InterfaceTypeEnum::kEthernet; + return InterfaceTypeEnum::kUnspecified; } #if CHIP_DEVICE_CONFIG_ENABLE_WIFI diff --git a/src/platform/Infineon/CYW30739/DiagnosticDataProviderImpl.cpp b/src/platform/Infineon/CYW30739/DiagnosticDataProviderImpl.cpp index 5b92bc25199ba1..fbb4f15f59919e 100644 --- a/src/platform/Infineon/CYW30739/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Infineon/CYW30739/DiagnosticDataProviderImpl.cpp @@ -107,7 +107,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); ifp->hardwareAddress = ByteSpan(ifp->MacAddress); - ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; static_assert(sizeof(ifp->MacAddress) >= ConfigurationManager::kPrimaryMACAddressLength, "Invalid MacAddress buffer size"); ConfigurationMgr().GetPrimary802154MACAddress(ifp->MacAddress); diff --git a/src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp b/src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp index 5fd94fdf05bfbf..761e04286d075d 100644 --- a/src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Infineon/PSOC6/DiagnosticDataProviderImpl.cpp @@ -161,7 +161,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** /* Update Network Interface list */ ifp->name = CharSpan::fromCharString(net_interface->name); ifp->isOperational = net_interface->flags & NETIF_FLAG_LINK_UP; - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; ifp->offPremiseServicesReachableIPv4 = mipv4_offpremise; ifp->offPremiseServicesReachableIPv6 = mipv6_offpremise; ifp->hardwareAddress = ByteSpan(net_interface->hwaddr, net_interface->hwaddr_len); diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index b9686d8ce104f8..8717d67d479b5a 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -1220,8 +1220,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(MutableByteSpan & value) // Walk through linked list, maintaining head pointer so we can free list later. for (struct ifaddrs * ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { if (ConnectivityUtils::GetInterfaceHardwareAddrs(ifa->ifa_name, value.data(), kMaxHardwareAddrSize) != CHIP_NO_ERROR) diff --git a/src/platform/Linux/ConnectivityUtils.cpp b/src/platform/Linux/ConnectivityUtils.cpp index 3d85f1cd3c2608..2924d48612317e 100644 --- a/src/platform/Linux/ConnectivityUtils.cpp +++ b/src/platform/Linux/ConnectivityUtils.cpp @@ -245,13 +245,13 @@ double ConnectivityUtils::ConvertFrequenceToFloat(const iw_freq * in) InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifname) { - InterfaceTypeEnum ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + InterfaceTypeEnum ret = InterfaceTypeEnum::kUnspecified; int sock = -1; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { ChipLogError(DeviceLayer, "Failed to open socket"); - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + return InterfaceTypeEnum::kUnspecified; } // Test wireless extensions for CONNECTION_WIFI @@ -260,7 +260,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn if (ioctl(sock, SIOCGIWNAME, &pwrq) != -1) { - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ret = InterfaceTypeEnum::kWiFi; } else if ((strncmp(ifname, "en", 2) == 0) || (strncmp(ifname, "eth", 3) == 0)) { @@ -271,7 +271,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn Platform::CopyString(ifr.ifr_name, ifname); if (ioctl(sock, SIOCETHTOOL, &ifr) != -1) - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ret = InterfaceTypeEnum::kEthernet; } close(sock); @@ -420,7 +420,7 @@ CHIP_ERROR ConnectivityUtils::GetWiFiInterfaceName(char * ifname, size_t bufSize can free list later */ for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; @@ -614,7 +614,7 @@ CHIP_ERROR ConnectivityUtils::GetEthInterfaceName(char * ifname, size_t bufSize) can free list later */ for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; diff --git a/src/platform/Linux/DiagnosticDataProviderImpl.cpp b/src/platform/Linux/DiagnosticDataProviderImpl.cpp index b4351970ac9206..f102b47b65ca6e 100644 --- a/src/platform/Linux/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Linux/DiagnosticDataProviderImpl.cpp @@ -91,8 +91,7 @@ CHIP_ERROR GetEthernetStatsCount(EthernetStatsCountType type, uint64_t & count) // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -156,8 +155,7 @@ CHIP_ERROR GetWiFiStatsCount(WiFiStatsCountType type, uint64_t & count) // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -413,10 +411,10 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveRadioFaults(GeneralFaultsifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -781,8 +778,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts() // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; diff --git a/src/platform/Tizen/ConnectivityUtils.cpp b/src/platform/Tizen/ConnectivityUtils.cpp index c5aa2437adbb60..b74a2832b93237 100644 --- a/src/platform/Tizen/ConnectivityUtils.cpp +++ b/src/platform/Tizen/ConnectivityUtils.cpp @@ -74,7 +74,7 @@ uint8_t ConnectivityUtils::MapFrequencyToChannel(const uint16_t frequency) InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifname) { - InterfaceTypeEnum ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + InterfaceTypeEnum ret = InterfaceTypeEnum::kUnspecified; int sock = -1; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) @@ -89,7 +89,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn if (ioctl(sock, SIOCGIWNAME, &pwrq) != -1) { - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ret = InterfaceTypeEnum::kWiFi; } else if ((strncmp(ifname, "en", 2) == 0) || (strncmp(ifname, "eth", 3) == 0)) { @@ -100,7 +100,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn Platform::CopyString(ifr.ifr_name, ifname); if (ioctl(sock, SIOCETHTOOL, &ifr) != -1) - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ret = InterfaceTypeEnum::kEthernet; } close(sock); @@ -239,7 +239,7 @@ CHIP_ERROR ConnectivityUtils::GetWiFiInterfaceName(char * ifname, size_t bufSize struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; @@ -405,7 +405,7 @@ CHIP_ERROR ConnectivityUtils::GetEthInterfaceName(char * ifname, size_t bufSize) struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; diff --git a/src/platform/Tizen/DiagnosticDataProviderImpl.cpp b/src/platform/Tizen/DiagnosticDataProviderImpl.cpp index 952cbb46db9ac9..28d1f02cfd40d1 100644 --- a/src/platform/Tizen/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Tizen/DiagnosticDataProviderImpl.cpp @@ -70,8 +70,7 @@ CHIP_ERROR GetEthernetStatsCount(EthernetStatsCountType type, uint64_t & count) struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -131,7 +130,7 @@ CHIP_ERROR GetWiFiStatsCount(WiFiStatsCountType type, uint64_t & count) struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -459,8 +458,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetEthNetworkDiagnosticsCounts() struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -628,7 +626,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts() struct ifaddrs * ifa = nullptr; for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; diff --git a/src/platform/Tizen/NetworkCommissioningEthernetDriver.cpp b/src/platform/Tizen/NetworkCommissioningEthernetDriver.cpp index 0d521c65c68eb9..63348991adb5c8 100644 --- a/src/platform/Tizen/NetworkCommissioningEthernetDriver.cpp +++ b/src/platform/Tizen/NetworkCommissioningEthernetDriver.cpp @@ -43,7 +43,7 @@ TizenEthernetDriver::EthernetNetworkIterator::EthernetNetworkIterator(TizenEther for (const auto * ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { if (DeviceLayer::Internal::ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet) { mInterfaces.push_back(ifa->ifa_name); if (mInterfaces.size() == mDriver->GetMaxNetworks()) diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index e7fc5b38428ba8..82bfbcb17fe5e9 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -258,19 +258,19 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** switch (interfaceType) { case Inet::InterfaceType::Unknown: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kUnspecified; break; case Inet::InterfaceType::WiFi: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; break; case Inet::InterfaceType::Ethernet: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet; break; case Inet::InterfaceType::Thread: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; break; case Inet::InterfaceType::Cellular: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_CELLULAR; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kCellular; break; } } diff --git a/src/platform/bouffalolab/common/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/common/DiagnosticDataProviderImpl.cpp index 8ad878a2474dec..45deceb2e03255 100644 --- a/src/platform/bouffalolab/common/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/common/DiagnosticDataProviderImpl.cpp @@ -191,8 +191,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveHardwareFaults(GeneralFaults & radioFaults) { #if CHIP_CONFIG_TEST - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT)); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kThreadFault))); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kBLEFault))); #endif return CHIP_NO_ERROR; @@ -219,7 +219,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->isOperational = true; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); @@ -231,9 +231,9 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->name = CharSpan::fromCharString(ifp->Name); ifp->isOperational = true; #if CHIP_DEVICE_CONFIG_ENABLE_WIFI - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; #else - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet; #endif ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); diff --git a/src/platform/cc13xx_26xx/DiagnosticDataProviderImpl.cpp b/src/platform/cc13xx_26xx/DiagnosticDataProviderImpl.cpp index ead676bcf81bfe..8e05a4e15a6297 100644 --- a/src/platform/cc13xx_26xx/DiagnosticDataProviderImpl.cpp +++ b/src/platform/cc13xx_26xx/DiagnosticDataProviderImpl.cpp @@ -219,8 +219,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveHardwareFaults(GeneralFaults & radioFaults) { #if CHIP_CONFIG_TEST - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT)); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kThreadFault))); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kBLEFault))); #endif return CHIP_NO_ERROR; @@ -248,7 +248,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->isOperational = true; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; otExtAddress extAddr; ThreadStackMgrImpl().GetExtAddress(extAddr); diff --git a/src/platform/mt793x/DiagnosticDataProviderImpl.cpp b/src/platform/mt793x/DiagnosticDataProviderImpl.cpp index 86a8f760b7a026..a375a9635f3b6a 100644 --- a/src/platform/mt793x/DiagnosticDataProviderImpl.cpp +++ b/src/platform/mt793x/DiagnosticDataProviderImpl.cpp @@ -182,8 +182,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveHardwareFaults(GeneralFaults & radioFaults) { #if CHIP_CONFIG_TEST - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT)); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kThreadFault))); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kBLEFault))); #endif return CHIP_NO_ERROR; @@ -210,7 +210,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->fabricConnected = true; ifp->offPremiseServicesReachableIPv4.SetNonNull(false); ifp->offPremiseServicesReachableIPv6.SetNonNull(false); - ifp->type = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = InterfaceTypeEnum::kThread; #else /* TODO */ #endif diff --git a/src/platform/nxp/k32w/k32w0/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/k32w/k32w0/DiagnosticDataProviderImpl.cpp index 4331e007c4b07c..b3e02f3f64cb71 100644 --- a/src/platform/nxp/k32w/k32w0/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/DiagnosticDataProviderImpl.cpp @@ -218,7 +218,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->isOperational = true; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); - ifp->type = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = InterfaceTypeEnum::kThread; uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); diff --git a/src/platform/nxp/k32w/k32w1/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/k32w/k32w1/DiagnosticDataProviderImpl.cpp index 5bc354351e4fb7..2b7dd8856c617b 100644 --- a/src/platform/nxp/k32w/k32w1/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/k32w/k32w1/DiagnosticDataProviderImpl.cpp @@ -209,7 +209,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->isOperational = true; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); - ifp->type = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = InterfaceTypeEnum::kThread; uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); diff --git a/src/platform/nxp/mw320/ConnectivityUtils.cpp b/src/platform/nxp/mw320/ConnectivityUtils.cpp index 956fba57fa232c..4756dc85065c84 100644 --- a/src/platform/nxp/mw320/ConnectivityUtils.cpp +++ b/src/platform/nxp/mw320/ConnectivityUtils.cpp @@ -243,7 +243,7 @@ double ConnectivityUtils::ConvertFrequenceToFloat(const iw_freq * in) InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifname) { // MW320 only has the wifi interface - InterfaceTypeEnum ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + InterfaceTypeEnum ret = InterfaceTypeEnum::kWiFi; return ret; } diff --git a/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp index 04a59761c87277..3b357371b0c03a 100644 --- a/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/mw320/DiagnosticDataProviderImpl.cpp @@ -163,7 +163,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->Name[Inet::InterfaceId::kMaxIfNameLength - 1] = '\0'; ifp->name = CharSpan::fromCharString(ifp->Name); ifp->isOperational = true; - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); if (ConnectivityUtils::GetInterfaceIPv4Addrs("", size, ifp) == CHIP_NO_ERROR) diff --git a/src/platform/qpg/DiagnosticDataProviderImpl.cpp b/src/platform/qpg/DiagnosticDataProviderImpl.cpp index 2a0ef745f50719..1afd80c1e5181f 100644 --- a/src/platform/qpg/DiagnosticDataProviderImpl.cpp +++ b/src/platform/qpg/DiagnosticDataProviderImpl.cpp @@ -160,8 +160,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveRadioFaults(GeneralFaults & radioFaults) { #if CHIP_CONFIG_TEST - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT)); - ReturnErrorOnFailure(radioFaults.add(EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT)); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kThreadFault))); + ReturnErrorOnFailure(radioFaults.add(to_underlying(RadioFaultEnum::kBLEFault))); #endif return CHIP_NO_ERROR; @@ -252,7 +252,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** ifp->isOperational = true; ifp->offPremiseServicesReachableIPv4.SetNull(); ifp->offPremiseServicesReachableIPv6.SetNull(); - ifp->type = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = InterfaceTypeEnum::kThread; uint8_t macBuffer[ConfigurationManager::kPrimaryMACAddressLength]; ConfigurationMgr().GetPrimary802154MACAddress(macBuffer); ifp->hardwareAddress = ByteSpan(macBuffer, ConfigurationManager::kPrimaryMACAddressLength); @@ -270,22 +270,22 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetNetworkInterfaces(NetworkInterface ** switch (interfaceType) { case Inet::InterfaceType::Unknown: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kUnspecified; break; case Inet::InterfaceType::WiFi: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; break; case Inet::InterfaceType::Ethernet: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kEthernet; break; case Inet::InterfaceType::Thread: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kThread; break; case Inet::InterfaceType::Cellular: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_CELLULAR; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kCellular; break; default: - ifp->type = EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ifp->type = app::Clusters::GeneralDiagnostics::InterfaceTypeEnum::kWiFi; break; } } diff --git a/src/platform/webos/ConnectivityManagerImpl.cpp b/src/platform/webos/ConnectivityManagerImpl.cpp index 12f261cc541fbe..e78e5aba192e68 100644 --- a/src/platform/webos/ConnectivityManagerImpl.cpp +++ b/src/platform/webos/ConnectivityManagerImpl.cpp @@ -1133,8 +1133,7 @@ CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(MutableByteSpan & value) // Walk through linked list, maintaining head pointer so we can free list later. for (struct ifaddrs * ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { if (ConnectivityUtils::GetInterfaceHardwareAddrs(ifa->ifa_name, value.data(), kMaxHardwareAddrSize) != CHIP_NO_ERROR) diff --git a/src/platform/webos/ConnectivityUtils.cpp b/src/platform/webos/ConnectivityUtils.cpp index 9e3121755badbf..ff4ea526a0e6f0 100644 --- a/src/platform/webos/ConnectivityUtils.cpp +++ b/src/platform/webos/ConnectivityUtils.cpp @@ -245,13 +245,13 @@ double ConnectivityUtils::ConvertFrequenceToFloat(const iw_freq * in) InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifname) { - InterfaceTypeEnum ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + InterfaceTypeEnum ret = InterfaceTypeEnum::kUnspecified; int sock = -1; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { ChipLogError(DeviceLayer, "Failed to open socket"); - return InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED; + return InterfaceTypeEnum::kUnspecified; } // Test wireless extensions for CONNECTION_WIFI @@ -260,7 +260,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn if (ioctl(sock, SIOCGIWNAME, &pwrq) != -1) { - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI; + ret = InterfaceTypeEnum::kWiFi; } else if ((strncmp(ifname, "en", 2) == 0) || (strncmp(ifname, "eth", 3) == 0)) { @@ -271,7 +271,7 @@ InterfaceTypeEnum ConnectivityUtils::GetInterfaceConnectionType(const char * ifn Platform::CopyString(ifr.ifr_name, ifname); if (ioctl(sock, SIOCETHTOOL, &ifr) != -1) - ret = InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET; + ret = InterfaceTypeEnum::kEthernet; } close(sock); @@ -328,7 +328,7 @@ CHIP_ERROR ConnectivityUtils::GetWiFiInterfaceName(char * ifname, size_t bufSize can free list later */ for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; @@ -522,7 +522,7 @@ CHIP_ERROR ConnectivityUtils::GetEthInterfaceName(char * ifname, size_t bufSize) can free list later */ for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { Platform::CopyString(ifname, bufSize, ifa->ifa_name); err = CHIP_NO_ERROR; diff --git a/src/platform/webos/DiagnosticDataProviderImpl.cpp b/src/platform/webos/DiagnosticDataProviderImpl.cpp index cf0a550243e09b..0c6136e8f0f584 100644 --- a/src/platform/webos/DiagnosticDataProviderImpl.cpp +++ b/src/platform/webos/DiagnosticDataProviderImpl.cpp @@ -88,8 +88,7 @@ CHIP_ERROR GetEthernetStatsCount(EthernetStatsCountType type, uint64_t & count) // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -153,8 +152,7 @@ CHIP_ERROR GetWiFiStatsCount(WiFiStatsCountType type, uint64_t & count) // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -399,10 +397,10 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetActiveRadioFaults(GeneralFaultsifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kEthernet) { ChipLogProgress(DeviceLayer, "Found the primary Ethernet interface:%s", StringOrNullMarker(ifa->ifa_name)); break; @@ -750,8 +747,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWiFiNetworkDiagnosticsCounts() // Walk through linked list, maintaining head pointer so we can free list later. for (ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { - if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == - InterfaceTypeEnum::EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI) + if (ConnectivityUtils::GetInterfaceConnectionType(ifa->ifa_name) == InterfaceTypeEnum::kWiFi) { ChipLogProgress(DeviceLayer, "Found the primary WiFi interface:%s", StringOrNullMarker(ifa->ifa_name)); break; diff --git a/third_party/openthread/repo b/third_party/openthread/repo index eaa62613a59392..786bd7f2e93b12 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit eaa62613a59392551b761c275e8cd05cbb5898f7 +Subproject commit 786bd7f2e93b12ed809df09e91fb02afca2dc48d 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 545e369130780a..eea6f71fe6596b 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 @@ -17058,9 +17058,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace BallastStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); @@ -17072,9 +17072,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -17456,9 +17456,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace LampAlarmMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, readable, sizeof(temp)); @@ -17470,9 +17470,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; 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 1430ddedd7efd8..6aa879d45c01b1 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 @@ -3021,8 +3021,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace PhysicalMaxLevel namespace BallastStatus { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value); // BallastStatusBitmap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace BallastStatus namespace MinLevel { @@ -3079,8 +3080,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace LampBurnHours namespace LampAlarmMode { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitMask * value); // LampAlarmModeBitmap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace LampAlarmMode namespace LampBurnHoursTripPoint { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index 949458b352d355..3f374ba71068bf 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -845,21 +845,11 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GeneralDiagnostics::Int using EnumType = GeneralDiagnostics::InterfaceTypeEnum; switch (val) { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM case EnumType::kUnspecified: case EnumType::kWiFi: case EnumType::kEthernet: case EnumType::kCellular: case EnumType::kThread: -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM - case EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED: - case EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI: - case EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET: - case EMBER_ZCL_INTERFACE_TYPE_ENUM_CELLULAR: - case EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD: -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM return val; default: return static_cast(5); @@ -884,9 +874,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GeneralDiagnostics::Rad using EnumType = GeneralDiagnostics::RadioFaultEnum; switch (val) { -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM case EnumType::kUnspecified: case EnumType::kWiFiFault: case EnumType::kCellularFault: @@ -894,15 +881,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(GeneralDiagnostics::Rad case EnumType::kNFCFault: case EnumType::kBLEFault: case EnumType::kEthernetFault: -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM - case EMBER_ZCL_RADIO_FAULT_ENUM_UNSPECIFIED: - case EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT: - case EMBER_ZCL_RADIO_FAULT_ENUM_CELLULAR_FAULT: - case EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT: - case EMBER_ZCL_RADIO_FAULT_ENUM_NFC_FAULT: - case EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT: - case EMBER_ZCL_RADIO_FAULT_ENUM_ETHERNET_FAULT: -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM return val; default: return static_cast(7); diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index af53f77a8b9ef6..d69da66fa05f6c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1011,9 +1011,6 @@ enum class HardwareFaultEnum : uint8_t kUnknownEnumValue = 11, }; -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for InterfaceTypeEnum enum class InterfaceTypeEnum : uint8_t { @@ -1028,10 +1025,6 @@ enum class InterfaceTypeEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 5, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using InterfaceTypeEnum = EmberAfInterfaceTypeEnum; -static InterfaceTypeEnum __attribute__((unused)) kInterfaceTypeEnumkUnknownEnumValue = static_cast(5); -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for NetworkFaultEnum enum class NetworkFaultEnum : uint8_t @@ -1047,9 +1040,6 @@ enum class NetworkFaultEnum : uint8_t kUnknownEnumValue = 4, }; -// Need to convert consumers to using the new enum classes, so we -// don't just have casts all over. -#ifdef CHIP_USE_ENUM_CLASS_FOR_IM_ENUM // Enum for RadioFaultEnum enum class RadioFaultEnum : uint8_t { @@ -1066,10 +1056,6 @@ enum class RadioFaultEnum : uint8_t // enum value. This specific should never be transmitted. kUnknownEnumValue = 7, }; -#else // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM -using RadioFaultEnum = EmberAfRadioFaultEnum; -static RadioFaultEnum __attribute__((unused)) kRadioFaultEnumkUnknownEnumValue = static_cast(7); -#endif // CHIP_USE_ENUM_CLASS_FOR_IM_ENUM } // namespace GeneralDiagnostics namespace SoftwareDiagnostics { @@ -3014,7 +3000,21 @@ enum class Feature : uint32_t }; } // namespace ColorControl -namespace BallastConfiguration {} // namespace BallastConfiguration +namespace BallastConfiguration { + +// Bitmap for BallastStatusBitmap +enum class BallastStatusBitmap : uint8_t +{ + kBallastNonOperational = 0x1, + kLampFailure = 0x2, +}; + +// Bitmap for LampAlarmModeBitmap +enum class LampAlarmModeBitmap : uint8_t +{ + kLampBurnHours = 0x1, +}; +} // namespace BallastConfiguration namespace IlluminanceMeasurement { 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 ca41b4b25a3dcd..cbc4e2c721b9a0 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 @@ -24568,9 +24568,9 @@ struct TypeInfo namespace BallastStatus { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::BallastStatus::Id; } @@ -24690,9 +24690,9 @@ struct TypeInfo namespace LampAlarmMode { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::BallastConfiguration::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LampAlarmMode::Id; } @@ -24758,9 +24758,10 @@ struct TypeInfo Attributes::PhysicalMinLevel::TypeInfo::DecodableType physicalMinLevel = static_cast(0); Attributes::PhysicalMaxLevel::TypeInfo::DecodableType physicalMaxLevel = static_cast(0); - Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = static_cast(0); - Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); - Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); + Attributes::BallastStatus::TypeInfo::DecodableType ballastStatus = + static_cast>(0); + Attributes::MinLevel::TypeInfo::DecodableType minLevel = static_cast(0); + Attributes::MaxLevel::TypeInfo::DecodableType maxLevel = static_cast(0); Attributes::IntrinsicBallastFactor::TypeInfo::DecodableType intrinsicBallastFactor; Attributes::BallastFactorAdjustment::TypeInfo::DecodableType ballastFactorAdjustment; Attributes::LampQuantity::TypeInfo::DecodableType lampQuantity = static_cast(0); @@ -24768,7 +24769,8 @@ struct TypeInfo Attributes::LampManufacturer::TypeInfo::DecodableType lampManufacturer; Attributes::LampRatedHours::TypeInfo::DecodableType lampRatedHours; Attributes::LampBurnHours::TypeInfo::DecodableType lampBurnHours; - Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = static_cast(0); + Attributes::LampAlarmMode::TypeInfo::DecodableType lampAlarmMode = + static_cast>(0); Attributes::LampBurnHoursTripPoint::TypeInfo::DecodableType lampBurnHoursTripPoint; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 7d30ac54349ac7..c5f97b46c44f83 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -63,16 +63,6 @@ enum EmberAfEnhancedColorMode : uint8_t EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION = 3, }; -// Enum for InterfaceTypeEnum -enum EmberAfInterfaceTypeEnum : uint8_t -{ - EMBER_ZCL_INTERFACE_TYPE_ENUM_UNSPECIFIED = 0, - EMBER_ZCL_INTERFACE_TYPE_ENUM_WI_FI = 1, - EMBER_ZCL_INTERFACE_TYPE_ENUM_ETHERNET = 2, - EMBER_ZCL_INTERFACE_TYPE_ENUM_CELLULAR = 3, - EMBER_ZCL_INTERFACE_TYPE_ENUM_THREAD = 4, -}; - // Enum for MoveMode enum EmberAfMoveMode : uint8_t { @@ -95,18 +85,6 @@ enum EmberAfPHYRateEnum : uint8_t EMBER_ZCL_PHY_RATE_ENUM_RATE400_G = 9, }; -// Enum for RadioFaultEnum -enum EmberAfRadioFaultEnum : uint8_t -{ - EMBER_ZCL_RADIO_FAULT_ENUM_UNSPECIFIED = 0, - EMBER_ZCL_RADIO_FAULT_ENUM_WI_FI_FAULT = 1, - EMBER_ZCL_RADIO_FAULT_ENUM_CELLULAR_FAULT = 2, - EMBER_ZCL_RADIO_FAULT_ENUM_THREAD_FAULT = 3, - EMBER_ZCL_RADIO_FAULT_ENUM_NFC_FAULT = 4, - EMBER_ZCL_RADIO_FAULT_ENUM_BLE_FAULT = 5, - EMBER_ZCL_RADIO_FAULT_ENUM_ETHERNET_FAULT = 6, -}; - // Enum for StepMode enum EmberAfStepMode : uint8_t { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 653d8d659d2ed5..0797ea0223d3b8 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -17828,8 +17828,8 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "physical-max-level", 0, UINT8_MAX, Attributes::PhysicalMaxLevel::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ballast-status", 0, UINT8_MAX, Attributes::BallastStatus::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "ballast-status", 0, UINT8_MAX, Attributes::BallastStatus::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "min-level", 0, UINT8_MAX, Attributes::MinLevel::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "max-level", 0, UINT8_MAX, Attributes::MaxLevel::Id, WriteCommandType::kWrite, @@ -17850,8 +17850,8 @@ void registerClusterBallastConfiguration(Commands & commands, CredentialIssuerCo Id, "lamp-rated-hours", 0, UINT32_MAX, Attributes::LampRatedHours::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>( Id, "lamp-burn-hours", 0, UINT32_MAX, Attributes::LampBurnHours::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "lamp-alarm-mode", 0, UINT8_MAX, Attributes::LampAlarmMode::Id, - WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>>( + Id, "lamp-alarm-mode", 0, UINT8_MAX, Attributes::LampAlarmMode::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>>(Id, "lamp-burn-hours-trip-point", 0, UINT32_MAX, Attributes::LampBurnHoursTripPoint::Id, WriteCommandType::kWrite, credsIssuerConfig), // 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 5fe79f45fa1b5f..4d231f57803a02 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -10346,7 +10346,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("PhysicalMaxLevel", 1, value); } case BallastConfiguration::Attributes::BallastStatus::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("BallastStatus", 1, value); } @@ -10396,7 +10396,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("LampBurnHours", 1, value); } case BallastConfiguration::Attributes::LampAlarmMode::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LampAlarmMode", 1, value); } diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 7548717b142ae3..88da0ea3ab8aaa 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -66735,7 +66735,7 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); @@ -66760,7 +66760,7 @@ class Test_TC_WAKEONLAN_1_5 : public TestCommandBridge { VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest();