From 60f0e13bef2ce8fa27f9ba4651160c1d471f6300 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 17 May 2023 10:10:39 -0400 Subject: [PATCH 01/12] vTaskPrioritySet(NULL, 0) doesn't always fix the issue it was trying to address and could even prevent the current task to be run again. Use a vTaskDelay of 500 ms to address the missing response issue and also make sure the task can execute the device reset. (#26585) --- src/platform/silabs/efr32/ConfigurationManagerImpl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp b/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp index 886a304b2ead17..fc87f438dc6541 100644 --- a/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp +++ b/src/platform/silabs/efr32/ConfigurationManagerImpl.cpp @@ -295,9 +295,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // When called from an RPC, the following reset occurs before the RPC can respond, // which breaks tests (because it looks like the RPC hasn't successfully completed). - // One way to fix this is to reduce the priority of this task, to allow logging to - // complete before the reset occurs. - vTaskPrioritySet(NULL, 0); + // Block the task for 500 ms before the reset occurs to allow RPC response to be sent + vTaskDelay(pdMS_TO_TICKS(500)); NVIC_SystemReset(); } From 367404f81bcd61d2665feb37fb9b8c4f3bf131cf Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Wed, 17 May 2023 10:29:21 -0400 Subject: [PATCH 02/12] Fix 917 logs (#26630) --- examples/platform/silabs/SiWx917/SiWx917/rsi_if.c | 2 ++ examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c | 2 ++ examples/platform/silabs/silabs_utils.cpp | 2 -- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 5 ----- src/platform/silabs/rs911x/wfx_sl_ble_init.c | 8 -------- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c index 745586a9868852..d05a0d132a5d8e 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c @@ -30,6 +30,8 @@ #include "rsi_driver.h" #include "rsi_wlan_non_rom.h" +#include "silabs_utils.h" + #include "rsi_bootup_config.h" #include "rsi_common_apis.h" #include "rsi_data_types.h" diff --git a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c index b731aef85660a9..0fa1c2f84f90e9 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c +++ b/examples/platform/silabs/SiWx917/SiWx917/wfx_rsi_host.c @@ -22,6 +22,8 @@ #include "sl_status.h" +#include "silabs_utils.h" + #include "FreeRTOS.h" #include "event_groups.h" #include "task.h" diff --git a/examples/platform/silabs/silabs_utils.cpp b/examples/platform/silabs/silabs_utils.cpp index 2e8a83bdf5be2b..f53eeb47953bbd 100644 --- a/examples/platform/silabs/silabs_utils.cpp +++ b/examples/platform/silabs/silabs_utils.cpp @@ -18,8 +18,6 @@ */ #include "silabs_utils.h" -#include "init_efrPlatform.h" -#include "sl_system_kernel.h" #include diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index b1dc9f77e2cb2c..3b908b05275d91 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -118,7 +118,6 @@ void sl_ble_event_handling_task(void) case RSI_BLE_CONN_EVENT: { rsi_ble_app_clear_event(RSI_BLE_CONN_EVENT); BLEMgrImpl().HandleConnectEvent(); - SILABS_LOG("%s Module got connected", __func__); // Requests the connection parameters change with the remote device rsi_ble_conn_params_update(event_msg.resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS, BLE_MAX_CONNECTION_INTERVAL_MS, BLE_SLAVE_LATENCY_MS, BLE_TIMEOUT_MS); @@ -126,7 +125,6 @@ void sl_ble_event_handling_task(void) break; case RSI_BLE_DISCONN_EVENT: { // event invokes when disconnection was completed - SILABS_LOG("%s Module got Disconnected", __func__); BLEMgrImpl().HandleConnectionCloseEvent(event_msg.reason); // clear the served event rsi_ble_app_clear_event(RSI_BLE_DISCONN_EVENT); @@ -134,7 +132,6 @@ void sl_ble_event_handling_task(void) break; case RSI_BLE_MTU_EVENT: { // event invokes when write/notification events received - SILABS_LOG("%s RSI_BLE_MTU_EVENT", __func__); BLEMgrImpl().UpdateMtu(event_msg.rsi_ble_mtu); // clear the served event rsi_ble_app_clear_event(RSI_BLE_MTU_EVENT); @@ -142,14 +139,12 @@ void sl_ble_event_handling_task(void) break; case RSI_BLE_GATT_WRITE_EVENT: { // event invokes when write/notification events received - SILABS_LOG("%s RSI_BLE_GATT_WRITE_EVENT", __func__); BLEMgrImpl().HandleWriteEvent(event_msg.rsi_ble_write); // clear the served event rsi_ble_app_clear_event(RSI_BLE_GATT_WRITE_EVENT); } break; case RSI_BLE_GATT_INDICATION_CONFIRMATION: { - SILABS_LOG("%s indication confirmation", __func__); BLEMgrImpl().HandleTxConfirmationEvent(1); rsi_ble_app_clear_event(RSI_BLE_GATT_INDICATION_CONFIRMATION); } diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.c b/src/platform/silabs/rs911x/wfx_sl_ble_init.c index 4429dc9277c3c7..f73a18e8ae3fbb 100644 --- a/src/platform/silabs/rs911x/wfx_sl_ble_init.c +++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.c @@ -44,7 +44,6 @@ const uint8_t ShortUUID_CHIPoBLEService[] = { 0xF6, 0xFF }; */ void rsi_ble_app_init_events() { - SILABS_LOG("%s: starting", __func__); event_msg.ble_app_event_map = 0; event_msg.ble_app_event_mask = 0xFFFFFFFF; event_msg.ble_app_event_mask = event_msg.ble_app_event_mask; // To suppress warning while compiling @@ -62,7 +61,6 @@ void rsi_ble_app_init_events() */ void rsi_ble_app_clear_event(uint32_t event_num) { - SILABS_LOG("%s: starting", __func__); event_msg.event_num = event_num; event_msg.ble_app_event_map &= ~BIT(event_num); return; @@ -79,7 +77,6 @@ void rsi_ble_app_clear_event(uint32_t event_num) */ void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu) { - SILABS_LOG("%s: starting", __func__); memcpy(&event_msg.rsi_ble_mtu, rsi_ble_mtu, sizeof(rsi_ble_event_mtu_t)); rsi_ble_app_set_event(RSI_BLE_MTU_EVENT); } @@ -96,7 +93,6 @@ void rsi_ble_on_mtu_event(rsi_ble_event_mtu_t * rsi_ble_mtu) */ void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ble_write) { - SILABS_LOG("%s: starting", __func__); event_msg.event_id = event_id; memcpy(&event_msg.rsi_ble_write, rsi_ble_write, sizeof(rsi_ble_event_write_t)); rsi_ble_app_set_event(RSI_BLE_GATT_WRITE_EVENT); @@ -113,7 +109,6 @@ void rsi_ble_on_gatt_write_event(uint16_t event_id, rsi_ble_event_write_t * rsi_ */ void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * resp_enh_conn) { - SILABS_LOG("%s: starting", __func__); event_msg.connectionHandle = 1; event_msg.bondingHandle = 255; memcpy(event_msg.resp_enh_conn.dev_addr, resp_enh_conn->dev_addr, RSI_DEV_ADDR_LEN); @@ -132,7 +127,6 @@ void rsi_ble_on_enhance_conn_status_event(rsi_ble_event_enhance_conn_status_t * */ void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, uint16_t reason) { - SILABS_LOG("%s: starting", __func__); event_msg.reason = reason; rsi_ble_app_set_event(RSI_BLE_DISCONN_EVENT); } @@ -148,7 +142,6 @@ void rsi_ble_on_disconnect_event(rsi_ble_event_disconnect_t * resp_disconnect, u */ void rsi_ble_on_event_indication_confirmation(uint16_t resp_status, rsi_ble_set_att_resp_t * rsi_ble_event_set_att_rsp) { - SILABS_LOG("%s: starting", __func__); event_msg.resp_status = resp_status; memcpy(&event_msg.rsi_ble_event_set_att_rsp, rsi_ble_event_set_att_rsp, sizeof(rsi_ble_set_att_resp_t)); rsi_ble_app_set_event(RSI_BLE_GATT_INDICATION_CONFIRMATION); @@ -191,7 +184,6 @@ int32_t rsi_ble_app_get_event(void) */ void rsi_ble_app_set_event(uint32_t event_num) { - SILABS_LOG("%s: starting", __func__); event_msg.ble_app_event_map |= BIT(event_num); rsi_semaphore_post(&sl_ble_event_sem); return; From 21ef744eeee43a5f69891301aee4e11f4a10e2ec Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 11:14:58 -0400 Subject: [PATCH 03/12] Add temperature type. (#26618) See https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/6486 --- scripts/py_matter_idl/matter_idl/generators/types.py | 1 + src/app/util/ember-compatibility-functions.cpp | 3 +++ src/app/zap-templates/common/override.js | 2 ++ src/app/zap-templates/zcl/data-model/chip/chip-types.xml | 1 + .../app-common/app-common/zap-generated/attribute-size.h | 4 ++-- .../app-common/app-common/zap-generated/attribute-type.h | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/types.py b/scripts/py_matter_idl/matter_idl/generators/types.py index b8c9f37b1d179a..960d73f28ea707 100644 --- a/scripts/py_matter_idl/matter_idl/generators/types.py +++ b/scripts/py_matter_idl/matter_idl/generators/types.py @@ -213,6 +213,7 @@ def is_struct(self) -> bool: "status": BasicInteger(idl_name="status", byte_count=2, is_signed=False), "systime_us": BasicInteger(idl_name="systime_us", byte_count=8, is_signed=False), "systime_ms": BasicInteger(idl_name="systime_ms", byte_count=8, is_signed=False), + "temperature": BasicInteger(idl_name="temperature", byte_count=2, is_signed=True), "tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False), "trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False), "vendor_id": BasicInteger(idl_name="vendor_id", byte_count=2, is_signed=False), diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 4bde3b05be8178..8cd6b4d52f87ba 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -138,6 +138,9 @@ EmberAfAttributeType BaseType(EmberAfAttributeType type) "chip::NodeId is expected to be uint64_t, change this when necessary"); return ZCL_INT64U_ATTRIBUTE_TYPE; + case ZCL_TEMPERATURE_ATTRIBUTE_TYPE: // Temperature + return ZCL_INT16S_ATTRIBUTE_TYPE; + default: return type; } diff --git a/src/app/zap-templates/common/override.js b/src/app/zap-templates/common/override.js index 97a90a58af4a77..98420cdabb1fda 100644 --- a/src/app/zap-templates/common/override.js +++ b/src/app/zap-templates/common/override.js @@ -83,6 +83,8 @@ function atomicType(arg) case 'utc': case 'elapsed_s': return 'uint32_t'; + case 'temperature': + return 'int16_t'; default: throw 'not overriding'; } diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index 464b8bb31848ab..e50f51f6fd9a18 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -65,6 +65,7 @@ limitations under the License. + diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-size.h b/zzz_generated/app-common/app-common/zap-generated/attribute-size.h index e2f7d4a0d160a9..8abca661608b0b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-size.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-size.h @@ -28,8 +28,8 @@ ZCL_BOOLEAN_ATTRIBUTE_TYPE, 1, ZCL_BITMAP8_ATTRIBUTE_TYPE, 1, ZCL_BITMAP16_ATTRI ZCL_INT24S_ATTRIBUTE_TYPE, 3, ZCL_INT32S_ATTRIBUTE_TYPE, 4, ZCL_INT40S_ATTRIBUTE_TYPE, 5, ZCL_INT48S_ATTRIBUTE_TYPE, 6, ZCL_INT56S_ATTRIBUTE_TYPE, 7, ZCL_INT64S_ATTRIBUTE_TYPE, 8, ZCL_ENUM8_ATTRIBUTE_TYPE, 1, ZCL_ENUM16_ATTRIBUTE_TYPE, 2, ZCL_SINGLE_ATTRIBUTE_TYPE, 4, ZCL_DOUBLE_ATTRIBUTE_TYPE, 8, ZCL_POSIX_MS_ATTRIBUTE_TYPE, 8, ZCL_SYSTIME_MS_ATTRIBUTE_TYPE, 8, - ZCL_ELAPSED_S_ATTRIBUTE_TYPE, 4, ZCL_TOD_ATTRIBUTE_TYPE, 4, ZCL_DATE_ATTRIBUTE_TYPE, 4, ZCL_EPOCH_US_ATTRIBUTE_TYPE, 8, - ZCL_EPOCH_S_ATTRIBUTE_TYPE, 4, ZCL_SYSTIME_US_ATTRIBUTE_TYPE, 8, ZCL_PERCENT_ATTRIBUTE_TYPE, 1, + ZCL_ELAPSED_S_ATTRIBUTE_TYPE, 4, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, 2, ZCL_TOD_ATTRIBUTE_TYPE, 4, ZCL_DATE_ATTRIBUTE_TYPE, 4, + ZCL_EPOCH_US_ATTRIBUTE_TYPE, 8, ZCL_EPOCH_S_ATTRIBUTE_TYPE, 4, ZCL_SYSTIME_US_ATTRIBUTE_TYPE, 8, ZCL_PERCENT_ATTRIBUTE_TYPE, 1, ZCL_PERCENT100THS_ATTRIBUTE_TYPE, 2, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 4, ZCL_ATTRIB_ID_ATTRIBUTE_TYPE, 4, ZCL_FIELD_ID_ATTRIBUTE_TYPE, 4, ZCL_EVENT_ID_ATTRIBUTE_TYPE, 4, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 4, ZCL_ACTION_ID_ATTRIBUTE_TYPE, 1, ZCL_TRANS_ID_ATTRIBUTE_TYPE, 4, ZCL_NODE_ID_ATTRIBUTE_TYPE, 8, ZCL_VENDOR_ID_ATTRIBUTE_TYPE, 2, diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h index c7f2f874229d8c..721aba2706f5dc 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h @@ -59,6 +59,7 @@ enum ZCL_POSIX_MS_ATTRIBUTE_TYPE = 0xD0, // Posix Time Milliseconds ZCL_SYSTIME_MS_ATTRIBUTE_TYPE = 0xD1, // System Time Milliseconds ZCL_ELAPSED_S_ATTRIBUTE_TYPE = 0xD2, // Elapsed Time Seconds + ZCL_TEMPERATURE_ATTRIBUTE_TYPE = 0xDB, // Temperature ZCL_TOD_ATTRIBUTE_TYPE = 0xE0, // Time of day ZCL_DATE_ATTRIBUTE_TYPE = 0xE1, // Date ZCL_EPOCH_US_ATTRIBUTE_TYPE = 0xE3, // Epoch Microseconds From 08babb685f7676f4d08fc3d806dbed10f8bcf38f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 12:12:57 -0400 Subject: [PATCH 04/12] Update Darwin availability annotations for Air Quality and ICD changes. (#26620) --- .../CHIP/templates/availability.yaml | 36 +- .../MTRAttributeTLVValueDecoder.mm | 253 ---- .../CHIP/zap-generated/MTRBaseClusters.h | 202 --- .../CHIP/zap-generated/MTRBaseClusters.mm | 713 ----------- .../zap-generated/MTRBaseClusters_Internal.h | 5 - .../CHIP/zap-generated/MTRCallbackBridge.h | 225 ---- .../CHIP/zap-generated/MTRCallbackBridge.mm | 243 ---- .../CHIP/zap-generated/MTRClusterConstants.h | 24 - .../CHIP/zap-generated/MTRClusters.h | 56 - .../CHIP/zap-generated/MTRClusters.mm | 329 ----- .../CHIP/zap-generated/MTRClusters_Internal.h | 5 - .../zap-generated/MTRCommandPayloadsObjc.h | 102 -- .../zap-generated/MTRCommandPayloadsObjc.mm | 130 -- .../zap-generated/MTREventTLVValueDecoder.mm | 15 - .../CHIP/zap-generated/MTRStructsObjc.h | 8 - .../CHIP/zap-generated/MTRStructsObjc.mm | 38 - .../zap-generated/cluster/Commands.h | 1139 ----------------- 17 files changed, 32 insertions(+), 3491 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index f7f786b68d710a..3280cacba0e578 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -6214,10 +6214,6 @@ - Dual CredentialRuleEnum: - Double - provisional: - clusters: - # Not ready to be public API yet. - - ClientMonitoring renames: clusters: UnitTesting: TestCluster @@ -7025,6 +7021,7 @@ versions: "future" introduced: clusters: + - AirQuality - HEPAFilterMonitoring - ActivatedCarbonFilterMonitoring - CeramicFilterMonitoring @@ -7038,6 +7035,13 @@ - InkCartridgeMonitoring - TonerCartridgeMonitoring attributes: + AirQuality: + - AirQuality + - GeneratedCommandList + - AcceptedCommandList + - AttributeList + - FeatureMap + - ClusterRevision BasicInformation: - ProductAppearance BridgedDeviceBasicInformation: @@ -7202,6 +7206,8 @@ - finish - primaryColor enums: + AirQuality: + - AirQualityEnum BasicInformation: - ColorEnum - ProductFinishEnum @@ -7245,6 +7251,15 @@ - ChangeIndicationEnum - DegradationDirectionEnum enum values: + AirQuality: + AirQualityEnum: + - Unknown + - Good + - Fair + - Moderate + - Poor + - VeryPoor + - ExtremelyPoor BasicInformation: ColorEnum: - Black @@ -7402,6 +7417,8 @@ - Up - Down bitmaps: + AirQuality: + - Feature Groups: - GroupsFeature PressureMeasurement: @@ -7435,6 +7452,12 @@ TonerCartridgeMonitoring: - Feature bitmap values: + AirQuality: + Feature: + - Fair + - Moderate + - VeryPoor + - ExtremelyPoor Groups: GroupsFeature: - GroupNames @@ -7571,9 +7594,14 @@ PumpConfigurationAndControl: PumpConfigurationAndControlFeature: PumpFeature provisional: + clusters: + # Not ready to be public API yet. + - ICDManagement # Once we actually unmark TimeSynchronization as provisional, all these bits should go away too, and we should instead # mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular. attributes: + AirQuality: + - EventList HEPAFilterMonitoring: - EventList ActivatedCarbonFilterMonitoring: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 96bb5e4415bd90..70f305e78f237b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -7858,230 +7858,6 @@ static id _Nullable DecodeAttributeValueForBooleanStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForICDManagementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IcdManagement; - switch (aAttributeId) { - case Attributes::IdleModeInterval::Id: { - using TypeInfo = Attributes::IdleModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveModeInterval::Id: { - using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveModeThreshold::Id: { - using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::RegisteredClients::Id: { - using TypeInfo = Attributes::RegisteredClients::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; - newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; - newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; - newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; - newElement_0.key = [NSData dataWithBytes:entry_0.key.data() length:entry_0.key.size()]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ICDCounter::Id: { - using TypeInfo = Attributes::ICDCounter::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClientsSupportedPerFabric::Id: { - using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} static id _Nullable DecodeAttributeValueForModeSelectCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -8378,32 +8154,6 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( } return value; } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } case Attributes::AttributeList::Id: { using TypeInfo = Attributes::AttributeList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -20207,9 +19957,6 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::BooleanState::Id: { return DecodeAttributeValueForBooleanStateCluster(aPath.mAttributeId, aReader, aError); } - case Clusters::IcdManagement::Id: { - return DecodeAttributeValueForICDManagementCluster(aPath.mAttributeId, aReader, aError); - } case Clusters::ModeSelect::Id: { return DecodeAttributeValueForModeSelectCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 6100a86cd791f0..3ca90637bbff2f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -7259,192 +7259,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end -/** - * Cluster ICD Management - * - * Allows servers to ensure that listed clients are notified when a server is available for communication. - */ -MTR_NEWLY_AVAILABLE -@interface MTRBaseClusterICDManagement : MTRCluster - -- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device - endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; - -/** - * Command RegisterClient - * - * Register a client to the end device - */ -- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params - completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -/** - * Command UnregisterClient - * - * Unregister a client from an end device - */ -- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -/** - * Command StayActiveRequest - * - * Request the end device to stay in Active Mode for an additional ActiveModeThreshold - */ -- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayActiveRequestWithCompletion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeRegisteredClientsWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeRegisteredClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeICDCounterWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeICDCounterWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeICDCounterWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeClientsSupportedPerFabricWithCompletion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeClientsSupportedPerFabricWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeClientsSupportedPerFabricWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - /** * Cluster Mode Select * @@ -7672,18 +7486,6 @@ MTR_NEWLY_AVAILABLE completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; - - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params @@ -22027,10 +21829,6 @@ typedef NS_ENUM(uint8_t, MTRGroupKeyManagementGroupKeySecurityPolicy) { MTRGroupKeyManagementGroupKeySecurityPolicyCacheAndSync API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -typedef NS_OPTIONS(uint32_t, MTRICDManagementFeature) { - MTRICDManagementFeatureCheckInProtocolSupport MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; - typedef NS_OPTIONS(uint32_t, MTRModeSelectFeature) { MTRModeSelectFeatureDEPONOFF API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index cf9d3c336e1fb3..69ec342a1f9180 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -45127,676 +45127,6 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16 @end -@implementation MTRBaseClusterICDManagement - -- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue -{ - if (self = [super initWithQueue:queue]) { - if (device == nil) { - return nil; - } - - _device = device; - _endpoint = [endpointID unsignedShortValue]; - } - return self; -} - -- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params - completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, - NSError * _Nullable error))completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRICDManagementClusterRegisterClientResponseCallbackBridge(self.callbackQueue, completion, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, - ICDManagementClusterRegisterClientResponseCallbackType successCb, MTRErrorCallback failureCb, - MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::RegisterClient::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - request.monitoredSubject = params.monitoredSubject.unsignedLongLongValue; - request.key = [self asByteSpan:params.key]; - if (params.verificationKey != nil) { - auto & definedValue_0 = request.verificationKey.Emplace(); - definedValue_0 = [self asByteSpan:params.verificationKey]; - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, - timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params - completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::UnregisterClient::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - if (params.key != nil) { - auto & definedValue_0 = request.key.Emplace(); - definedValue_0 = [self asByteSpan:params.key]; - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, - timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)stayActiveRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self stayActiveRequestWithParams:nil completion:completion]; -} -- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params - completion:(MTRStatusCompletion)completion -{ - // Make a copy of params before we go async. - params = [params copy]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.callbackQueue, - ^(id _Nullable value, NSError * _Nullable error) { - completion(error); - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::StayActiveRequest::Type request; - if (params != nil) { - if (params.timedInvokeTimeoutMs != nil) { - params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); - timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); - } - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, - timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(self.device); -} - -- (void)readAttributeIdleModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeIdleModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeIdleModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::IdleModeInterval::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeActiveModeIntervalWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeActiveModeIntervalWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeActiveModeIntervalWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::ActiveModeInterval::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeActiveModeThresholdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeActiveModeThresholdWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeActiveModeThresholdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::ActiveModeThreshold::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ // Make a copy of params before we go async. - params = [params copy]; - using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeRegisteredClientsWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeRegisteredClientsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRICDManagementRegisteredClientsListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ICDManagementRegisteredClientsListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::RegisteredClients::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeICDCounterWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeICDCounterWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeICDCounterWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::ICDCounter::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeClientsSupportedPerFabricWithCompletion:(void (^)( - NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeClientsSupportedPerFabricWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeClientsSupportedPerFabricWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, - NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::ClientsSupportedPerFabric::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ICDManagementGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::GeneratedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; - MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, - TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ICDManagementAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::AcceptedCommandList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; - MTRSubscribeAttribute( - params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRICDManagementEventListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ICDManagementEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::EventList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; - MTRSubscribeAttribute( - params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRICDManagementAttributeListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, - ^(ICDManagementAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::AttributeList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::FeatureMap::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion: - (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = IcdManagement::Attributes::ClusterRevision::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - -@end - @implementation MTRBaseClusterModeSelect - (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue @@ -47074,49 +46404,6 @@ + (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCa }); } -- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - MTRReadParams * params = [[MTRReadParams alloc] init]; - using TypeInfo = AirQuality::Attributes::EventList::TypeInfo; - return MTRReadAttribute( - params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); -} - -- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = AirQuality::Attributes::EventList::TypeInfo; - MTRSubscribeAttribute(params, - subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), - TypeInfo::GetAttributeId()); -} - -+ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer - endpoint:(NSNumber *)endpoint - queue:(dispatch_queue_t)queue - completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion -{ - auto * bridge = new MTRAirQualityEventListListAttributeCallbackBridge(queue, completion); - std::move(*bridge).DispatchLocalAction( - clusterStateCacheContainer.baseDevice, ^(AirQualityEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { - if (clusterStateCacheContainer.cppClusterStateCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = AirQuality::Attributes::EventList::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); - if (err == CHIP_NO_ERROR) { - successCb(bridge, value); - } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); -} - - (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index ffb8c6ad980b59..a6f1fd5cb10125 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -197,11 +197,6 @@ @property (nonatomic, assign, readonly) chip::EndpointId endpoint; @end -@interface MTRBaseClusterICDManagement () -@property (nonatomic, strong, readonly) MTRBaseDevice * device; -@property (nonatomic, assign, readonly) chip::EndpointId endpoint; -@end - @interface MTRBaseClusterModeSelect () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 63d9a53ccf48ca..d1da445d761ecb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -85,8 +85,6 @@ typedef void (*GroupKeyManagementClusterKeySetReadResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &); typedef void (*GroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackType)( void *, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &); -typedef void (*ICDManagementClusterRegisterClientResponseCallbackType)( - void *, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType &); typedef void (*DoorLockClusterGetWeekDayScheduleResponseCallbackType)( void *, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &); typedef void (*DoorLockClusterGetYearDayScheduleResponseCallbackType)( @@ -986,18 +984,6 @@ typedef void (*BooleanStateAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*BooleanStateAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ICDManagementRegisteredClientsListAttributeCallback)( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & data); -typedef void (*ICDManagementGeneratedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ICDManagementAcceptedCommandListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*ICDManagementEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); -typedef void (*ICDManagementAttributeListListAttributeCallback)( - void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ModeSelectSupportedModesListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); @@ -1011,8 +997,6 @@ typedef void (*AirQualityGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*AirQualityEventListListAttributeCallback)(void * context, - const chip::app::DataModel::DecodableList & data); typedef void (*AirQualityAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HEPAFilterMonitoringGeneratedCommandListListAttributeCallback)( @@ -6958,170 +6942,6 @@ class MTRBooleanStateAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRICDManagementRegisteredClientsListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementRegisteredClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementRegisteredClientsListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & value); -}; - -class MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge - : public MTRICDManagementRegisteredClientsListAttributeCallbackBridge -{ -public: - MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRICDManagementRegisteredClientsListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRICDManagementRegisteredClientsListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRICDManagementRegisteredClientsListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRICDManagementGeneratedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge - : public MTRICDManagementGeneratedCommandListListAttributeCallbackBridge -{ -public: - MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRICDManagementGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRICDManagementAcceptedCommandListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge - : public MTRICDManagementAcceptedCommandListListAttributeCallbackBridge -{ -public: - MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge( - dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRICDManagementAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRICDManagementEventListListAttributeCallbackBridge : public MTRCallbackBridge -{ -public: - MTRICDManagementEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRICDManagementEventListListAttributeCallbackSubscriptionBridge : public MTRICDManagementEventListListAttributeCallbackBridge -{ -public: - MTRICDManagementEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRICDManagementEventListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRICDManagementEventListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRICDManagementEventListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - -class MTRICDManagementAttributeListListAttributeCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge - : public MTRICDManagementAttributeListListAttributeCallbackBridge -{ -public: - MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRICDManagementAttributeListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRICDManagementAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRICDManagementAttributeListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRModeSelectSupportedModesListAttributeCallbackBridge : public MTRCallbackBridge { @@ -7320,36 +7140,6 @@ class MTRAirQualityAcceptedCommandListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRAirQualityEventListListAttributeCallbackBridge : public MTRCallbackBridge -{ -public: - MTRAirQualityEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRAirQualityEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); -}; - -class MTRAirQualityEventListListAttributeCallbackSubscriptionBridge : public MTRAirQualityEventListListAttributeCallbackBridge -{ -public: - MTRAirQualityEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action, - MTRSubscriptionEstablishedHandler establishedHandler) : - MTRAirQualityEventListListAttributeCallbackBridge(queue, handler, action), - mEstablishedHandler(establishedHandler) - {} - - void OnSubscriptionEstablished(); - using MTRAirQualityEventListListAttributeCallbackBridge::KeepAliveOnCallback; - using MTRAirQualityEventListListAttributeCallbackBridge::OnDone; - -private: - MTRSubscriptionEstablishedHandler mEstablishedHandler; -}; - class MTRAirQualityAttributeListListAttributeCallbackBridge : public MTRCallbackBridge { public: @@ -13119,21 +12909,6 @@ class MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseCallbackBridge const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data); }; -class MTRICDManagementClusterRegisterClientResponseCallbackBridge - : public MTRCallbackBridge -{ -public: - MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : - MTRCallbackBridge(queue, handler, OnSuccessFn){}; - - MTRICDManagementClusterRegisterClientResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, - MTRActionBlock action) : - MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - - static void OnSuccessFn(void * context, - const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data); -}; - class MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index d110d28072b1d7..9aff878f5f3e39 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -6400,201 +6400,6 @@ } } -void MTRICDManagementRegisteredClientsListAttributeCallbackBridge::OnSuccessFn(void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType> & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; - newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; - newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; - newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; - newElement_0.key = [NSData dataWithBytes:entry_0.key.data() length:entry_0.key.size()]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRICDManagementRegisteredClientsListAttributeCallbackSubscriptionBridge::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 MTRICDManagementGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRICDManagementGeneratedCommandListListAttributeCallbackSubscriptionBridge::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 MTRICDManagementAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRICDManagementAcceptedCommandListListAttributeCallbackSubscriptionBridge::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 MTRICDManagementEventListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRICDManagementEventListListAttributeCallbackSubscriptionBridge::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 MTRICDManagementAttributeListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRICDManagementAttributeListListAttributeCallbackSubscriptionBridge::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 MTRModeSelectSupportedModesListAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value) { @@ -6845,44 +6650,6 @@ } } -void MTRAirQualityEventListListAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::DecodableList & value) -{ - NSArray * _Nonnull objCValue; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = value.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - objCValue = array_0; - } - DispatchSuccess(context, objCValue); -}; - -void MTRAirQualityEventListListAttributeCallbackSubscriptionBridge::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 MTRAirQualityAttributeListListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -13889,16 +13656,6 @@ DispatchSuccess(context, response); }; -void MTRICDManagementClusterRegisterClientResponseCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::DecodableType & data) -{ - auto * response = [MTRICDManagementClusterRegisterClientResponseParams new]; - { - response.icdCounter = [NSNumber numberWithUnsignedInt:data.ICDCounter]; - } - DispatchSuccess(context, response); -}; - void MTRDoorLockClusterGetWeekDayScheduleResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 78253abfaa839a..cb390c88dc7b25 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -275,7 +275,6 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeProxyDiscoveryID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000043, MTRClusterIDTypeProxyValidID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000044, MTRClusterIDTypeBooleanStateID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, - MTRClusterIDTypeICDManagementID MTR_NEWLY_AVAILABLE = 0x00000046, MTRClusterIDTypeModeSelectID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000050, MTRClusterIDTypeAirQualityID MTR_NEWLY_AVAILABLE = 0x0000005B, MTRClusterIDTypeHEPAFilterMonitoringID MTR_NEWLY_AVAILABLE = 0x00000071, @@ -3592,23 +3591,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterBooleanStateAttributeClusterRevisionID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster ICDManagement attributes - MTRAttributeIDTypeClusterICDManagementAttributeIdleModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterICDManagementAttributeActiveModeIntervalID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRAttributeIDTypeClusterICDManagementAttributeActiveModeThresholdID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRAttributeIDTypeClusterICDManagementAttributeRegisteredClientsID MTR_NEWLY_AVAILABLE = 0x00000003, - MTRAttributeIDTypeClusterICDManagementAttributeICDCounterID MTR_NEWLY_AVAILABLE = 0x00000004, - MTRAttributeIDTypeClusterICDManagementAttributeClientsSupportedPerFabricID MTR_NEWLY_AVAILABLE = 0x00000005, - MTRAttributeIDTypeClusterICDManagementAttributeGeneratedCommandListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, - MTRAttributeIDTypeClusterICDManagementAttributeAcceptedCommandListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, - MTRAttributeIDTypeClusterICDManagementAttributeAttributeListID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeAttributeListID, - MTRAttributeIDTypeClusterICDManagementAttributeFeatureMapID MTR_NEWLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, - MTRAttributeIDTypeClusterICDManagementAttributeClusterRevisionID MTR_NEWLY_AVAILABLE - = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, - // Cluster ModeSelect deprecated attribute names MTRClusterModeSelectAttributeDescriptionID MTR_DEPRECATED( "Please use MTRAttributeIDTypeClusterModeSelectAttributeDescriptionID", ios(16.1, 16.4), macos(13.0, 13.3), @@ -8960,12 +8942,6 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000005, - // Cluster ICDManagement commands - MTRCommandIDTypeClusterICDManagementCommandRegisterClientID MTR_NEWLY_AVAILABLE = 0x00000000, - MTRCommandIDTypeClusterICDManagementCommandRegisterClientResponseID MTR_NEWLY_AVAILABLE = 0x00000001, - MTRCommandIDTypeClusterICDManagementCommandUnregisterClientID MTR_NEWLY_AVAILABLE = 0x00000002, - MTRCommandIDTypeClusterICDManagementCommandStayActiveRequestID MTR_NEWLY_AVAILABLE = 0x00000003, - // Cluster ModeSelect deprecated command id names MTRClusterModeSelectCommandChangeToModeID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterModeSelectCommandChangeToModeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 53e7fefd1af627..ece7422921c04a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -2653,62 +2653,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @end -/** - * Cluster ICD Management - * Allows servers to ensure that listed clients are notified when a server is available for communication. - */ -MTR_NEWLY_AVAILABLE -@interface MTRClusterICDManagement : MTRCluster - -- (instancetype _Nullable)initWithDevice:(MTRDevice *)device - endpointID:(NSNumber *)endpointID - queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_NEWLY_AVAILABLE; - -- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params - expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries - expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; -- (void)stayActiveRequestWithExpectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeICDCounterWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeClientsSupportedPerFabricWithParams:(MTRReadParams * _Nullable)params - MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; - -@end - /** * Cluster Mode Select * Attributes and commands for selecting a mode from a list of supported options. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index c207093eb0f115..6bb2a75441c7d4 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -12419,335 +12419,6 @@ - (instancetype)initWithDevice:(MTRDevice *)device endpoint:(uint16_t)endpoint q @end -@implementation MTRClusterICDManagement - -- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue -{ - if (self = [super initWithQueue:queue]) { - if (device == nil) { - return nil; - } - - _endpoint = [endpointID unsignedShortValue]; - _device = device; - } - return self; -} - -- (void)registerClientWithParams:(MTRICDManagementClusterRegisterClientParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(void (^)(MTRICDManagementClusterRegisterClientResponseParams * _Nullable data, - NSError * _Nullable error))completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, - (unsigned int) MTRCommandIDTypeClusterICDManagementCommandRegisterClientID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRICDManagementClusterRegisterClientResponseCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(value, error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, - ICDManagementClusterRegisterClientResponseCallbackType successCb, MTRErrorCallback failureCb, - MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::RegisterClient::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - if (params != nil) { - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout - = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - request.monitoredSubject = params.monitoredSubject.unsignedLongLongValue; - request.key = [self asByteSpan:params.key]; - if (params.verificationKey != nil) { - auto & definedValue_0 = request.verificationKey.Emplace(); - definedValue_0 = [self asByteSpan:params.verificationKey]; - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, - self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (void)unregisterClientWithParams:(MTRICDManagementClusterUnregisterClientParams *)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, - (unsigned int) MTRCommandIDTypeClusterICDManagementCommandUnregisterClientID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::UnregisterClient::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - if (params != nil) { - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout - = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - request.checkInNodeID = params.checkInNodeID.unsignedLongLongValue; - if (params.key != nil) { - auto & definedValue_0 = request.key.Emplace(); - definedValue_0 = [self asByteSpan:params.key]; - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, - self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (void)stayActiveRequestWithExpectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - [self stayActiveRequestWithParams:nil - expectedValues:expectedValues - expectedValueInterval:expectedValueIntervalMs - completion:completion]; -} -- (void)stayActiveRequestWithParams:(MTRICDManagementClusterStayActiveRequestParams * _Nullable)params - expectedValues:(NSArray *> *)expectedValues - expectedValueInterval:(NSNumber *)expectedValueIntervalMs - completion:(MTRStatusCompletion)completion -{ - NSString * logPrefix = [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, - _endpoint, (unsigned int) MTRClusterIDTypeICDManagementID, - (unsigned int) MTRCommandIDTypeClusterICDManagementCommandStayActiveRequestID]; - // Make a copy of params before we go async. - params = [params copy]; - NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; - if (timedInvokeTimeoutMsParam) { - timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); - } - MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; - MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { - MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); - MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID - controller:self.device.deviceController]; - auto * bridge = new MTRCommandSuccessCallbackBridge( - self.device.queue, - ^(id _Nullable value, NSError * _Nullable error) { - MTRClustersLogCompletion(logPrefix, value, error); - dispatch_async(self.callbackQueue, ^{ - completion(error); - }); - [workItem endWork]; - }, - ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, - MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { - auto * typedBridge = static_cast(bridge); - Optional timedInvokeTimeoutMs; - Optional invokeTimeout; - ListFreer listFreer; - IcdManagement::Commands::StayActiveRequest::Type request; - if (timedInvokeTimeoutMsParam != nil) { - timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); - } - if (params != nil) { - if (params.serverSideProcessingTimeout != nil) { - // Clamp to a number of seconds that will not overflow 32-bit - // int when converted to ms. - auto * serverSideProcessingTimeout - = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); - invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); - } - } - - return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, - self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); - }); - std::move(*bridge).DispatchAction(baseDevice); - }; - workItem.readyHandler = readyHandler; - MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); - [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; - - if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { - expectedValues = nil; - } else { - expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); - } - if (expectedValues) { - [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; - } -} - -- (NSDictionary *)readAttributeIdleModeIntervalWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeIdleModeIntervalID) - params:params]; -} - -- (NSDictionary *)readAttributeActiveModeIntervalWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeActiveModeIntervalID) - params:params]; -} - -- (NSDictionary *)readAttributeActiveModeThresholdWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeActiveModeThresholdID) - params:params]; -} - -- (NSDictionary *)readAttributeRegisteredClientsWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeRegisteredClientsID) - params:params]; -} - -- (NSDictionary *)readAttributeICDCounterWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeICDCounterID) - params:params]; -} - -- (NSDictionary *)readAttributeClientsSupportedPerFabricWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeClientsSupportedPerFabricID) - params:params]; -} - -- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeGeneratedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeAcceptedCommandListID) - params:params]; -} - -- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeAttributeListID) - params:params]; -} - -- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeFeatureMapID) - params:params]; -} - -- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:@(_endpoint) - clusterID:@(MTRClusterIDTypeICDManagementID) - attributeID:@(MTRAttributeIDTypeClusterICDManagementAttributeClusterRevisionID) - params:params]; -} - -@end - @implementation MTRClusterModeSelect - (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index 402c2b067e3644..f5fa1c36720734 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -198,11 +198,6 @@ @property (nonatomic, readonly) MTRDevice * device; @end -@interface MTRClusterICDManagement () -@property (nonatomic, readonly) uint16_t endpoint; -@property (nonatomic, readonly) MTRDevice * device; -@end - @interface MTRClusterModeSelect () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 2f013bf34bde32..c0fc5850b09365 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -3682,108 +3682,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end -MTR_NEWLY_AVAILABLE -@interface MTRICDManagementClusterRegisterClientParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSNumber * _Nonnull monitoredSubject MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSData * _Nonnull key MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSData * _Nullable verificationKey MTR_NEWLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRICDManagementClusterRegisterClientResponseParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull icdCounter MTR_NEWLY_AVAILABLE; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRICDManagementClusterUnregisterClientParams : NSObject - -@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; - -@property (nonatomic, copy) NSData * _Nullable key MTR_NEWLY_AVAILABLE; -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end - -MTR_NEWLY_AVAILABLE -@interface MTRICDManagementClusterStayActiveRequestParams : NSObject -/** - * Controls whether the command is a timed command (using Timed Invoke). - * - * If nil (the default value), a regular invoke is done for commands that do - * not require a timed invoke and a timed invoke with some default timed request - * timeout is done for commands that require a timed invoke. - * - * If not nil, a timed invoke is done, with the provided value used as the timed - * request timeout. The value should be chosen small enough to provide the - * desired security properties but large enough that it will allow a round-trip - * from the sever to the client (for the status response and actual invoke - * request) within the timeout window. - * - */ -@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; - -/** - * Controls how much time, in seconds, we will allow for the server to process the command. - * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. - * - * If nil, the framework will try to select an appropriate timeout value itself. - */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; -@end - API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRModeSelectClusterChangeToModeParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 4c3db3c2c0b2dc..2e86fa59c6f6bb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -4439,136 +4439,6 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRICDManagementClusterRegisterClientParams -- (instancetype)init -{ - if (self = [super init]) { - - _checkInNodeID = @(0); - - _monitoredSubject = @(0); - - _key = [NSData data]; - - _verificationKey = nil; - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRICDManagementClusterRegisterClientParams alloc] init]; - - other.checkInNodeID = self.checkInNodeID; - other.monitoredSubject = self.monitoredSubject; - other.key = self.key; - other.verificationKey = self.verificationKey; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: checkInNodeID:%@; monitoredSubject:%@; key:%@; verificationKey:%@; >", - NSStringFromClass([self class]), _checkInNodeID, _monitoredSubject, [_key base64EncodedStringWithOptions:0], - [_verificationKey base64EncodedStringWithOptions:0]]; - return descriptionString; -} - -@end -@implementation MTRICDManagementClusterRegisterClientResponseParams -- (instancetype)init -{ - if (self = [super init]) { - - _icdCounter = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRICDManagementClusterRegisterClientResponseParams alloc] init]; - - other.icdCounter = self.icdCounter; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = - [NSString stringWithFormat:@"<%@: icdCounter:%@; >", NSStringFromClass([self class]), _icdCounter]; - return descriptionString; -} - -@end -@implementation MTRICDManagementClusterUnregisterClientParams -- (instancetype)init -{ - if (self = [super init]) { - - _checkInNodeID = @(0); - - _key = nil; - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRICDManagementClusterUnregisterClientParams alloc] init]; - - other.checkInNodeID = self.checkInNodeID; - other.key = self.key; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: checkInNodeID:%@; key:%@; >", NSStringFromClass([self class]), - _checkInNodeID, [_key base64EncodedStringWithOptions:0]]; - return descriptionString; -} - -@end -@implementation MTRICDManagementClusterStayActiveRequestParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRICDManagementClusterStayActiveRequestParams alloc] init]; - - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; -} - @end @implementation MTRModeSelectClusterChangeToModeParams - (instancetype)init diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 967b27ba74c634..c2f6412ab9a110 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -1539,18 +1539,6 @@ static id _Nullable DecodeEventPayloadForBooleanStateCluster(EventId aEventId, T *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } -static id _Nullable DecodeEventPayloadForICDManagementCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IcdManagement; - switch (aEventId) { - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - return nil; -} static id _Nullable DecodeEventPayloadForModeSelectCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::ModeSelect; @@ -2750,9 +2738,6 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::BooleanState::Id: { return DecodeEventPayloadForBooleanStateCluster(aPath.mEventId, aReader, aError); } - case Clusters::IcdManagement::Id: { - return DecodeEventPayloadForICDManagementCluster(aPath.mEventId, aReader, aError); - } case Clusters::ModeSelect::Id: { return DecodeEventPayloadForModeSelectCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 1f827875b5c47c..77be660c039fb5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -658,14 +658,6 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy) NSNumber * _Nonnull stateValue API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @end -MTR_NEWLY_AVAILABLE -@interface MTRICDManagementClusterMonitoringRegistrationStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull checkInNodeID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull monitoredSubject MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSData * _Nonnull key MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull fabricIndex MTR_NEWLY_AVAILABLE; -@end - API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRModeSelectClusterSemanticTagStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull mfgCode API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index e41cdd2999bb55..bc26064a203a12 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -2599,44 +2599,6 @@ - (NSString *)description @end -@implementation MTRICDManagementClusterMonitoringRegistrationStruct -- (instancetype)init -{ - if (self = [super init]) { - - _checkInNodeID = @(0); - - _monitoredSubject = @(0); - - _key = [NSData data]; - - _fabricIndex = @(0); - } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone -{ - auto other = [[MTRICDManagementClusterMonitoringRegistrationStruct alloc] init]; - - other.checkInNodeID = self.checkInNodeID; - other.monitoredSubject = self.monitoredSubject; - other.key = self.key; - other.fabricIndex = self.fabricIndex; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString - stringWithFormat:@"<%@: checkInNodeID:%@; monitoredSubject:%@; key:%@; fabricIndex:%@; >", NSStringFromClass([self class]), - _checkInNodeID, _monitoredSubject, [_key base64EncodedStringWithOptions:0], _fabricIndex]; - return descriptionString; -} - -@end - @implementation MTRModeSelectClusterSemanticTagStruct - (instancetype)init { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 7c2d5574e12da1..25faa4cbe1a955 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -37031,1030 +37031,6 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute } }; -/*----------------------------------------------------------------------------*\ -| Cluster IcdManagement | 0x0046 | -|------------------------------------------------------------------------------| -| Commands: | | -| * RegisterClient | 0x00 | -| * UnregisterClient | 0x02 | -| * StayActiveRequest | 0x03 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * IdleModeInterval | 0x0000 | -| * ActiveModeInterval | 0x0001 | -| * ActiveModeThreshold | 0x0002 | -| * RegisteredClients | 0x0003 | -| * ICDCounter | 0x0004 | -| * ClientsSupportedPerFabric | 0x0005 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command RegisterClient - */ -class IcdManagementRegisterClient : public ClusterCommand { -public: - IcdManagementRegisterClient() - : ClusterCommand("register-client") - { - AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); - AddArgument("MonitoredSubject", 0, UINT64_MAX, &mRequest.monitoredSubject); - AddArgument("Key", &mRequest.key); - AddArgument("VerificationKey", &mRequest.verificationKey); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRICDManagementClusterRegisterClientParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.checkInNodeID = [NSNumber numberWithUnsignedLongLong:mRequest.checkInNodeID]; - params.monitoredSubject = [NSNumber numberWithUnsignedLongLong:mRequest.monitoredSubject]; - params.key = [NSData dataWithBytes:mRequest.key.data() length:mRequest.key.size()]; - if (mRequest.verificationKey.HasValue()) { - params.verificationKey = [NSData dataWithBytes:mRequest.verificationKey.Value().data() - length:mRequest.verificationKey.Value().size()]; - } else { - params.verificationKey = nil; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster registerClientWithParams:params - completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::IcdManagement::Commands::RegisterClient::Type mRequest; -}; - -/* - * Command UnregisterClient - */ -class IcdManagementUnregisterClient : public ClusterCommand { -public: - IcdManagementUnregisterClient() - : ClusterCommand("unregister-client") - { - AddArgument("CheckInNodeID", 0, UINT64_MAX, &mRequest.checkInNodeID); - AddArgument("Key", &mRequest.key); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRICDManagementClusterUnregisterClientParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - params.checkInNodeID = [NSNumber numberWithUnsignedLongLong:mRequest.checkInNodeID]; - if (mRequest.key.HasValue()) { - params.key = [NSData dataWithBytes:mRequest.key.Value().data() length:mRequest.key.Value().size()]; - } else { - params.key = nil; - } - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster unregisterClientWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::IcdManagement::Commands::UnregisterClient::Type mRequest; -}; - -/* - * Command StayActiveRequest - */ -class IcdManagementStayActiveRequest : public ClusterCommand { -public: - IcdManagementStayActiveRequest() - : ClusterCommand("stay-active-request") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) command (0x00000003) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRICDManagementClusterStayActiveRequestParams alloc] init]; - params.timedInvokeTimeoutMs - = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster stayActiveRequestWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; - } - return CHIP_NO_ERROR; - } - -private: -}; - -/* - * Attribute IdleModeInterval - */ -class ReadIcdManagementIdleModeInterval : public ReadAttribute { -public: - ReadIcdManagementIdleModeInterval() - : ReadAttribute("idle-mode-interval") - { - } - - ~ReadIcdManagementIdleModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000000) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeIdleModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement IdleModeInterval read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementIdleModeInterval : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementIdleModeInterval() - : SubscribeAttribute("idle-mode-interval") - { - } - - ~SubscribeAttributeIcdManagementIdleModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000000) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeIdleModeIntervalWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ActiveModeInterval - */ -class ReadIcdManagementActiveModeInterval : public ReadAttribute { -public: - ReadIcdManagementActiveModeInterval() - : ReadAttribute("active-mode-interval") - { - } - - ~ReadIcdManagementActiveModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000001) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeActiveModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement ActiveModeInterval read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementActiveModeInterval : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementActiveModeInterval() - : SubscribeAttribute("active-mode-interval") - { - } - - ~SubscribeAttributeIcdManagementActiveModeInterval() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000001) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeActiveModeIntervalWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ActiveModeThreshold - */ -class ReadIcdManagementActiveModeThreshold : public ReadAttribute { -public: - ReadIcdManagementActiveModeThreshold() - : ReadAttribute("active-mode-threshold") - { - } - - ~ReadIcdManagementActiveModeThreshold() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000002) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeActiveModeThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement ActiveModeThreshold read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementActiveModeThreshold : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementActiveModeThreshold() - : SubscribeAttribute("active-mode-threshold") - { - } - - ~SubscribeAttributeIcdManagementActiveModeThreshold() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000002) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeActiveModeThresholdWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute RegisteredClients - */ -class ReadIcdManagementRegisteredClients : public ReadAttribute { -public: - ReadIcdManagementRegisteredClients() - : ReadAttribute("registered-clients") - { - } - - ~ReadIcdManagementRegisteredClients() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000003) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRReadParams alloc] init]; - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - [cluster readAttributeRegisteredClientsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement RegisteredClients read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementRegisteredClients : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementRegisteredClients() - : SubscribeAttribute("registered-clients") - { - } - - ~SubscribeAttributeIcdManagementRegisteredClients() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000003) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeRegisteredClientsWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ICDCounter - */ -class ReadIcdManagementICDCounter : public ReadAttribute { -public: - ReadIcdManagementICDCounter() - : ReadAttribute("icdcounter") - { - } - - ~ReadIcdManagementICDCounter() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000004) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeICDCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ICDCounter response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement ICDCounter read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementICDCounter : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementICDCounter() - : SubscribeAttribute("icdcounter") - { - } - - ~SubscribeAttributeIcdManagementICDCounter() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000004) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeICDCounterWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ICDCounter response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ClientsSupportedPerFabric - */ -class ReadIcdManagementClientsSupportedPerFabric : public ReadAttribute { -public: - ReadIcdManagementClientsSupportedPerFabric() - : ReadAttribute("clients-supported-per-fabric") - { - } - - ~ReadIcdManagementClientsSupportedPerFabric() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x00000005) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeClientsSupportedPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement ClientsSupportedPerFabric read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementClientsSupportedPerFabric : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementClientsSupportedPerFabric() - : SubscribeAttribute("clients-supported-per-fabric") - { - } - - ~SubscribeAttributeIcdManagementClientsSupportedPerFabric() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x00000005) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeClientsSupportedPerFabricWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute GeneratedCommandList - */ -class ReadIcdManagementGeneratedCommandList : public ReadAttribute { -public: - ReadIcdManagementGeneratedCommandList() - : ReadAttribute("generated-command-list") - { - } - - ~ReadIcdManagementGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFF8) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement GeneratedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementGeneratedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementGeneratedCommandList() - : SubscribeAttribute("generated-command-list") - { - } - - ~SubscribeAttributeIcdManagementGeneratedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFF8) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeGeneratedCommandListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AcceptedCommandList - */ -class ReadIcdManagementAcceptedCommandList : public ReadAttribute { -public: - ReadIcdManagementAcceptedCommandList() - : ReadAttribute("accepted-command-list") - { - } - - ~ReadIcdManagementAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFF9) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement AcceptedCommandList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementAcceptedCommandList : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementAcceptedCommandList() - : SubscribeAttribute("accepted-command-list") - { - } - - ~SubscribeAttributeIcdManagementAcceptedCommandList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFF9) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeAcceptedCommandListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute EventList - */ -class ReadIcdManagementEventList : public ReadAttribute { -public: - ReadIcdManagementEventList() - : ReadAttribute("event-list") - { - } - - ~ReadIcdManagementEventList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.EventList response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement EventList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementEventList : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementEventList() - : SubscribeAttribute("event-list") - { - } - - ~SubscribeAttributeIcdManagementEventList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeEventListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.EventList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute AttributeList - */ -class ReadIcdManagementAttributeList : public ReadAttribute { -public: - ReadIcdManagementAttributeList() - : ReadAttribute("attribute-list") - { - } - - ~ReadIcdManagementAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFB) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.AttributeList response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement AttributeList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementAttributeList : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementAttributeList() - : SubscribeAttribute("attribute-list") - { - } - - ~SubscribeAttributeIcdManagementAttributeList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFB) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeAttributeListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.AttributeList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute FeatureMap - */ -class ReadIcdManagementFeatureMap : public ReadAttribute { -public: - ReadIcdManagementFeatureMap() - : ReadAttribute("feature-map") - { - } - - ~ReadIcdManagementFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFC) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.FeatureMap response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement FeatureMap read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementFeatureMap : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementFeatureMap() - : SubscribeAttribute("feature-map") - { - } - - ~SubscribeAttributeIcdManagementFeatureMap() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFC) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeFeatureMapWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.FeatureMap response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - -/* - * Attribute ClusterRevision - */ -class ReadIcdManagementClusterRevision : public ReadAttribute { -public: - ReadIcdManagementClusterRevision() - : ReadAttribute("cluster-revision") - { - } - - ~ReadIcdManagementClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReadAttribute (0x0000FFFD) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); - if (error != nil) { - LogNSError("ICDManagement ClusterRevision read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeIcdManagementClusterRevision : public SubscribeAttribute { -public: - SubscribeAttributeIcdManagementClusterRevision() - : SubscribeAttribute("cluster-revision") - { - } - - ~SubscribeAttributeIcdManagementClusterRevision() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x00000046) ReportAttribute (0x0000FFFD) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterICDManagement alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeClusterRevisionWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - /*----------------------------------------------------------------------------*\ | Cluster ModeSelect | 0x0050 | |------------------------------------------------------------------------------| @@ -39201,76 +38177,6 @@ class SubscribeAttributeAirQualityAcceptedCommandList : public SubscribeAttribut } }; -/* - * Attribute EventList - */ -class ReadAirQualityEventList : public ReadAttribute { -public: - ReadAirQualityEventList() - : ReadAttribute("event-list") - { - } - - ~ReadAirQualityEventList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000005B) ReadAttribute (0x0000FFFA) on endpoint %u", endpointId); - - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterAirQuality alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"AirQuality.EventList response %@", [value description]); - if (error != nil) { - LogNSError("AirQuality EventList read Error", error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeAirQualityEventList : public SubscribeAttribute { -public: - SubscribeAttributeAirQualityEventList() - : SubscribeAttribute("event-list") - { - } - - ~SubscribeAttributeAirQualityEventList() {} - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - ChipLogProgress(chipTool, "Sending cluster (0x0000005B) ReportAttribute (0x0000FFFA) on endpoint %u", endpointId); - dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); - __auto_type * cluster = [[MTRBaseClusterAirQuality alloc] initWithDevice:device - endpointID:@(endpointId) - queue:callbackQueue]; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; - if (mKeepSubscriptions.HasValue()) { - params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); - } - if (mFabricFiltered.HasValue()) { - params.filterByFabric = mFabricFiltered.Value(); - } - if (mAutoResubscribe.HasValue()) { - params.resubscribeAutomatically = mAutoResubscribe.Value(); - } - [cluster subscribeAttributeEventListWithParams:params - subscriptionEstablished:^() { - mSubscriptionEstablished = YES; - } - reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"AirQuality.EventList response %@", [value description]); - SetCommandExitStatus(error); - }]; - - return CHIP_NO_ERROR; - } -}; - /* * Attribute AttributeList */ @@ -109077,48 +107983,6 @@ void registerClusterBooleanState(Commands & commands) commands.Register(clusterName, clusterCommands); } -void registerClusterIcdManagement(Commands & commands) -{ - using namespace chip::app::Clusters::IcdManagement; - - const char * clusterName = "IcdManagement"; - - commands_list clusterCommands = { - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(Id), // - make_unique(), // - make_unique(Id), // - make_unique(Id), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // - }; - - commands.Register(clusterName, clusterCommands); -} void registerClusterModeSelect(Commands & commands) { using namespace chip::app::Clusters::ModeSelect; @@ -109176,8 +108040,6 @@ void registerClusterAirQuality(Commands & commands) make_unique(), // make_unique(), // make_unique(), // - make_unique(), // - make_unique(), // make_unique(), // make_unique(), // make_unique(), // @@ -111671,7 +110533,6 @@ void registerClusters(Commands & commands) registerClusterFixedLabel(commands); registerClusterUserLabel(commands); registerClusterBooleanState(commands); - registerClusterIcdManagement(commands); registerClusterModeSelect(commands); registerClusterAirQuality(commands); registerClusterHepaFilterMonitoring(commands); From 5a3e7a357b234933421972f2c0d6b1308a130d35 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 12:13:37 -0400 Subject: [PATCH 05/12] Add methods for doing schema checks on response-value command payload dictionaries. (#26586) * Add methods for doing schema checks on response-value command payload dictionaries. This adds a way to initialize strongly typed command response structs with a response-value dictionary representing a command response. * Fix typo in error message. Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> --------- Co-authored-by: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 61 + .../Framework/CHIP/MTRBaseDevice_Internal.h | 14 + .../CHIP/templates/MTRCallbackBridge-src.zapt | 1 + .../templates/MTRCommandPayloadsObjc-src.zapt | 64 + .../templates/MTRCommandPayloadsObjc.zapt | 15 + .../MTRCommandPayloads_Internal.zapt | 26 + .../templates/partials/MTRCallbackBridge.zapt | 8 +- .../Framework/CHIP/templates/templates.json | 5 + .../CHIP/zap-generated/MTRCallbackBridge.mm | 1598 +------ .../zap-generated/MTRCommandPayloadsObjc.h | 728 +++ .../zap-generated/MTRCommandPayloadsObjc.mm | 4254 ++++++++++++++++- .../MTRCommandPayloads_Internal.h | 417 ++ .../CHIPTests/MTRDataValueParserTests.m | 138 + .../Framework/CHIPTests/MTRDeviceTests.m | 11 + 14 files changed, 5944 insertions(+), 1396 deletions(-) create mode 100644 src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Internal.zapt create mode 100644 src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index d39dd74c2d2819..151ec1beeb21de 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -230,6 +230,11 @@ static void CauseReadClientFailure( } #endif +static bool CheckMemberOfType(NSDictionary * responseValue, NSString * memberName, Class expectedClass, + NSString * errorMessage, NSError * __autoreleasing * error); +static void LogStringAndReturnError(NSString * errorStr, CHIP_ERROR errorCode, NSError * __autoreleasing * error); +static void LogStringAndReturnError(NSString * errorStr, MTRErrorCode errorCode, NSError * __autoreleasing * error); + @implementation MTRReadClientContainer - (void)onDone { @@ -1807,6 +1812,62 @@ + (NSDictionary *)eventReportForHeader:(const chip::app::EventHeader &)header an timestampKey : timestampValue }; } + ++ (System::PacketBufferHandle)_responseDataForCommand:(NSDictionary *)responseValue + clusterID:(chip::ClusterId)clusterID + commandID:(chip::CommandId)commandID + error:(NSError * __autoreleasing *)error +{ + if (!CheckMemberOfType(responseValue, MTRCommandPathKey, [MTRCommandPath class], + @"response-value command path is not an MTRCommandPath.", error)) { + return System::PacketBufferHandle(); + } + + MTRCommandPath * path = responseValue[MTRCommandPathKey]; + + if (![path.cluster isEqualToNumber:@(clusterID)]) { + LogStringAndReturnError([NSString stringWithFormat:@"Expected cluster id %@ but got %@", path.cluster, @(clusterID)], + MTRErrorCodeSchemaMismatch, error); + return System::PacketBufferHandle(); + } + + if (![path.command isEqualToNumber:@(commandID)]) { + LogStringAndReturnError([NSString stringWithFormat:@"Expected command id %@ but got %@", path.command, @(commandID)], + MTRErrorCodeSchemaMismatch, error); + return System::PacketBufferHandle(); + } + + if (!CheckMemberOfType( + responseValue, MTRDataKey, [NSDictionary class], @"response-value data is not a data-value dictionary.", error)) { + return System::PacketBufferHandle(); + } + + NSDictionary * data = responseValue[MTRDataKey]; + + auto buffer = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + LogStringAndReturnError(@"Unable to allocate encoding buffer", CHIP_ERROR_NO_MEMORY, error); + return System::PacketBufferHandle(); + } + + System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + CHIP_ERROR errorCode = MTREncodeTLVFromDataValueDictionary(data, writer, TLV::AnonymousTag()); + if (errorCode != CHIP_NO_ERROR) { + LogStringAndReturnError(@"Unable to encode data-value to TLV", errorCode, error); + return System::PacketBufferHandle(); + } + + errorCode = writer.Finalize(&buffer); + if (errorCode != CHIP_NO_ERROR) { + LogStringAndReturnError(@"Unable to encode data-value to TLV", errorCode, error); + return System::PacketBufferHandle(); + } + + return buffer; +} @end @implementation MTRBaseDevice (Deprecated) diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h index c0c709fce7e7dc..4853d60be88471 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h +++ b/src/darwin/Framework/CHIP/MTRBaseDevice_Internal.h @@ -26,6 +26,7 @@ #include #include #include +#include @class MTRDeviceController; @@ -83,6 +84,19 @@ static inline MTRTransportType MTRMakeTransportType(chip::Transport::Type type) * (e.g. when TLV decoding failed). */ + (NSDictionary *)eventReportForHeader:(const chip::app::EventHeader &)header andData:(id _Nullable)data; + +/** + * Extract a data-value for the given response command from the given response-value + * dictionary, encode it to TLV, and return a System::PacketBufferHandle with + * the encoded data. + * + * Will return a null handle and an error if the given response-value does not represent a + * data command response or is the wrong response command, or if encoding to TLV fails. + */ ++ (chip::System::PacketBufferHandle)_responseDataForCommand:(NSDictionary *)responseValue + clusterID:(chip::ClusterId)clusterID + commandID:(chip::CommandId)commandID + error:(NSError * __autoreleasing *)error; @end @interface MTRClusterPath () diff --git a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt index ec16a56876b224..90fc5ebeda1d70 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCallbackBridge-src.zapt @@ -3,6 +3,7 @@ #import "MTRCallbackBridge.h" #import "MTRStructsObjc.h" #import "MTRCommandPayloadsObjc.h" +#import "MTRCommandPayloads_Internal.h" #include diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt index 4dcdba48065f7c..963f425cee7d08 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc-src.zapt @@ -1,6 +1,13 @@ {{> header excludeZapComment=true}} #import "MTRCommandPayloadsObjc.h" +#import "MTRCommandPayloads_Internal.h" +#import "MTRBaseDevice_Internal.h" +#import "MTRError_Internal.h" +#import "MTRLogging_Internal.h" + +#include +#include NS_ASSUME_NONNULL_BEGIN @@ -58,6 +65,48 @@ NS_ASSUME_NONNULL_BEGIN {{/if}} {{/zcl_command_arguments}} +{{#if (isStrEqual source "server")}} +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @ { NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} +{{/if}} + @end {{/if}} {{/inline}} @@ -70,6 +119,21 @@ NS_ASSUME_NONNULL_BEGIN {{> completeImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) includeRenamedProperties=false}} +{{#if (isStrEqual source "server")}} + +@implementation MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &)decodableStruct +{ + {{#zcl_command_arguments}} + { + {{>decode_value target=(concat "self." (asStructPropertyName label)) source=(concat "decodableStruct." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="return err;" depth=0}} + } + {{/zcl_command_arguments}} + return CHIP_NO_ERROR; +} +@end +{{/if}} {{#if (or (not (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))) (not (isStrEqual (asUpperCamelCase name preserveAcronyms=true) (compatCommandNameRemapping parent.name name))))}} {{> oldNameImpl cluster=(compatClusterNameRemapping parent.name) diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt index e6778ba0bfb062..e44945b52ec73e 100644 --- a/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloadsObjc.zapt @@ -68,6 +68,21 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs {{availability "" api="Timed Invoke for server to client commands" deprecationMessage="Timed invoke does not make sense for server to client commands"}}; {{/if}} +{{#if (isStrEqual source "server")}} + +/** + * Initialize an MTR{{cluster}}Cluster{{command}}Params with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +{{/if}} @end {{/if}} {{/inline}} diff --git a/src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Internal.zapt b/src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Internal.zapt new file mode 100644 index 00000000000000..84fb84e238c07f --- /dev/null +++ b/src/darwin/Framework/CHIP/templates/MTRCommandPayloads_Internal.zapt @@ -0,0 +1,26 @@ +{{> header excludeZapComment=true}} + +#import + +#include + +NS_ASSUME_NONNULL_BEGIN + +{{#zcl_clusters}} +{{#zcl_commands}} +{{! We only need to generate conversion functions for the server-generated commands }} +{{#if (isStrEqual source "server")}} +{{#if (isSupported (asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true) isForCommandPayload=true)}} + +@interface MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::DecodableType &)decodableStruct; + +@end + +{{/if}} +{{/if}} +{{/zcl_commands}} +{{/zcl_clusters}} + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt b/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt index 06fc884dbf0a9a..8c4b60ca54a576 100644 --- a/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/MTRCallbackBridge.zapt @@ -78,11 +78,11 @@ void MTR{{> @partial-block}}Bridge::OnSuccessFn(void * context DispatchSuccess(context, nil); {{else if (isStrEqual partial-type "Command")}} auto * response = [MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase name preserveAcronyms=true}}Params new]; - {{#zcl_command_arguments}} - { - {{>decode_value target=(concat "response." (asStructPropertyName label)) source=(concat "data." (asLowerCamelCase label)) cluster=parent.parent.name errorCode="OnFailureFn(context, err); return;" depth=0}} + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } - {{/zcl_command_arguments}} DispatchSuccess(context, response); {{else if (isStrEqual partial-type "CommandStatus")}} DispatchSuccess(context, nil); diff --git a/src/darwin/Framework/CHIP/templates/templates.json b/src/darwin/Framework/CHIP/templates/templates.json index 6561d17ee5c715..0a75f7adeb94d5 100644 --- a/src/darwin/Framework/CHIP/templates/templates.json +++ b/src/darwin/Framework/CHIP/templates/templates.json @@ -113,6 +113,11 @@ "name": "Objc reflections of MTR command payloads header", "output": "src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm" }, + { + "path": "MTRCommandPayloads_Internal.zapt", + "name": "Internal methods for objc reflections of MTR command payloads header", + "output": "src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h" + }, { "path": "MTRAttributeTLVValueDecoder-src.zapt", "name": "Decode TLV attribute values into Objc objects", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 9aff878f5f3e39..ed52da96896ab1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -17,6 +17,7 @@ #import "MTRCallbackBridge.h" #import "MTRCommandPayloadsObjc.h" +#import "MTRCommandPayloads_Internal.h" #import "MTRStructsObjc.h" #include @@ -12848,11 +12849,10 @@ void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { auto * response = [MTRGroupsClusterAddGroupResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -12861,16 +12861,10 @@ void * context, const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType & data) { auto * response = [MTRGroupsClusterViewGroupResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.groupName = [[NSString alloc] initWithBytes:data.groupName.data() - length:data.groupName.size() - encoding:NSUTF8StringEncoding]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -12879,30 +12873,10 @@ void * context, const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType & data) { auto * response = [MTRGroupsClusterGetGroupMembershipResponseParams new]; - { - if (data.capacity.IsNull()) { - response.capacity = nil; - } else { - response.capacity = [NSNumber numberWithUnsignedChar:data.capacity.Value()]; - } - } - { - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.groupList.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.groupList = array_0; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -12911,11 +12885,10 @@ void * context, const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType & data) { auto * response = [MTRGroupsClusterRemoveGroupResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -12924,14 +12897,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterAddSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -12940,90 +12909,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterViewSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; - } - { - if (data.transitionTime.HasValue()) { - response.transitionTime = [NSNumber numberWithUnsignedShort:data.transitionTime.Value()]; - } else { - response.transitionTime = nil; - } - } - { - if (data.sceneName.HasValue()) { - response.sceneName = [[NSString alloc] initWithBytes:data.sceneName.Value().data() - length:data.sceneName.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.sceneName = nil; - } - } - { - if (data.extensionFieldSets.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.extensionFieldSets.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRScenesClusterExtensionFieldSet * newElement_1; - newElement_1 = [MTRScenesClusterExtensionFieldSet new]; - newElement_1.clusterID = [NSNumber numberWithUnsignedInt:entry_1.clusterID]; - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_1.attributeValueList.begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTRScenesClusterAttributeValuePair * newElement_3; - newElement_3 = [MTRScenesClusterAttributeValuePair new]; - if (entry_3.attributeID.HasValue()) { - newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID.Value()]; - } else { - newElement_3.attributeID = nil; - } - { // Scope for our temporary variables - auto * array_5 = [NSMutableArray new]; - auto iter_5 = entry_3.attributeValue.begin(); - while (iter_5.Next()) { - auto & entry_5 = iter_5.GetValue(); - NSNumber * newElement_5; - newElement_5 = [NSNumber numberWithUnsignedChar:entry_5]; - [array_5 addObject:newElement_5]; - } - CHIP_ERROR err = iter_5.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_3.attributeValue = array_5; - } - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_1.attributeValueList = array_3; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.extensionFieldSets = array_1; - } - } else { - response.extensionFieldSets = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13032,14 +12921,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterRemoveSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13048,11 +12933,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType & data) { auto * response = [MTRScenesClusterRemoveAllScenesResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13061,14 +12945,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterStoreSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13077,40 +12957,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType & data) { auto * response = [MTRScenesClusterGetSceneMembershipResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - if (data.capacity.IsNull()) { - response.capacity = nil; - } else { - response.capacity = [NSNumber numberWithUnsignedChar:data.capacity.Value()]; - } - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - if (data.sceneList.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.sceneList.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.sceneList = array_1; - } - } else { - response.sceneList = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13119,14 +12969,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterEnhancedAddSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13135,90 +12981,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterEnhancedViewSceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupID = [NSNumber numberWithUnsignedShort:data.groupID]; - } - { - response.sceneID = [NSNumber numberWithUnsignedChar:data.sceneID]; - } - { - if (data.transitionTime.HasValue()) { - response.transitionTime = [NSNumber numberWithUnsignedShort:data.transitionTime.Value()]; - } else { - response.transitionTime = nil; - } - } - { - if (data.sceneName.HasValue()) { - response.sceneName = [[NSString alloc] initWithBytes:data.sceneName.Value().data() - length:data.sceneName.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.sceneName = nil; - } - } - { - if (data.extensionFieldSets.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.extensionFieldSets.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRScenesClusterExtensionFieldSet * newElement_1; - newElement_1 = [MTRScenesClusterExtensionFieldSet new]; - newElement_1.clusterID = [NSNumber numberWithUnsignedInt:entry_1.clusterID]; - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_1.attributeValueList.begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTRScenesClusterAttributeValuePair * newElement_3; - newElement_3 = [MTRScenesClusterAttributeValuePair new]; - if (entry_3.attributeID.HasValue()) { - newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID.Value()]; - } else { - newElement_3.attributeID = nil; - } - { // Scope for our temporary variables - auto * array_5 = [NSMutableArray new]; - auto iter_5 = entry_3.attributeValue.begin(); - while (iter_5.Next()) { - auto & entry_5 = iter_5.GetValue(); - NSNumber * newElement_5; - newElement_5 = [NSNumber numberWithUnsignedChar:entry_5]; - [array_5 addObject:newElement_5]; - } - CHIP_ERROR err = iter_5.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_3.attributeValue = array_5; - } - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_1.attributeValueList = array_3; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.extensionFieldSets = array_1; - } - } else { - response.extensionFieldSets = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13227,14 +12993,10 @@ void * context, const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType & data) { auto * response = [MTRScenesClusterCopySceneResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:data.status]; - } - { - response.groupIdentifierFrom = [NSNumber numberWithUnsignedShort:data.groupIdentifierFrom]; - } - { - response.sceneIdentifierFrom = [NSNumber numberWithUnsignedChar:data.sceneIdentifierFrom]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13243,62 +13005,10 @@ void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType & data) { auto * response = [MTROTASoftwareUpdateProviderClusterQueryImageResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.delayedActionTime.HasValue()) { - response.delayedActionTime = [NSNumber numberWithUnsignedInt:data.delayedActionTime.Value()]; - } else { - response.delayedActionTime = nil; - } - } - { - if (data.imageURI.HasValue()) { - response.imageURI = [[NSString alloc] initWithBytes:data.imageURI.Value().data() - length:data.imageURI.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.imageURI = nil; - } - } - { - if (data.softwareVersion.HasValue()) { - response.softwareVersion = [NSNumber numberWithUnsignedInt:data.softwareVersion.Value()]; - } else { - response.softwareVersion = nil; - } - } - { - if (data.softwareVersionString.HasValue()) { - response.softwareVersionString = [[NSString alloc] initWithBytes:data.softwareVersionString.Value().data() - length:data.softwareVersionString.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.softwareVersionString = nil; - } - } - { - if (data.updateToken.HasValue()) { - response.updateToken = [NSData dataWithBytes:data.updateToken.Value().data() length:data.updateToken.Value().size()]; - } else { - response.updateToken = nil; - } - } - { - if (data.userConsentNeeded.HasValue()) { - response.userConsentNeeded = [NSNumber numberWithBool:data.userConsentNeeded.Value()]; - } else { - response.userConsentNeeded = nil; - } - } - { - if (data.metadataForRequestor.HasValue()) { - response.metadataForRequestor = [NSData dataWithBytes:data.metadataForRequestor.Value().data() - length:data.metadataForRequestor.Value().size()]; - } else { - response.metadataForRequestor = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13307,11 +13017,10 @@ void * context, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType & data) { auto * response = [MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams new]; - { - response.action = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.action)]; - } - { - response.delayedActionTime = [NSNumber numberWithUnsignedInt:data.delayedActionTime]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13320,13 +13029,10 @@ void * context, const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType & data) { auto * response = [MTRGeneralCommissioningClusterArmFailSafeResponseParams new]; - { - response.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.errorCode)]; - } - { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.data() - length:data.debugText.size() - encoding:NSUTF8StringEncoding]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13335,13 +13041,10 @@ void * context, const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType & data) { auto * response = [MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams new]; - { - response.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.errorCode)]; - } - { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.data() - length:data.debugText.size() - encoding:NSUTF8StringEncoding]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13350,13 +13053,10 @@ void * context, const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType & data) { auto * response = [MTRGeneralCommissioningClusterCommissioningCompleteResponseParams new]; - { - response.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.errorCode)]; - } - { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.data() - length:data.debugText.size() - encoding:NSUTF8StringEncoding]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13365,78 +13065,10 @@ void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType & data) { auto * response = [MTRNetworkCommissioningClusterScanNetworksResponseParams new]; - { - response.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.networkingStatus)]; - } - { - if (data.debugText.HasValue()) { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() - length:data.debugText.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.debugText = nil; - } - } - { - if (data.wiFiScanResults.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.wiFiScanResults.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRNetworkCommissioningClusterWiFiInterfaceScanResult * newElement_1; - newElement_1 = [MTRNetworkCommissioningClusterWiFiInterfaceScanResult new]; - newElement_1.security = [NSNumber numberWithUnsignedChar:entry_1.security.Raw()]; - newElement_1.ssid = [NSData dataWithBytes:entry_1.ssid.data() length:entry_1.ssid.size()]; - newElement_1.bssid = [NSData dataWithBytes:entry_1.bssid.data() length:entry_1.bssid.size()]; - newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; - newElement_1.wiFiBand = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.wiFiBand)]; - newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.wiFiScanResults = array_1; - } - } else { - response.wiFiScanResults = nil; - } - } - { - if (data.threadScanResults.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.threadScanResults.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRNetworkCommissioningClusterThreadInterfaceScanResult * newElement_1; - newElement_1 = [MTRNetworkCommissioningClusterThreadInterfaceScanResult new]; - newElement_1.panId = [NSNumber numberWithUnsignedShort:entry_1.panId]; - newElement_1.extendedPanId = [NSNumber numberWithUnsignedLongLong:entry_1.extendedPanId]; - newElement_1.networkName = [[NSString alloc] initWithBytes:entry_1.networkName.data() - length:entry_1.networkName.size() - encoding:NSUTF8StringEncoding]; - newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; - newElement_1.version = [NSNumber numberWithUnsignedChar:entry_1.version]; - newElement_1.extendedAddress = [NSData dataWithBytes:entry_1.extendedAddress.data() - length:entry_1.extendedAddress.size()]; - newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; - newElement_1.lqi = [NSNumber numberWithUnsignedChar:entry_1.lqi]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.threadScanResults = array_1; - } - } else { - response.threadScanResults = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13445,24 +13077,10 @@ void * context, const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType & data) { auto * response = [MTRNetworkCommissioningClusterNetworkConfigResponseParams new]; - { - response.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.networkingStatus)]; - } - { - if (data.debugText.HasValue()) { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() - length:data.debugText.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.debugText = nil; - } - } - { - if (data.networkIndex.HasValue()) { - response.networkIndex = [NSNumber numberWithUnsignedChar:data.networkIndex.Value()]; - } else { - response.networkIndex = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13471,24 +13089,10 @@ void * context, const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType & data) { auto * response = [MTRNetworkCommissioningClusterConnectNetworkResponseParams new]; - { - response.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.networkingStatus)]; - } - { - if (data.debugText.HasValue()) { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() - length:data.debugText.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.debugText = nil; - } - } - { - if (data.errorValue.IsNull()) { - response.errorValue = nil; - } else { - response.errorValue = [NSNumber numberWithInt:data.errorValue.Value()]; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13497,25 +13101,10 @@ void * context, const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType & data) { auto * response = [MTRDiagnosticLogsClusterRetrieveLogsResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - response.logContent = [NSData dataWithBytes:data.logContent.data() length:data.logContent.size()]; - } - { - if (data.UTCTimeStamp.HasValue()) { - response.utcTimeStamp = [NSNumber numberWithUnsignedLongLong:data.UTCTimeStamp.Value()]; - } else { - response.utcTimeStamp = nil; - } - } - { - if (data.timeSinceBoot.HasValue()) { - response.timeSinceBoot = [NSNumber numberWithUnsignedLongLong:data.timeSinceBoot.Value()]; - } else { - response.timeSinceBoot = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13524,13 +13113,10 @@ void * context, const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType & data) { auto * response = [MTROperationalCredentialsClusterAttestationResponseParams new]; - { - response.attestationElements = [NSData dataWithBytes:data.attestationElements.data() - length:data.attestationElements.size()]; - } - { - response.attestationSignature = [NSData dataWithBytes:data.attestationSignature.data() - length:data.attestationSignature.size()]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13539,8 +13125,10 @@ void * context, const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType & data) { auto * response = [MTROperationalCredentialsClusterCertificateChainResponseParams new]; - { - response.certificate = [NSData dataWithBytes:data.certificate.data() length:data.certificate.size()]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13549,12 +13137,10 @@ void * context, const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType & data) { auto * response = [MTROperationalCredentialsClusterCSRResponseParams new]; - { - response.nocsrElements = [NSData dataWithBytes:data.NOCSRElements.data() length:data.NOCSRElements.size()]; - } - { - response.attestationSignature = [NSData dataWithBytes:data.attestationSignature.data() - length:data.attestationSignature.size()]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13563,24 +13149,10 @@ void * context, const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType & data) { auto * response = [MTROperationalCredentialsClusterNOCResponseParams new]; - { - response.statusCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.statusCode)]; - } - { - if (data.fabricIndex.HasValue()) { - response.fabricIndex = [NSNumber numberWithUnsignedChar:data.fabricIndex.Value()]; - } else { - response.fabricIndex = nil; - } - } - { - if (data.debugText.HasValue()) { - response.debugText = [[NSString alloc] initWithBytes:data.debugText.Value().data() - length:data.debugText.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.debugText = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13589,44 +13161,10 @@ void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType & data) { auto * response = [MTRGroupKeyManagementClusterKeySetReadResponseParams new]; - { - response.groupKeySet = [MTRGroupKeyManagementClusterGroupKeySetStruct new]; - response.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:data.groupKeySet.groupKeySetID]; - response.groupKeySet.groupKeySecurityPolicy = - [NSNumber numberWithUnsignedChar:chip::to_underlying(data.groupKeySet.groupKeySecurityPolicy)]; - if (data.groupKeySet.epochKey0.IsNull()) { - response.groupKeySet.epochKey0 = nil; - } else { - response.groupKeySet.epochKey0 = [NSData dataWithBytes:data.groupKeySet.epochKey0.Value().data() - length:data.groupKeySet.epochKey0.Value().size()]; - } - if (data.groupKeySet.epochStartTime0.IsNull()) { - response.groupKeySet.epochStartTime0 = nil; - } else { - response.groupKeySet.epochStartTime0 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime0.Value()]; - } - if (data.groupKeySet.epochKey1.IsNull()) { - response.groupKeySet.epochKey1 = nil; - } else { - response.groupKeySet.epochKey1 = [NSData dataWithBytes:data.groupKeySet.epochKey1.Value().data() - length:data.groupKeySet.epochKey1.Value().size()]; - } - if (data.groupKeySet.epochStartTime1.IsNull()) { - response.groupKeySet.epochStartTime1 = nil; - } else { - response.groupKeySet.epochStartTime1 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime1.Value()]; - } - if (data.groupKeySet.epochKey2.IsNull()) { - response.groupKeySet.epochKey2 = nil; - } else { - response.groupKeySet.epochKey2 = [NSData dataWithBytes:data.groupKeySet.epochKey2.Value().data() - length:data.groupKeySet.epochKey2.Value().size()]; - } - if (data.groupKeySet.epochStartTime2.IsNull()) { - response.groupKeySet.epochStartTime2 = nil; - } else { - response.groupKeySet.epochStartTime2 = [NSNumber numberWithUnsignedLongLong:data.groupKeySet.epochStartTime2.Value()]; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13635,23 +13173,10 @@ void * context, const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType & data) { auto * response = [MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams new]; - { - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.groupKeySetIDs.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.groupKeySetIDs = array_0; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13660,49 +13185,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterGetWeekDayScheduleResponseParams new]; - { - response.weekDayIndex = [NSNumber numberWithUnsignedChar:data.weekDayIndex]; - } - { - response.userIndex = [NSNumber numberWithUnsignedShort:data.userIndex]; - } - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.daysMask.HasValue()) { - response.daysMask = [NSNumber numberWithUnsignedChar:data.daysMask.Value().Raw()]; - } else { - response.daysMask = nil; - } - } - { - if (data.startHour.HasValue()) { - response.startHour = [NSNumber numberWithUnsignedChar:data.startHour.Value()]; - } else { - response.startHour = nil; - } - } - { - if (data.startMinute.HasValue()) { - response.startMinute = [NSNumber numberWithUnsignedChar:data.startMinute.Value()]; - } else { - response.startMinute = nil; - } - } - { - if (data.endHour.HasValue()) { - response.endHour = [NSNumber numberWithUnsignedChar:data.endHour.Value()]; - } else { - response.endHour = nil; - } - } - { - if (data.endMinute.HasValue()) { - response.endMinute = [NSNumber numberWithUnsignedChar:data.endMinute.Value()]; - } else { - response.endMinute = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13711,28 +13197,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterGetYearDayScheduleResponseParams new]; - { - response.yearDayIndex = [NSNumber numberWithUnsignedChar:data.yearDayIndex]; - } - { - response.userIndex = [NSNumber numberWithUnsignedShort:data.userIndex]; - } - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.localStartTime.HasValue()) { - response.localStartTime = [NSNumber numberWithUnsignedInt:data.localStartTime.Value()]; - } else { - response.localStartTime = nil; - } - } - { - if (data.localEndTime.HasValue()) { - response.localEndTime = [NSNumber numberWithUnsignedInt:data.localEndTime.Value()]; - } else { - response.localEndTime = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13741,32 +13209,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterGetHolidayScheduleResponseParams new]; - { - response.holidayIndex = [NSNumber numberWithUnsignedChar:data.holidayIndex]; - } - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.localStartTime.HasValue()) { - response.localStartTime = [NSNumber numberWithUnsignedInt:data.localStartTime.Value()]; - } else { - response.localStartTime = nil; - } - } - { - if (data.localEndTime.HasValue()) { - response.localEndTime = [NSNumber numberWithUnsignedInt:data.localEndTime.Value()]; - } else { - response.localEndTime = nil; - } - } - { - if (data.operatingMode.HasValue()) { - response.operatingMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.operatingMode.Value())]; - } else { - response.operatingMode = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13775,90 +13221,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterGetUserResponseParams new]; - { - response.userIndex = [NSNumber numberWithUnsignedShort:data.userIndex]; - } - { - if (data.userName.IsNull()) { - response.userName = nil; - } else { - response.userName = [[NSString alloc] initWithBytes:data.userName.Value().data() - length:data.userName.Value().size() - encoding:NSUTF8StringEncoding]; - } - } - { - if (data.userUniqueID.IsNull()) { - response.userUniqueID = nil; - } else { - response.userUniqueID = [NSNumber numberWithUnsignedInt:data.userUniqueID.Value()]; - } - } - { - if (data.userStatus.IsNull()) { - response.userStatus = nil; - } else { - response.userStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.userStatus.Value())]; - } - } - { - if (data.userType.IsNull()) { - response.userType = nil; - } else { - response.userType = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.userType.Value())]; - } - } - { - if (data.credentialRule.IsNull()) { - response.credentialRule = nil; - } else { - response.credentialRule = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.credentialRule.Value())]; - } - } - { - if (data.credentials.IsNull()) { - response.credentials = nil; - } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.credentials.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRDoorLockClusterCredentialStruct * newElement_1; - newElement_1 = [MTRDoorLockClusterCredentialStruct new]; - newElement_1.credentialType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.credentialType)]; - newElement_1.credentialIndex = [NSNumber numberWithUnsignedShort:entry_1.credentialIndex]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.credentials = array_1; - } - } - } - { - if (data.creatorFabricIndex.IsNull()) { - response.creatorFabricIndex = nil; - } else { - response.creatorFabricIndex = [NSNumber numberWithUnsignedChar:data.creatorFabricIndex.Value()]; - } - } - { - if (data.lastModifiedFabricIndex.IsNull()) { - response.lastModifiedFabricIndex = nil; - } else { - response.lastModifiedFabricIndex = [NSNumber numberWithUnsignedChar:data.lastModifiedFabricIndex.Value()]; - } - } - { - if (data.nextUserIndex.IsNull()) { - response.nextUserIndex = nil; - } else { - response.nextUserIndex = [NSNumber numberWithUnsignedShort:data.nextUserIndex.Value()]; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13867,22 +13233,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterSetCredentialResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.userIndex.IsNull()) { - response.userIndex = nil; - } else { - response.userIndex = [NSNumber numberWithUnsignedShort:data.userIndex.Value()]; - } - } - { - if (data.nextCredentialIndex.IsNull()) { - response.nextCredentialIndex = nil; - } else { - response.nextCredentialIndex = [NSNumber numberWithUnsignedShort:data.nextCredentialIndex.Value()]; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13891,36 +13245,10 @@ void * context, const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType & data) { auto * response = [MTRDoorLockClusterGetCredentialStatusResponseParams new]; - { - response.credentialExists = [NSNumber numberWithBool:data.credentialExists]; - } - { - if (data.userIndex.IsNull()) { - response.userIndex = nil; - } else { - response.userIndex = [NSNumber numberWithUnsignedShort:data.userIndex.Value()]; - } - } - { - if (data.creatorFabricIndex.IsNull()) { - response.creatorFabricIndex = nil; - } else { - response.creatorFabricIndex = [NSNumber numberWithUnsignedChar:data.creatorFabricIndex.Value()]; - } - } - { - if (data.lastModifiedFabricIndex.IsNull()) { - response.lastModifiedFabricIndex = nil; - } else { - response.lastModifiedFabricIndex = [NSNumber numberWithUnsignedChar:data.lastModifiedFabricIndex.Value()]; - } - } - { - if (data.nextCredentialIndex.IsNull()) { - response.nextCredentialIndex = nil; - } else { - response.nextCredentialIndex = [NSNumber numberWithUnsignedShort:data.nextCredentialIndex.Value()]; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13929,43 +13257,10 @@ void * context, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & data) { auto * response = [MTRThermostatClusterGetWeeklyScheduleResponseParams new]; - { - response.numberOfTransitionsForSequence = [NSNumber numberWithUnsignedChar:data.numberOfTransitionsForSequence]; - } - { - response.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:data.dayOfWeekForSequence.Raw()]; - } - { - response.modeForSequence = [NSNumber numberWithUnsignedChar:data.modeForSequence.Raw()]; - } - { - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.transitions.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRThermostatClusterThermostatScheduleTransition * newElement_0; - newElement_0 = [MTRThermostatClusterThermostatScheduleTransition new]; - newElement_0.transitionTime = [NSNumber numberWithUnsignedShort:entry_0.transitionTime]; - if (entry_0.heatSetpoint.IsNull()) { - newElement_0.heatSetpoint = nil; - } else { - newElement_0.heatSetpoint = [NSNumber numberWithShort:entry_0.heatSetpoint.Value()]; - } - if (entry_0.coolSetpoint.IsNull()) { - newElement_0.coolSetpoint = nil; - } else { - newElement_0.coolSetpoint = [NSNumber numberWithShort:entry_0.coolSetpoint.Value()]; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.transitions = array_0; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13974,17 +13269,10 @@ void * context, const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType & data) { auto * response = [MTRChannelClusterChangeChannelResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.data.HasValue()) { - response.data = [[NSString alloc] initWithBytes:data.data.Value().data() - length:data.data.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.data = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -13993,17 +13281,10 @@ void * context, const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType & data) { auto * response = [MTRTargetNavigatorClusterNavigateTargetResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.data.HasValue()) { - response.data = [[NSString alloc] initWithBytes:data.data.Value().data() - length:data.data.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.data = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14012,17 +13293,10 @@ void * context, const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType & data) { auto * response = [MTRMediaPlaybackClusterPlaybackResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.data.HasValue()) { - response.data = [[NSString alloc] initWithBytes:data.data.Value().data() - length:data.data.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.data = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14031,8 +13305,10 @@ void * context, const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType & data) { auto * response = [MTRKeypadInputClusterSendKeyResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14041,17 +13317,10 @@ void * context, const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType & data) { auto * response = [MTRContentLauncherClusterLauncherResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.data.HasValue()) { - response.data = [[NSString alloc] initWithBytes:data.data.Value().data() - length:data.data.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.data = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14060,15 +13329,10 @@ void * context, const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType & data) { auto * response = [MTRApplicationLauncherClusterLauncherResponseParams new]; - { - response.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.status)]; - } - { - if (data.data.HasValue()) { - response.data = [NSData dataWithBytes:data.data.Value().data() length:data.data.Value().size()]; - } else { - response.data = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14077,10 +13341,10 @@ void * context, const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType & data) { auto * response = [MTRAccountLoginClusterGetSetupPINResponseParams new]; - { - response.setupPIN = [[NSString alloc] initWithBytes:data.setupPIN.data() - length:data.setupPIN.size() - encoding:NSUTF8StringEncoding]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14089,8 +13353,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestSpecificResponseParams new]; - { - response.returnValue = [NSNumber numberWithUnsignedChar:data.returnValue]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14099,8 +13365,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestAddArgumentsResponseParams new]; - { - response.returnValue = [NSNumber numberWithUnsignedChar:data.returnValue]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14109,8 +13377,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestSimpleArgumentResponseParams new]; - { - response.returnValue = [NSNumber numberWithBool:data.returnValue]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14119,200 +13389,22 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestStructArrayArgumentResponseParams new]; - { { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.arg1.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUnitTestingClusterNestedStructList * newElement_0; - newElement_0 = [MTRUnitTestingClusterNestedStructList new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [MTRUnitTestingClusterSimpleStruct new]; - newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; - newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; - newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; - newElement_0.c.d = [NSData dataWithBytes:entry_0.c.d.data() length:entry_0.c.d.size()]; - newElement_0.c.e = [[NSString alloc] initWithBytes:entry_0.c.e.data() - length:entry_0.c.e.size() - encoding:NSUTF8StringEncoding]; - newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; - newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; - newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.d.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRUnitTestingClusterSimpleStruct * newElement_2; - newElement_2 = [MTRUnitTestingClusterSimpleStruct new]; - newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; - newElement_2.b = [NSNumber numberWithBool:entry_2.b]; - newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; - newElement_2.d = [NSData dataWithBytes:entry_2.d.data() length:entry_2.d.size()]; - newElement_2.e = [[NSString alloc] initWithBytes:entry_2.e.data() - length:entry_2.e.size() - encoding:NSUTF8StringEncoding]; - newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; - newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; - newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_0.d = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.e.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_0.e = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.f.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = [NSData dataWithBytes:entry_2.data() length:entry_2.size()]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_0.f = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.g.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - newElement_0.g = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; if (err != CHIP_NO_ERROR) { OnFailureFn(context, err); return; } - response.arg1 = array_0; -} -} -{ { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; -auto iter_0 = data.arg2.begin(); -while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUnitTestingClusterSimpleStruct * newElement_0; - newElement_0 = [MTRUnitTestingClusterSimpleStruct new]; - newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; - newElement_0.b = [NSNumber numberWithBool:entry_0.b]; - newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; - newElement_0.d = [NSData dataWithBytes:entry_0.d.data() length:entry_0.d.size()]; - newElement_0.e = [[NSString alloc] initWithBytes:entry_0.e.data() length:entry_0.e.size() encoding:NSUTF8StringEncoding]; - newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; - newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; - newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; - [array_0 addObject:newElement_0]; -} -CHIP_ERROR err = iter_0.GetStatus(); -if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; -} -response.arg2 = array_0; -} -} -{ { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; -auto iter_0 = data.arg3.begin(); -while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; -} -CHIP_ERROR err = iter_0.GetStatus(); -if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; -} -response.arg3 = array_0; -} -} -{ { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; -auto iter_0 = data.arg4.begin(); -while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithBool:entry_0]; - [array_0 addObject:newElement_0]; -} -CHIP_ERROR err = iter_0.GetStatus(); -if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; -} -response.arg4 = array_0; -} -} -{ - response.arg5 = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.arg5)]; -} -{ - response.arg6 = [NSNumber numberWithBool:data.arg6]; -} -DispatchSuccess(context, response); -} -; + DispatchSuccess(context, response); +}; void MTRUnitTestingClusterTestListInt8UReverseResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestListInt8UReverseResponseParams new]; - { - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = data.arg1.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.arg1 = array_0; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14321,11 +13413,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestEnumsResponseParams new]; - { - response.arg1 = [NSNumber numberWithUnsignedShort:chip::to_underlying(data.arg1)]; - } - { - response.arg2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.arg2)]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14334,33 +13425,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestNullableOptionalResponseParams new]; - { - response.wasPresent = [NSNumber numberWithBool:data.wasPresent]; - } - { - if (data.wasNull.HasValue()) { - response.wasNull = [NSNumber numberWithBool:data.wasNull.Value()]; - } else { - response.wasNull = nil; - } - } - { - if (data.value.HasValue()) { - response.value = [NSNumber numberWithUnsignedChar:data.value.Value()]; - } else { - response.value = nil; - } - } - { - if (data.originalValue.HasValue()) { - if (data.originalValue.Value().IsNull()) { - response.originalValue = nil; - } else { - response.originalValue = [NSNumber numberWithUnsignedChar:data.originalValue.Value().Value()]; - } - } else { - response.originalValue = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14369,242 +13437,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestComplexNullableOptionalResponseParams new]; - { - response.nullableIntWasNull = [NSNumber numberWithBool:data.nullableIntWasNull]; - } - { - if (data.nullableIntValue.HasValue()) { - response.nullableIntValue = [NSNumber numberWithUnsignedShort:data.nullableIntValue.Value()]; - } else { - response.nullableIntValue = nil; - } - } - { - response.optionalIntWasPresent = [NSNumber numberWithBool:data.optionalIntWasPresent]; - } - { - if (data.optionalIntValue.HasValue()) { - response.optionalIntValue = [NSNumber numberWithUnsignedShort:data.optionalIntValue.Value()]; - } else { - response.optionalIntValue = nil; - } - } - { - response.nullableOptionalIntWasPresent = [NSNumber numberWithBool:data.nullableOptionalIntWasPresent]; - } - { - if (data.nullableOptionalIntWasNull.HasValue()) { - response.nullableOptionalIntWasNull = [NSNumber numberWithBool:data.nullableOptionalIntWasNull.Value()]; - } else { - response.nullableOptionalIntWasNull = nil; - } - } - { - if (data.nullableOptionalIntValue.HasValue()) { - response.nullableOptionalIntValue = [NSNumber numberWithUnsignedShort:data.nullableOptionalIntValue.Value()]; - } else { - response.nullableOptionalIntValue = nil; - } - } - { - response.nullableStringWasNull = [NSNumber numberWithBool:data.nullableStringWasNull]; - } - { - if (data.nullableStringValue.HasValue()) { - response.nullableStringValue = [[NSString alloc] initWithBytes:data.nullableStringValue.Value().data() - length:data.nullableStringValue.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.nullableStringValue = nil; - } - } - { - response.optionalStringWasPresent = [NSNumber numberWithBool:data.optionalStringWasPresent]; - } - { - if (data.optionalStringValue.HasValue()) { - response.optionalStringValue = [[NSString alloc] initWithBytes:data.optionalStringValue.Value().data() - length:data.optionalStringValue.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.optionalStringValue = nil; - } - } - { - response.nullableOptionalStringWasPresent = [NSNumber numberWithBool:data.nullableOptionalStringWasPresent]; - } - { - if (data.nullableOptionalStringWasNull.HasValue()) { - response.nullableOptionalStringWasNull = [NSNumber numberWithBool:data.nullableOptionalStringWasNull.Value()]; - } else { - response.nullableOptionalStringWasNull = nil; - } - } - { - if (data.nullableOptionalStringValue.HasValue()) { - response.nullableOptionalStringValue = [[NSString alloc] initWithBytes:data.nullableOptionalStringValue.Value().data() - length:data.nullableOptionalStringValue.Value().size() - encoding:NSUTF8StringEncoding]; - } else { - response.nullableOptionalStringValue = nil; - } - } - { - response.nullableStructWasNull = [NSNumber numberWithBool:data.nullableStructWasNull]; - } - { - if (data.nullableStructValue.HasValue()) { - response.nullableStructValue = [MTRUnitTestingClusterSimpleStruct new]; - response.nullableStructValue.a = [NSNumber numberWithUnsignedChar:data.nullableStructValue.Value().a]; - response.nullableStructValue.b = [NSNumber numberWithBool:data.nullableStructValue.Value().b]; - response.nullableStructValue.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(data.nullableStructValue.Value().c)]; - response.nullableStructValue.d = [NSData dataWithBytes:data.nullableStructValue.Value().d.data() - length:data.nullableStructValue.Value().d.size()]; - response.nullableStructValue.e = [[NSString alloc] initWithBytes:data.nullableStructValue.Value().e.data() - length:data.nullableStructValue.Value().e.size() - encoding:NSUTF8StringEncoding]; - response.nullableStructValue.f = [NSNumber numberWithUnsignedChar:data.nullableStructValue.Value().f.Raw()]; - response.nullableStructValue.g = [NSNumber numberWithFloat:data.nullableStructValue.Value().g]; - response.nullableStructValue.h = [NSNumber numberWithDouble:data.nullableStructValue.Value().h]; - } else { - response.nullableStructValue = nil; - } - } - { - response.optionalStructWasPresent = [NSNumber numberWithBool:data.optionalStructWasPresent]; - } - { - if (data.optionalStructValue.HasValue()) { - response.optionalStructValue = [MTRUnitTestingClusterSimpleStruct new]; - response.optionalStructValue.a = [NSNumber numberWithUnsignedChar:data.optionalStructValue.Value().a]; - response.optionalStructValue.b = [NSNumber numberWithBool:data.optionalStructValue.Value().b]; - response.optionalStructValue.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(data.optionalStructValue.Value().c)]; - response.optionalStructValue.d = [NSData dataWithBytes:data.optionalStructValue.Value().d.data() - length:data.optionalStructValue.Value().d.size()]; - response.optionalStructValue.e = [[NSString alloc] initWithBytes:data.optionalStructValue.Value().e.data() - length:data.optionalStructValue.Value().e.size() - encoding:NSUTF8StringEncoding]; - response.optionalStructValue.f = [NSNumber numberWithUnsignedChar:data.optionalStructValue.Value().f.Raw()]; - response.optionalStructValue.g = [NSNumber numberWithFloat:data.optionalStructValue.Value().g]; - response.optionalStructValue.h = [NSNumber numberWithDouble:data.optionalStructValue.Value().h]; - } else { - response.optionalStructValue = nil; - } - } - { - response.nullableOptionalStructWasPresent = [NSNumber numberWithBool:data.nullableOptionalStructWasPresent]; - } - { - if (data.nullableOptionalStructWasNull.HasValue()) { - response.nullableOptionalStructWasNull = [NSNumber numberWithBool:data.nullableOptionalStructWasNull.Value()]; - } else { - response.nullableOptionalStructWasNull = nil; - } - } - { - if (data.nullableOptionalStructValue.HasValue()) { - response.nullableOptionalStructValue = [MTRUnitTestingClusterSimpleStruct new]; - response.nullableOptionalStructValue.a = [NSNumber numberWithUnsignedChar:data.nullableOptionalStructValue.Value().a]; - response.nullableOptionalStructValue.b = [NSNumber numberWithBool:data.nullableOptionalStructValue.Value().b]; - response.nullableOptionalStructValue.c = - [NSNumber numberWithUnsignedChar:chip::to_underlying(data.nullableOptionalStructValue.Value().c)]; - response.nullableOptionalStructValue.d = [NSData dataWithBytes:data.nullableOptionalStructValue.Value().d.data() - length:data.nullableOptionalStructValue.Value().d.size()]; - response.nullableOptionalStructValue.e = - [[NSString alloc] initWithBytes:data.nullableOptionalStructValue.Value().e.data() - length:data.nullableOptionalStructValue.Value().e.size() - encoding:NSUTF8StringEncoding]; - response.nullableOptionalStructValue.f = - [NSNumber numberWithUnsignedChar:data.nullableOptionalStructValue.Value().f.Raw()]; - response.nullableOptionalStructValue.g = [NSNumber numberWithFloat:data.nullableOptionalStructValue.Value().g]; - response.nullableOptionalStructValue.h = [NSNumber numberWithDouble:data.nullableOptionalStructValue.Value().h]; - } else { - response.nullableOptionalStructValue = nil; - } - } - { - response.nullableListWasNull = [NSNumber numberWithBool:data.nullableListWasNull]; - } - { - if (data.nullableListValue.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.nullableListValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.nullableListValue = array_1; - } - } else { - response.nullableListValue = nil; - } - } - { - response.optionalListWasPresent = [NSNumber numberWithBool:data.optionalListWasPresent]; - } - { - if (data.optionalListValue.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.optionalListValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.optionalListValue = array_1; - } - } else { - response.optionalListValue = nil; - } - } - { - response.nullableOptionalListWasPresent = [NSNumber numberWithBool:data.nullableOptionalListWasPresent]; - } - { - if (data.nullableOptionalListWasNull.HasValue()) { - response.nullableOptionalListWasNull = [NSNumber numberWithBool:data.nullableOptionalListWasNull.Value()]; - } else { - response.nullableOptionalListWasNull = nil; - } - } - { - if (data.nullableOptionalListValue.HasValue()) { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = data.nullableOptionalListValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSNumber * newElement_1; - newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - OnFailureFn(context, err); - return; - } - response.nullableOptionalListValue = array_1; - } - } else { - response.nullableOptionalListValue = nil; - } + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14613,8 +13449,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterBooleanResponseParams new]; - { - response.value = [NSNumber numberWithBool:data.value]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14623,18 +13461,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterSimpleStructResponseParams new]; - { - response.arg1 = [MTRUnitTestingClusterSimpleStruct new]; - response.arg1.a = [NSNumber numberWithUnsignedChar:data.arg1.a]; - response.arg1.b = [NSNumber numberWithBool:data.arg1.b]; - response.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(data.arg1.c)]; - response.arg1.d = [NSData dataWithBytes:data.arg1.d.data() length:data.arg1.d.size()]; - response.arg1.e = [[NSString alloc] initWithBytes:data.arg1.e.data() - length:data.arg1.e.size() - encoding:NSUTF8StringEncoding]; - response.arg1.f = [NSNumber numberWithUnsignedChar:data.arg1.f.Raw()]; - response.arg1.g = [NSNumber numberWithFloat:data.arg1.g]; - response.arg1.h = [NSNumber numberWithDouble:data.arg1.h]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14643,8 +13473,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestEmitTestEventResponseParams new]; - { - response.value = [NSNumber numberWithUnsignedLongLong:data.value]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; @@ -14653,8 +13485,10 @@ void * context, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & data) { auto * response = [MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams new]; - { - response.value = [NSNumber numberWithUnsignedLongLong:data.value]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; } DispatchSuccess(context, response); }; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index c0fc5850b09365..72c27e3beb05ab 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -143,6 +143,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupsClusterAddGroupResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRGroupsClusterAddGroupResponseParams (Deprecated) @@ -212,6 +225,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupsClusterViewGroupResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRGroupsClusterViewGroupResponseParams (Deprecated) @@ -273,6 +299,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupsClusterGetGroupMembershipResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -334,6 +373,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupsClusterRemoveGroupResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRGroupsClusterRemoveGroupResponseParams (Deprecated) @@ -480,6 +532,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterAddSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterAddSceneResponseParams (Deprecated) @@ -563,6 +628,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterViewSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterViewSceneResponseParams (Deprecated) @@ -640,6 +718,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterRemoveSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterRemoveSceneResponseParams (Deprecated) @@ -710,6 +801,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterRemoveAllScenesResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterRemoveAllScenesResponseParams (Deprecated) @@ -784,6 +888,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterStoreSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterStoreSceneResponseParams (Deprecated) @@ -901,6 +1018,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterGetSceneMembershipResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterGetSceneMembershipResponseParams (Deprecated) @@ -981,6 +1111,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterEnhancedAddSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterEnhancedAddSceneResponseParams (Deprecated) @@ -1064,6 +1207,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterEnhancedViewSceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterEnhancedViewSceneResponseParams (Deprecated) @@ -1153,6 +1309,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRScenesClusterCopySceneResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRScenesClusterCopySceneResponseParams (Deprecated) @@ -2179,6 +2348,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROTASoftwareUpdateProviderClusterQueryImageResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterQueryImageResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -2247,6 +2429,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -2401,6 +2596,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGeneralCommissioningClusterArmFailSafeResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2461,6 +2669,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2514,6 +2735,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGeneralCommissioningClusterCommissioningCompleteResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2575,6 +2809,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRNetworkCommissioningClusterScanNetworksResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2700,6 +2947,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRNetworkCommissioningClusterNetworkConfigResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2759,6 +3019,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRNetworkCommissioningClusterConnectNetworkResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -2857,6 +3130,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDiagnosticLogsClusterRetrieveLogsResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRDiagnosticLogsClusterRetrieveLogsResponseParams (Deprecated) @@ -3203,6 +3489,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROperationalCredentialsClusterAttestationResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTROperationalCredentialsClusterAttestationResponseParams (Deprecated) @@ -3262,6 +3561,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROperationalCredentialsClusterCertificateChainResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -3319,6 +3631,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROperationalCredentialsClusterCSRResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -3416,6 +3741,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTROperationalCredentialsClusterNOCResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -3597,6 +3935,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupKeyManagementClusterKeySetReadResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -3680,6 +4031,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -4250,6 +4614,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterGetWeekDayScheduleResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -4381,6 +4758,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterGetYearDayScheduleResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -4510,6 +4900,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterGetHolidayScheduleResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -4660,6 +5063,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterGetUserResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end @interface MTRDoorLockClusterGetUserResponseParams (Deprecated) @@ -4765,6 +5181,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterSetCredentialResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -4829,6 +5258,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRDoorLockClusterGetCredentialStatusResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -5187,6 +5629,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRThermostatClusterGetWeeklyScheduleResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -6065,6 +6520,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRChannelClusterChangeChannelResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -6185,6 +6653,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRTargetNavigatorClusterNavigateTargetResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -6501,6 +6982,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRMediaPlaybackClusterPlaybackResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -6730,6 +7224,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRKeypadInputClusterSendKeyResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -6825,6 +7332,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRContentLauncherClusterLauncherResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRContentLauncherClusterLauncherResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), @@ -7012,6 +7532,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRApplicationLauncherClusterLauncherResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -7066,6 +7599,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRAccountLoginClusterGetSetupPINResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -7158,6 +7704,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -7221,6 +7780,19 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRElectricalMeasurementClusterGetMeasurementProfileResponseCommandParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @@ -7311,6 +7883,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestSpecificResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestSpecificResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), @@ -7372,6 +7957,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestAddArgumentsResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestAddArgumentsResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7433,6 +8031,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestSimpleArgumentResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestSimpleArgumentResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7504,6 +8115,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestStructArrayArgumentResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestStructArrayArgumentResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7569,6 +8193,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestListInt8UReverseResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestListInt8UReverseResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7634,6 +8271,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestEnumsResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestEnumsResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), @@ -7713,6 +8363,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestNullableOptionalResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestNullableOptionalResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7853,6 +8516,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestComplexNullableOptionalResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestComplexNullableOptionalResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -7918,6 +8594,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterBooleanResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterBooleanResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), @@ -7982,6 +8671,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterSimpleStructResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterSimpleStructResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), @@ -8045,6 +8747,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestEmitTestEventResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestEventResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), @@ -8110,6 +8825,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs MTR_DEPRECATED("Timed invoke does not make sense for server to client commands", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + +/** + * Initialize an MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; @end MTR_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams", ios(16.1, 16.4), macos(13.0, 13.3), diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 2e86fa59c6f6bb..a835915630ae25 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -16,6 +16,13 @@ */ #import "MTRCommandPayloadsObjc.h" +#import "MTRBaseDevice_Internal.h" +#import "MTRCommandPayloads_Internal.h" +#import "MTRError_Internal.h" +#import "MTRLogging_Internal.h" + +#include +#include NS_ASSUME_NONNULL_BEGIN @@ -162,6 +169,61 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupsClusterAddGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRGroupsClusterAddGroupResponseParams (Deprecated) @@ -253,6 +315,66 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupsClusterViewGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.groupName = [[NSString alloc] initWithBytes:decodableStruct.groupName.data() + length:decodableStruct.groupName.size() + encoding:NSUTF8StringEncoding]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRGroupsClusterViewGroupResponseParams (Deprecated) @@ -328,6 +450,79 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupsClusterGetGroupMembershipResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType &)decodableStruct +{ + { + if (decodableStruct.capacity.IsNull()) { + self.capacity = nil; + } else { + self.capacity = [NSNumber numberWithUnsignedChar:decodableStruct.capacity.Value()]; + } + } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.groupList.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.groupList = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRGroupsClusterRemoveGroupParams - (instancetype)init @@ -403,6 +598,61 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupsClusterRemoveGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRGroupsClusterRemoveGroupResponseParams (Deprecated) @@ -592,6 +842,64 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterAddSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterAddSceneResponseParams (Deprecated) @@ -717,6 +1025,137 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterViewSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + { + if (decodableStruct.transitionTime.HasValue()) { + self.transitionTime = [NSNumber numberWithUnsignedShort:decodableStruct.transitionTime.Value()]; + } else { + self.transitionTime = nil; + } + } + { + if (decodableStruct.sceneName.HasValue()) { + self.sceneName = [[NSString alloc] initWithBytes:decodableStruct.sceneName.Value().data() + length:decodableStruct.sceneName.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.sceneName = nil; + } + } + { + if (decodableStruct.extensionFieldSets.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.extensionFieldSets.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRScenesClusterExtensionFieldSet * newElement_1; + newElement_1 = [MTRScenesClusterExtensionFieldSet new]; + newElement_1.clusterID = [NSNumber numberWithUnsignedInt:entry_1.clusterID]; + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_1.attributeValueList.begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRScenesClusterAttributeValuePair * newElement_3; + newElement_3 = [MTRScenesClusterAttributeValuePair new]; + if (entry_3.attributeID.HasValue()) { + newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID.Value()]; + } else { + newElement_3.attributeID = nil; + } + { // Scope for our temporary variables + auto * array_5 = [NSMutableArray new]; + auto iter_5 = entry_3.attributeValue.begin(); + while (iter_5.Next()) { + auto & entry_5 = iter_5.GetValue(); + NSNumber * newElement_5; + newElement_5 = [NSNumber numberWithUnsignedChar:entry_5]; + [array_5 addObject:newElement_5]; + } + CHIP_ERROR err = iter_5.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_3.attributeValue = array_5; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_1.attributeValueList = array_3; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.extensionFieldSets = array_1; + } + } else { + self.extensionFieldSets = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterViewSceneResponseParams (Deprecated) @@ -832,6 +1271,64 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterRemoveSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterRemoveSceneResponseParams (Deprecated) @@ -930,6 +1427,61 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterRemoveAllScenesResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterRemoveAllScenesResponseParams (Deprecated) @@ -1035,6 +1587,64 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterStoreSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterStoreSceneResponseParams (Deprecated) @@ -1199,6 +1809,89 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterGetSceneMembershipResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + if (decodableStruct.capacity.IsNull()) { + self.capacity = nil; + } else { + self.capacity = [NSNumber numberWithUnsignedChar:decodableStruct.capacity.Value()]; + } + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + if (decodableStruct.sceneList.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.sceneList.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:entry_1]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.sceneList = array_1; + } + } else { + self.sceneList = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterGetSceneMembershipResponseParams (Deprecated) @@ -1314,6 +2007,64 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterEnhancedAddSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterEnhancedAddSceneResponseParams (Deprecated) @@ -1439,6 +2190,137 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterEnhancedViewSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupID = [NSNumber numberWithUnsignedShort:decodableStruct.groupID]; + } + { + self.sceneID = [NSNumber numberWithUnsignedChar:decodableStruct.sceneID]; + } + { + if (decodableStruct.transitionTime.HasValue()) { + self.transitionTime = [NSNumber numberWithUnsignedShort:decodableStruct.transitionTime.Value()]; + } else { + self.transitionTime = nil; + } + } + { + if (decodableStruct.sceneName.HasValue()) { + self.sceneName = [[NSString alloc] initWithBytes:decodableStruct.sceneName.Value().data() + length:decodableStruct.sceneName.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.sceneName = nil; + } + } + { + if (decodableStruct.extensionFieldSets.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.extensionFieldSets.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRScenesClusterExtensionFieldSet * newElement_1; + newElement_1 = [MTRScenesClusterExtensionFieldSet new]; + newElement_1.clusterID = [NSNumber numberWithUnsignedInt:entry_1.clusterID]; + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_1.attributeValueList.begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRScenesClusterAttributeValuePair * newElement_3; + newElement_3 = [MTRScenesClusterAttributeValuePair new]; + if (entry_3.attributeID.HasValue()) { + newElement_3.attributeID = [NSNumber numberWithUnsignedInt:entry_3.attributeID.Value()]; + } else { + newElement_3.attributeID = nil; + } + { // Scope for our temporary variables + auto * array_5 = [NSMutableArray new]; + auto iter_5 = entry_3.attributeValue.begin(); + while (iter_5.Next()) { + auto & entry_5 = iter_5.GetValue(); + NSNumber * newElement_5; + newElement_5 = [NSNumber numberWithUnsignedChar:entry_5]; + [array_5 addObject:newElement_5]; + } + CHIP_ERROR err = iter_5.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_3.attributeValue = array_5; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_1.attributeValueList = array_3; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.extensionFieldSets = array_1; + } + } else { + self.extensionFieldSets = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterEnhancedViewSceneResponseParams (Deprecated) @@ -1585,6 +2467,64 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRScenesClusterCopySceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.groupIdentifierFrom = [NSNumber numberWithUnsignedShort:decodableStruct.groupIdentifierFrom]; + } + { + self.sceneIdentifierFrom = [NSNumber numberWithUnsignedChar:decodableStruct.sceneIdentifierFrom]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRScenesClusterCopySceneResponseParams (Deprecated) @@ -2733,6 +3673,113 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROTASoftwareUpdateProviderClusterQueryImageResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.delayedActionTime.HasValue()) { + self.delayedActionTime = [NSNumber numberWithUnsignedInt:decodableStruct.delayedActionTime.Value()]; + } else { + self.delayedActionTime = nil; + } + } + { + if (decodableStruct.imageURI.HasValue()) { + self.imageURI = [[NSString alloc] initWithBytes:decodableStruct.imageURI.Value().data() + length:decodableStruct.imageURI.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.imageURI = nil; + } + } + { + if (decodableStruct.softwareVersion.HasValue()) { + self.softwareVersion = [NSNumber numberWithUnsignedInt:decodableStruct.softwareVersion.Value()]; + } else { + self.softwareVersion = nil; + } + } + { + if (decodableStruct.softwareVersionString.HasValue()) { + self.softwareVersionString = [[NSString alloc] initWithBytes:decodableStruct.softwareVersionString.Value().data() + length:decodableStruct.softwareVersionString.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.softwareVersionString = nil; + } + } + { + if (decodableStruct.updateToken.HasValue()) { + self.updateToken = [NSData dataWithBytes:decodableStruct.updateToken.Value().data() + length:decodableStruct.updateToken.Value().size()]; + } else { + self.updateToken = nil; + } + } + { + if (decodableStruct.userConsentNeeded.HasValue()) { + self.userConsentNeeded = [NSNumber numberWithBool:decodableStruct.userConsentNeeded.Value()]; + } else { + self.userConsentNeeded = nil; + } + } + { + if (decodableStruct.metadataForRequestor.HasValue()) { + self.metadataForRequestor = [NSData dataWithBytes:decodableStruct.metadataForRequestor.Value().data() + length:decodableStruct.metadataForRequestor.Value().size()]; + } else { + self.metadataForRequestor = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTROtaSoftwareUpdateProviderClusterQueryImageResponseParams @@ -2806,6 +3853,61 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType &)decodableStruct +{ + { + self.action = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.action)]; + } + { + self.delayedActionTime = [NSNumber numberWithUnsignedInt:decodableStruct.delayedActionTime]; + } + return CHIP_NO_ERROR; +} @end @implementation MTROtaSoftwareUpdateProviderClusterApplyUpdateResponseParams @@ -2984,15 +4086,72 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRGeneralCommissioningClusterSetRegulatoryConfigParams -- (instancetype)init +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error { - if (self = [super init]) { + if (!(self = [super init])) { + return nil; + } - _newRegulatoryConfig = @(0); + using DecodableType = chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } - _countryCode = @""; + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGeneralCommissioningClusterArmFailSafeResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType &)decodableStruct +{ + { + self.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.errorCode)]; + } + { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.data() + length:decodableStruct.debugText.size() + encoding:NSUTF8StringEncoding]; + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRGeneralCommissioningClusterSetRegulatoryConfigParams +- (instancetype)init +{ + if (self = [super init]) { + + _newRegulatoryConfig = @(0); + + _countryCode = @""; _breadcrumb = @(0); _timedInvokeTimeoutMs = nil; @@ -3053,6 +4212,63 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &)decodableStruct +{ + { + self.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.errorCode)]; + } + { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.data() + length:decodableStruct.debugText.size() + encoding:NSUTF8StringEncoding]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRGeneralCommissioningClusterCommissioningCompleteParams - (instancetype)init @@ -3112,6 +4328,63 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGeneralCommissioningClusterCommissioningCompleteResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &)decodableStruct +{ + { + self.errorCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.errorCode)]; + } + { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.data() + length:decodableStruct.debugText.size() + encoding:NSUTF8StringEncoding]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRNetworkCommissioningClusterScanNetworksParams - (instancetype)init @@ -3185,6 +4458,126 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRNetworkCommissioningClusterScanNetworksResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType &)decodableStruct +{ + { + self.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.networkingStatus)]; + } + { + if (decodableStruct.debugText.HasValue()) { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.Value().data() + length:decodableStruct.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.debugText = nil; + } + } + { + if (decodableStruct.wiFiScanResults.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.wiFiScanResults.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRNetworkCommissioningClusterWiFiInterfaceScanResult * newElement_1; + newElement_1 = [MTRNetworkCommissioningClusterWiFiInterfaceScanResult new]; + newElement_1.security = [NSNumber numberWithUnsignedChar:entry_1.security.Raw()]; + newElement_1.ssid = [NSData dataWithBytes:entry_1.ssid.data() length:entry_1.ssid.size()]; + newElement_1.bssid = [NSData dataWithBytes:entry_1.bssid.data() length:entry_1.bssid.size()]; + newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; + newElement_1.wiFiBand = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.wiFiBand)]; + newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.wiFiScanResults = array_1; + } + } else { + self.wiFiScanResults = nil; + } + } + { + if (decodableStruct.threadScanResults.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.threadScanResults.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRNetworkCommissioningClusterThreadInterfaceScanResult * newElement_1; + newElement_1 = [MTRNetworkCommissioningClusterThreadInterfaceScanResult new]; + newElement_1.panId = [NSNumber numberWithUnsignedShort:entry_1.panId]; + newElement_1.extendedPanId = [NSNumber numberWithUnsignedLongLong:entry_1.extendedPanId]; + newElement_1.networkName = [[NSString alloc] initWithBytes:entry_1.networkName.data() + length:entry_1.networkName.size() + encoding:NSUTF8StringEncoding]; + newElement_1.channel = [NSNumber numberWithUnsignedShort:entry_1.channel]; + newElement_1.version = [NSNumber numberWithUnsignedChar:entry_1.version]; + newElement_1.extendedAddress = [NSData dataWithBytes:entry_1.extendedAddress.data() + length:entry_1.extendedAddress.size()]; + newElement_1.rssi = [NSNumber numberWithChar:entry_1.rssi]; + newElement_1.lqi = [NSNumber numberWithUnsignedChar:entry_1.lqi]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.threadScanResults = array_1; + } + } else { + self.threadScanResults = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRNetworkCommissioningClusterAddOrUpdateWiFiNetworkParams - (instancetype)init @@ -3328,6 +4721,74 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRNetworkCommissioningClusterNetworkConfigResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType &)decodableStruct +{ + { + self.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.networkingStatus)]; + } + { + if (decodableStruct.debugText.HasValue()) { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.Value().data() + length:decodableStruct.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.debugText = nil; + } + } + { + if (decodableStruct.networkIndex.HasValue()) { + self.networkIndex = [NSNumber numberWithUnsignedChar:decodableStruct.networkIndex.Value()]; + } else { + self.networkIndex = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRNetworkCommissioningClusterConnectNetworkParams - (instancetype)init @@ -3398,6 +4859,74 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRNetworkCommissioningClusterConnectNetworkResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType &)decodableStruct +{ + { + self.networkingStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.networkingStatus)]; + } + { + if (decodableStruct.debugText.HasValue()) { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.Value().data() + length:decodableStruct.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.debugText = nil; + } + } + { + if (decodableStruct.errorValue.IsNull()) { + self.errorValue = nil; + } else { + self.errorValue = [NSNumber numberWithInt:decodableStruct.errorValue.Value()]; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRNetworkCommissioningClusterReorderNetworkParams - (instancetype)init @@ -3512,6 +5041,75 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDiagnosticLogsClusterRetrieveLogsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + self.logContent = [NSData dataWithBytes:decodableStruct.logContent.data() length:decodableStruct.logContent.size()]; + } + { + if (decodableStruct.UTCTimeStamp.HasValue()) { + self.utcTimeStamp = [NSNumber numberWithUnsignedLongLong:decodableStruct.UTCTimeStamp.Value()]; + } else { + self.utcTimeStamp = nil; + } + } + { + if (decodableStruct.timeSinceBoot.HasValue()) { + self.timeSinceBoot = [NSNumber numberWithUnsignedLongLong:decodableStruct.timeSinceBoot.Value()]; + } else { + self.timeSinceBoot = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDiagnosticLogsClusterRetrieveLogsResponseParams (Deprecated) @@ -3895,6 +5493,63 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROperationalCredentialsClusterAttestationResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType &)decodableStruct +{ + { + self.attestationElements = [NSData dataWithBytes:decodableStruct.attestationElements.data() + length:decodableStruct.attestationElements.size()]; + } + { + self.attestationSignature = [NSData dataWithBytes:decodableStruct.attestationSignature.data() + length:decodableStruct.attestationSignature.size()]; + } + return CHIP_NO_ERROR; +} @end @implementation MTROperationalCredentialsClusterAttestationResponseParams (Deprecated) @@ -3968,6 +5623,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROperationalCredentialsClusterCertificateChainResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType &)decodableStruct +{ + { + self.certificate = [NSData dataWithBytes:decodableStruct.certificate.data() length:decodableStruct.certificate.size()]; + } + return CHIP_NO_ERROR; +} @end @implementation MTROperationalCredentialsClusterCSRRequestParams - (instancetype)init @@ -4036,6 +5743,63 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROperationalCredentialsClusterCSRResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType &)decodableStruct +{ + { + self.nocsrElements = [NSData dataWithBytes:decodableStruct.NOCSRElements.data() + length:decodableStruct.NOCSRElements.size()]; + } + { + self.attestationSignature = [NSData dataWithBytes:decodableStruct.attestationSignature.data() + length:decodableStruct.attestationSignature.size()]; + } + return CHIP_NO_ERROR; +} @end @implementation MTROperationalCredentialsClusterAddNOCParams - (instancetype)init @@ -4152,6 +5916,74 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTROperationalCredentialsClusterNOCResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType &)decodableStruct +{ + { + self.statusCode = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.statusCode)]; + } + { + if (decodableStruct.fabricIndex.HasValue()) { + self.fabricIndex = [NSNumber numberWithUnsignedChar:decodableStruct.fabricIndex.Value()]; + } else { + self.fabricIndex = nil; + } + } + { + if (decodableStruct.debugText.HasValue()) { + self.debugText = [[NSString alloc] initWithBytes:decodableStruct.debugText.Value().data() + length:decodableStruct.debugText.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.debugText = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTROperationalCredentialsClusterUpdateFabricLabelParams - (instancetype)init @@ -4348,6 +6180,97 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupKeyManagementClusterKeySetReadResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &)decodableStruct +{ + { + self.groupKeySet = [MTRGroupKeyManagementClusterGroupKeySetStruct new]; + self.groupKeySet.groupKeySetID = [NSNumber numberWithUnsignedShort:decodableStruct.groupKeySet.groupKeySetID]; + self.groupKeySet.groupKeySecurityPolicy = + [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.groupKeySet.groupKeySecurityPolicy)]; + if (decodableStruct.groupKeySet.epochKey0.IsNull()) { + self.groupKeySet.epochKey0 = nil; + } else { + self.groupKeySet.epochKey0 = [NSData dataWithBytes:decodableStruct.groupKeySet.epochKey0.Value().data() + length:decodableStruct.groupKeySet.epochKey0.Value().size()]; + } + if (decodableStruct.groupKeySet.epochStartTime0.IsNull()) { + self.groupKeySet.epochStartTime0 = nil; + } else { + self.groupKeySet.epochStartTime0 = + [NSNumber numberWithUnsignedLongLong:decodableStruct.groupKeySet.epochStartTime0.Value()]; + } + if (decodableStruct.groupKeySet.epochKey1.IsNull()) { + self.groupKeySet.epochKey1 = nil; + } else { + self.groupKeySet.epochKey1 = [NSData dataWithBytes:decodableStruct.groupKeySet.epochKey1.Value().data() + length:decodableStruct.groupKeySet.epochKey1.Value().size()]; + } + if (decodableStruct.groupKeySet.epochStartTime1.IsNull()) { + self.groupKeySet.epochStartTime1 = nil; + } else { + self.groupKeySet.epochStartTime1 = + [NSNumber numberWithUnsignedLongLong:decodableStruct.groupKeySet.epochStartTime1.Value()]; + } + if (decodableStruct.groupKeySet.epochKey2.IsNull()) { + self.groupKeySet.epochKey2 = nil; + } else { + self.groupKeySet.epochKey2 = [NSData dataWithBytes:decodableStruct.groupKeySet.epochKey2.Value().data() + length:decodableStruct.groupKeySet.epochKey2.Value().size()]; + } + if (decodableStruct.groupKeySet.epochStartTime2.IsNull()) { + self.groupKeySet.epochStartTime2 = nil; + } else { + self.groupKeySet.epochStartTime2 = + [NSNumber numberWithUnsignedLongLong:decodableStruct.groupKeySet.epochStartTime2.Value()]; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRGroupKeyManagementClusterKeySetRemoveParams - (instancetype)init @@ -4439,6 +6362,72 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &)decodableStruct +{ + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.groupKeySetIDs.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.groupKeySetIDs = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRModeSelectClusterChangeToModeParams - (instancetype)init @@ -5026,6 +7015,99 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterGetWeekDayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &)decodableStruct +{ + { + self.weekDayIndex = [NSNumber numberWithUnsignedChar:decodableStruct.weekDayIndex]; + } + { + self.userIndex = [NSNumber numberWithUnsignedShort:decodableStruct.userIndex]; + } + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.daysMask.HasValue()) { + self.daysMask = [NSNumber numberWithUnsignedChar:decodableStruct.daysMask.Value().Raw()]; + } else { + self.daysMask = nil; + } + } + { + if (decodableStruct.startHour.HasValue()) { + self.startHour = [NSNumber numberWithUnsignedChar:decodableStruct.startHour.Value()]; + } else { + self.startHour = nil; + } + } + { + if (decodableStruct.startMinute.HasValue()) { + self.startMinute = [NSNumber numberWithUnsignedChar:decodableStruct.startMinute.Value()]; + } else { + self.startMinute = nil; + } + } + { + if (decodableStruct.endHour.HasValue()) { + self.endHour = [NSNumber numberWithUnsignedChar:decodableStruct.endHour.Value()]; + } else { + self.endHour = nil; + } + } + { + if (decodableStruct.endMinute.HasValue()) { + self.endMinute = [NSNumber numberWithUnsignedChar:decodableStruct.endMinute.Value()]; + } else { + self.endMinute = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDoorLockClusterClearWeekDayScheduleParams - (instancetype)init @@ -5177,6 +7259,78 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterGetYearDayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType &)decodableStruct +{ + { + self.yearDayIndex = [NSNumber numberWithUnsignedChar:decodableStruct.yearDayIndex]; + } + { + self.userIndex = [NSNumber numberWithUnsignedShort:decodableStruct.userIndex]; + } + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.localStartTime.HasValue()) { + self.localStartTime = [NSNumber numberWithUnsignedInt:decodableStruct.localStartTime.Value()]; + } else { + self.localStartTime = nil; + } + } + { + if (decodableStruct.localEndTime.HasValue()) { + self.localEndTime = [NSNumber numberWithUnsignedInt:decodableStruct.localEndTime.Value()]; + } else { + self.localEndTime = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDoorLockClusterClearYearDayScheduleParams - (instancetype)init @@ -5325,11 +7479,87 @@ - (NSString *)description return descriptionString; } -@end -@implementation MTRDoorLockClusterClearHolidayScheduleParams -- (instancetype)init +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error { - if (self = [super init]) { + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterGetHolidayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType &)decodableStruct +{ + { + self.holidayIndex = [NSNumber numberWithUnsignedChar:decodableStruct.holidayIndex]; + } + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.localStartTime.HasValue()) { + self.localStartTime = [NSNumber numberWithUnsignedInt:decodableStruct.localStartTime.Value()]; + } else { + self.localStartTime = nil; + } + } + { + if (decodableStruct.localEndTime.HasValue()) { + self.localEndTime = [NSNumber numberWithUnsignedInt:decodableStruct.localEndTime.Value()]; + } else { + self.localEndTime = nil; + } + } + { + if (decodableStruct.operatingMode.HasValue()) { + self.operatingMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.operatingMode.Value())]; + } else { + self.operatingMode = nil; + } + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRDoorLockClusterClearHolidayScheduleParams +- (instancetype)init +{ + if (self = [super init]) { _holidayIndex = @(0); _timedInvokeTimeoutMs = nil; @@ -5510,6 +7740,139 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterGetUserResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType &)decodableStruct +{ + { + self.userIndex = [NSNumber numberWithUnsignedShort:decodableStruct.userIndex]; + } + { + if (decodableStruct.userName.IsNull()) { + self.userName = nil; + } else { + self.userName = [[NSString alloc] initWithBytes:decodableStruct.userName.Value().data() + length:decodableStruct.userName.Value().size() + encoding:NSUTF8StringEncoding]; + } + } + { + if (decodableStruct.userUniqueID.IsNull()) { + self.userUniqueID = nil; + } else { + self.userUniqueID = [NSNumber numberWithUnsignedInt:decodableStruct.userUniqueID.Value()]; + } + } + { + if (decodableStruct.userStatus.IsNull()) { + self.userStatus = nil; + } else { + self.userStatus = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.userStatus.Value())]; + } + } + { + if (decodableStruct.userType.IsNull()) { + self.userType = nil; + } else { + self.userType = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.userType.Value())]; + } + } + { + if (decodableStruct.credentialRule.IsNull()) { + self.credentialRule = nil; + } else { + self.credentialRule = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.credentialRule.Value())]; + } + } + { + if (decodableStruct.credentials.IsNull()) { + self.credentials = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.credentials.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + MTRDoorLockClusterCredentialStruct * newElement_1; + newElement_1 = [MTRDoorLockClusterCredentialStruct new]; + newElement_1.credentialType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1.credentialType)]; + newElement_1.credentialIndex = [NSNumber numberWithUnsignedShort:entry_1.credentialIndex]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.credentials = array_1; + } + } + } + { + if (decodableStruct.creatorFabricIndex.IsNull()) { + self.creatorFabricIndex = nil; + } else { + self.creatorFabricIndex = [NSNumber numberWithUnsignedChar:decodableStruct.creatorFabricIndex.Value()]; + } + } + { + if (decodableStruct.lastModifiedFabricIndex.IsNull()) { + self.lastModifiedFabricIndex = nil; + } else { + self.lastModifiedFabricIndex = [NSNumber numberWithUnsignedChar:decodableStruct.lastModifiedFabricIndex.Value()]; + } + } + { + if (decodableStruct.nextUserIndex.IsNull()) { + self.nextUserIndex = nil; + } else { + self.nextUserIndex = [NSNumber numberWithUnsignedShort:decodableStruct.nextUserIndex.Value()]; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDoorLockClusterGetUserResponseParams (Deprecated) @@ -5636,6 +7999,72 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterSetCredentialResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.userIndex.IsNull()) { + self.userIndex = nil; + } else { + self.userIndex = [NSNumber numberWithUnsignedShort:decodableStruct.userIndex.Value()]; + } + } + { + if (decodableStruct.nextCredentialIndex.IsNull()) { + self.nextCredentialIndex = nil; + } else { + self.nextCredentialIndex = [NSNumber numberWithUnsignedShort:decodableStruct.nextCredentialIndex.Value()]; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDoorLockClusterGetCredentialStatusParams - (instancetype)init @@ -5711,6 +8140,86 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRDoorLockClusterGetCredentialStatusResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType &)decodableStruct +{ + { + self.credentialExists = [NSNumber numberWithBool:decodableStruct.credentialExists]; + } + { + if (decodableStruct.userIndex.IsNull()) { + self.userIndex = nil; + } else { + self.userIndex = [NSNumber numberWithUnsignedShort:decodableStruct.userIndex.Value()]; + } + } + { + if (decodableStruct.creatorFabricIndex.IsNull()) { + self.creatorFabricIndex = nil; + } else { + self.creatorFabricIndex = [NSNumber numberWithUnsignedChar:decodableStruct.creatorFabricIndex.Value()]; + } + } + { + if (decodableStruct.lastModifiedFabricIndex.IsNull()) { + self.lastModifiedFabricIndex = nil; + } else { + self.lastModifiedFabricIndex = [NSNumber numberWithUnsignedChar:decodableStruct.lastModifiedFabricIndex.Value()]; + } + } + { + if (decodableStruct.nextCredentialIndex.IsNull()) { + self.nextCredentialIndex = nil; + } else { + self.nextCredentialIndex = [NSNumber numberWithUnsignedShort:decodableStruct.nextCredentialIndex.Value()]; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRDoorLockClusterClearCredentialParams - (instancetype)init @@ -6076,6 +8585,92 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRThermostatClusterGetWeeklyScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType &)decodableStruct +{ + { + self.numberOfTransitionsForSequence = [NSNumber numberWithUnsignedChar:decodableStruct.numberOfTransitionsForSequence]; + } + { + self.dayOfWeekForSequence = [NSNumber numberWithUnsignedChar:decodableStruct.dayOfWeekForSequence.Raw()]; + } + { + self.modeForSequence = [NSNumber numberWithUnsignedChar:decodableStruct.modeForSequence.Raw()]; + } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.transitions.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterThermostatScheduleTransition * newElement_0; + newElement_0 = [MTRThermostatClusterThermostatScheduleTransition new]; + newElement_0.transitionTime = [NSNumber numberWithUnsignedShort:entry_0.transitionTime]; + if (entry_0.heatSetpoint.IsNull()) { + newElement_0.heatSetpoint = nil; + } else { + newElement_0.heatSetpoint = [NSNumber numberWithShort:entry_0.heatSetpoint.Value()]; + } + if (entry_0.coolSetpoint.IsNull()) { + newElement_0.coolSetpoint = nil; + } else { + newElement_0.coolSetpoint = [NSNumber numberWithShort:entry_0.coolSetpoint.Value()]; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.transitions = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRThermostatClusterSetWeeklyScheduleParams - (instancetype)init @@ -7077,6 +9672,67 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRChannelClusterChangeChannelResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() + length:decodableStruct.data.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRChannelClusterChangeChannelByNumberParams - (instancetype)init @@ -7207,6 +9863,67 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRTargetNavigatorClusterNavigateTargetResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() + length:decodableStruct.data.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRMediaPlaybackClusterPlayParams - (instancetype)init @@ -7520,6 +10237,67 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRMediaPlaybackClusterPlaybackResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() + length:decodableStruct.data.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRMediaPlaybackClusterSeekParams - (instancetype)init @@ -7753,6 +10531,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRKeypadInputClusterSendKeyResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRContentLauncherClusterLaunchContentParams - (instancetype)init @@ -7859,6 +10689,67 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRContentLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = [[NSString alloc] initWithBytes:decodableStruct.data.Value().data() + length:decodableStruct.data.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRContentLauncherClusterLaunchResponseParams @@ -8054,6 +10945,65 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRApplicationLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct +{ + { + self.status = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.status)]; + } + { + if (decodableStruct.data.HasValue()) { + self.data = [NSData dataWithBytes:decodableStruct.data.Value().data() length:decodableStruct.data.Value().size()]; + } else { + self.data = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRAccountLoginClusterGetSetupPINParams - (instancetype)init @@ -8113,6 +11063,60 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRAccountLoginClusterGetSetupPINResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &)decodableStruct +{ + { + self.setupPIN = [[NSString alloc] initWithBytes:decodableStruct.setupPIN.data() + length:decodableStruct.setupPIN.size() + encoding:NSUTF8StringEncoding]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRAccountLoginClusterLoginParams - (instancetype)init @@ -8213,6 +11217,81 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType &)decodableStruct +{ + { + self.profileCount = [NSNumber numberWithUnsignedChar:decodableStruct.profileCount]; + } + { + self.profileIntervalPeriod = [NSNumber numberWithUnsignedChar:decodableStruct.profileIntervalPeriod]; + } + { + self.maxNumberOfIntervals = [NSNumber numberWithUnsignedChar:decodableStruct.maxNumberOfIntervals]; + } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.listOfAttributes.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.listOfAttributes = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRElectricalMeasurementClusterGetProfileInfoCommandParams - (instancetype)init @@ -8286,6 +11365,88 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRElectricalMeasurementClusterGetMeasurementProfileResponseCommandParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType &) + decodableStruct +{ + { + self.startTime = [NSNumber numberWithUnsignedInt:decodableStruct.startTime]; + } + { + self.status = [NSNumber numberWithUnsignedChar:decodableStruct.status]; + } + { + self.profileIntervalPeriod = [NSNumber numberWithUnsignedChar:decodableStruct.profileIntervalPeriod]; + } + { + self.numberOfIntervalsDelivered = [NSNumber numberWithUnsignedChar:decodableStruct.numberOfIntervalsDelivered]; + } + { + self.attributeId = [NSNumber numberWithUnsignedShort:decodableStruct.attributeId]; + } + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.intervals.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.intervals = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRElectricalMeasurementClusterGetMeasurementProfileCommandParams - (instancetype)init @@ -8382,6 +11543,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestSpecificResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType &)decodableStruct +{ + { + self.returnValue = [NSNumber numberWithUnsignedChar:decodableStruct.returnValue]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestSpecificResponseParams @@ -8444,6 +11657,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestAddArgumentsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType &)decodableStruct +{ + { + self.returnValue = [NSNumber numberWithUnsignedChar:decodableStruct.returnValue]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestAddArgumentsResponseParams @@ -8506,6 +11771,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestSimpleArgumentResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType &)decodableStruct +{ + { + self.returnValue = [NSNumber numberWithBool:decodableStruct.returnValue]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestSimpleArgumentResponseParams @@ -8583,6 +11900,221 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestStructArrayArgumentResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType &)decodableStruct +{ + { { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg1.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUnitTestingClusterNestedStructList * newElement_0; + newElement_0 = [MTRUnitTestingClusterNestedStructList new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [MTRUnitTestingClusterSimpleStruct new]; + newElement_0.c.a = [NSNumber numberWithUnsignedChar:entry_0.c.a]; + newElement_0.c.b = [NSNumber numberWithBool:entry_0.c.b]; + newElement_0.c.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c.c)]; + newElement_0.c.d = [NSData dataWithBytes:entry_0.c.d.data() length:entry_0.c.d.size()]; + newElement_0.c.e = [[NSString alloc] initWithBytes:entry_0.c.e.data() + length:entry_0.c.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.c.f = [NSNumber numberWithUnsignedChar:entry_0.c.f.Raw()]; + newElement_0.c.g = [NSNumber numberWithFloat:entry_0.c.g]; + newElement_0.c.h = [NSNumber numberWithDouble:entry_0.c.h]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.d.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRUnitTestingClusterSimpleStruct * newElement_2; + newElement_2 = [MTRUnitTestingClusterSimpleStruct new]; + newElement_2.a = [NSNumber numberWithUnsignedChar:entry_2.a]; + newElement_2.b = [NSNumber numberWithBool:entry_2.b]; + newElement_2.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_2.c)]; + newElement_2.d = [NSData dataWithBytes:entry_2.d.data() length:entry_2.d.size()]; + newElement_2.e = [[NSString alloc] initWithBytes:entry_2.e.data() + length:entry_2.e.size() + encoding:NSUTF8StringEncoding]; + newElement_2.f = [NSNumber numberWithUnsignedChar:entry_2.f.Raw()]; + newElement_2.g = [NSNumber numberWithFloat:entry_2.g]; + newElement_2.h = [NSNumber numberWithDouble:entry_2.h]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.d = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.e.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedInt:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.e = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.f.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = [NSData dataWithBytes:entry_2.data() length:entry_2.size()]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.f = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.g.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedChar:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + newElement_0.g = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg1 = array_0; +} +} +{ + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg2.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUnitTestingClusterSimpleStruct * newElement_0; + newElement_0 = [MTRUnitTestingClusterSimpleStruct new]; + newElement_0.a = [NSNumber numberWithUnsignedChar:entry_0.a]; + newElement_0.b = [NSNumber numberWithBool:entry_0.b]; + newElement_0.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.c)]; + newElement_0.d = [NSData dataWithBytes:entry_0.d.data() length:entry_0.d.size()]; + newElement_0.e = [[NSString alloc] initWithBytes:entry_0.e.data() + length:entry_0.e.size() + encoding:NSUTF8StringEncoding]; + newElement_0.f = [NSNumber numberWithUnsignedChar:entry_0.f.Raw()]; + newElement_0.g = [NSNumber numberWithFloat:entry_0.g]; + newElement_0.h = [NSNumber numberWithDouble:entry_0.h]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg2 = array_0; + } +} +{ + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg3.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg3 = array_0; + } +} +{ + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg4.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithBool:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg4 = array_0; + } +} +{ + self.arg5 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg5)]; +} +{ + self.arg6 = [NSNumber numberWithBool:decodableStruct.arg6]; +} +return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestStructArrayArgumentResponseParams @@ -8651,6 +12183,72 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestListInt8UReverseResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType &)decodableStruct +{ + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.arg1.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.arg1 = array_0; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestListInt8UReverseResponseParams @@ -8719,6 +12317,61 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestEnumsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType &)decodableStruct +{ + { + self.arg1 = [NSNumber numberWithUnsignedShort:chip::to_underlying(decodableStruct.arg1)]; + } + { + self.arg2 = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg2)]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestEnumsResponseParams @@ -8809,6 +12462,83 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestNullableOptionalResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType &)decodableStruct +{ + { + self.wasPresent = [NSNumber numberWithBool:decodableStruct.wasPresent]; + } + { + if (decodableStruct.wasNull.HasValue()) { + self.wasNull = [NSNumber numberWithBool:decodableStruct.wasNull.Value()]; + } else { + self.wasNull = nil; + } + } + { + if (decodableStruct.value.HasValue()) { + self.value = [NSNumber numberWithUnsignedChar:decodableStruct.value.Value()]; + } else { + self.value = nil; + } + } + { + if (decodableStruct.originalValue.HasValue()) { + if (decodableStruct.originalValue.Value().IsNull()) { + self.originalValue = nil; + } else { + self.originalValue = [NSNumber numberWithUnsignedChar:decodableStruct.originalValue.Value().Value()]; + } + } else { + self.originalValue = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestNullableOptionalResponseParams @@ -8969,6 +12699,292 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestComplexNullableOptionalResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType &)decodableStruct +{ + { + self.nullableIntWasNull = [NSNumber numberWithBool:decodableStruct.nullableIntWasNull]; + } + { + if (decodableStruct.nullableIntValue.HasValue()) { + self.nullableIntValue = [NSNumber numberWithUnsignedShort:decodableStruct.nullableIntValue.Value()]; + } else { + self.nullableIntValue = nil; + } + } + { + self.optionalIntWasPresent = [NSNumber numberWithBool:decodableStruct.optionalIntWasPresent]; + } + { + if (decodableStruct.optionalIntValue.HasValue()) { + self.optionalIntValue = [NSNumber numberWithUnsignedShort:decodableStruct.optionalIntValue.Value()]; + } else { + self.optionalIntValue = nil; + } + } + { + self.nullableOptionalIntWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalIntWasPresent]; + } + { + if (decodableStruct.nullableOptionalIntWasNull.HasValue()) { + self.nullableOptionalIntWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalIntWasNull.Value()]; + } else { + self.nullableOptionalIntWasNull = nil; + } + } + { + if (decodableStruct.nullableOptionalIntValue.HasValue()) { + self.nullableOptionalIntValue = [NSNumber numberWithUnsignedShort:decodableStruct.nullableOptionalIntValue.Value()]; + } else { + self.nullableOptionalIntValue = nil; + } + } + { + self.nullableStringWasNull = [NSNumber numberWithBool:decodableStruct.nullableStringWasNull]; + } + { + if (decodableStruct.nullableStringValue.HasValue()) { + self.nullableStringValue = [[NSString alloc] initWithBytes:decodableStruct.nullableStringValue.Value().data() + length:decodableStruct.nullableStringValue.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.nullableStringValue = nil; + } + } + { + self.optionalStringWasPresent = [NSNumber numberWithBool:decodableStruct.optionalStringWasPresent]; + } + { + if (decodableStruct.optionalStringValue.HasValue()) { + self.optionalStringValue = [[NSString alloc] initWithBytes:decodableStruct.optionalStringValue.Value().data() + length:decodableStruct.optionalStringValue.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.optionalStringValue = nil; + } + } + { + self.nullableOptionalStringWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalStringWasPresent]; + } + { + if (decodableStruct.nullableOptionalStringWasNull.HasValue()) { + self.nullableOptionalStringWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalStringWasNull.Value()]; + } else { + self.nullableOptionalStringWasNull = nil; + } + } + { + if (decodableStruct.nullableOptionalStringValue.HasValue()) { + self.nullableOptionalStringValue = + [[NSString alloc] initWithBytes:decodableStruct.nullableOptionalStringValue.Value().data() + length:decodableStruct.nullableOptionalStringValue.Value().size() + encoding:NSUTF8StringEncoding]; + } else { + self.nullableOptionalStringValue = nil; + } + } + { + self.nullableStructWasNull = [NSNumber numberWithBool:decodableStruct.nullableStructWasNull]; + } + { + if (decodableStruct.nullableStructValue.HasValue()) { + self.nullableStructValue = [MTRUnitTestingClusterSimpleStruct new]; + self.nullableStructValue.a = [NSNumber numberWithUnsignedChar:decodableStruct.nullableStructValue.Value().a]; + self.nullableStructValue.b = [NSNumber numberWithBool:decodableStruct.nullableStructValue.Value().b]; + self.nullableStructValue.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableStructValue.Value().c)]; + self.nullableStructValue.d = [NSData dataWithBytes:decodableStruct.nullableStructValue.Value().d.data() + length:decodableStruct.nullableStructValue.Value().d.size()]; + self.nullableStructValue.e = [[NSString alloc] initWithBytes:decodableStruct.nullableStructValue.Value().e.data() + length:decodableStruct.nullableStructValue.Value().e.size() + encoding:NSUTF8StringEncoding]; + self.nullableStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.nullableStructValue.Value().f.Raw()]; + self.nullableStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableStructValue.Value().g]; + self.nullableStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableStructValue.Value().h]; + } else { + self.nullableStructValue = nil; + } + } + { + self.optionalStructWasPresent = [NSNumber numberWithBool:decodableStruct.optionalStructWasPresent]; + } + { + if (decodableStruct.optionalStructValue.HasValue()) { + self.optionalStructValue = [MTRUnitTestingClusterSimpleStruct new]; + self.optionalStructValue.a = [NSNumber numberWithUnsignedChar:decodableStruct.optionalStructValue.Value().a]; + self.optionalStructValue.b = [NSNumber numberWithBool:decodableStruct.optionalStructValue.Value().b]; + self.optionalStructValue.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.optionalStructValue.Value().c)]; + self.optionalStructValue.d = [NSData dataWithBytes:decodableStruct.optionalStructValue.Value().d.data() + length:decodableStruct.optionalStructValue.Value().d.size()]; + self.optionalStructValue.e = [[NSString alloc] initWithBytes:decodableStruct.optionalStructValue.Value().e.data() + length:decodableStruct.optionalStructValue.Value().e.size() + encoding:NSUTF8StringEncoding]; + self.optionalStructValue.f = [NSNumber numberWithUnsignedChar:decodableStruct.optionalStructValue.Value().f.Raw()]; + self.optionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.optionalStructValue.Value().g]; + self.optionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.optionalStructValue.Value().h]; + } else { + self.optionalStructValue = nil; + } + } + { + self.nullableOptionalStructWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalStructWasPresent]; + } + { + if (decodableStruct.nullableOptionalStructWasNull.HasValue()) { + self.nullableOptionalStructWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalStructWasNull.Value()]; + } else { + self.nullableOptionalStructWasNull = nil; + } + } + { + if (decodableStruct.nullableOptionalStructValue.HasValue()) { + self.nullableOptionalStructValue = [MTRUnitTestingClusterSimpleStruct new]; + self.nullableOptionalStructValue.a = + [NSNumber numberWithUnsignedChar:decodableStruct.nullableOptionalStructValue.Value().a]; + self.nullableOptionalStructValue.b = [NSNumber numberWithBool:decodableStruct.nullableOptionalStructValue.Value().b]; + self.nullableOptionalStructValue.c = + [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.nullableOptionalStructValue.Value().c)]; + self.nullableOptionalStructValue.d = + [NSData dataWithBytes:decodableStruct.nullableOptionalStructValue.Value().d.data() + length:decodableStruct.nullableOptionalStructValue.Value().d.size()]; + self.nullableOptionalStructValue.e = + [[NSString alloc] initWithBytes:decodableStruct.nullableOptionalStructValue.Value().e.data() + length:decodableStruct.nullableOptionalStructValue.Value().e.size() + encoding:NSUTF8StringEncoding]; + self.nullableOptionalStructValue.f = + [NSNumber numberWithUnsignedChar:decodableStruct.nullableOptionalStructValue.Value().f.Raw()]; + self.nullableOptionalStructValue.g = [NSNumber numberWithFloat:decodableStruct.nullableOptionalStructValue.Value().g]; + self.nullableOptionalStructValue.h = [NSNumber numberWithDouble:decodableStruct.nullableOptionalStructValue.Value().h]; + } else { + self.nullableOptionalStructValue = nil; + } + } + { + self.nullableListWasNull = [NSNumber numberWithBool:decodableStruct.nullableListWasNull]; + } + { + if (decodableStruct.nullableListValue.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.nullableListValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.nullableListValue = array_1; + } + } else { + self.nullableListValue = nil; + } + } + { + self.optionalListWasPresent = [NSNumber numberWithBool:decodableStruct.optionalListWasPresent]; + } + { + if (decodableStruct.optionalListValue.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.optionalListValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.optionalListValue = array_1; + } + } else { + self.optionalListValue = nil; + } + } + { + self.nullableOptionalListWasPresent = [NSNumber numberWithBool:decodableStruct.nullableOptionalListWasPresent]; + } + { + if (decodableStruct.nullableOptionalListWasNull.HasValue()) { + self.nullableOptionalListWasNull = [NSNumber numberWithBool:decodableStruct.nullableOptionalListWasNull.Value()]; + } else { + self.nullableOptionalListWasNull = nil; + } + } + { + if (decodableStruct.nullableOptionalListValue.HasValue()) { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = decodableStruct.nullableOptionalListValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSNumber * newElement_1; + newElement_1 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_1)]; + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.nullableOptionalListValue = array_1; + } + } else { + self.nullableOptionalListValue = nil; + } + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestComplexNullableOptionalResponseParams @@ -9033,6 +13049,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterBooleanResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType &)decodableStruct +{ + { + self.value = [NSNumber numberWithBool:decodableStruct.value]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterBooleanResponseParams @@ -9097,6 +13165,68 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterSimpleStructResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType &)decodableStruct +{ + { + self.arg1 = [MTRUnitTestingClusterSimpleStruct new]; + self.arg1.a = [NSNumber numberWithUnsignedChar:decodableStruct.arg1.a]; + self.arg1.b = [NSNumber numberWithBool:decodableStruct.arg1.b]; + self.arg1.c = [NSNumber numberWithUnsignedChar:chip::to_underlying(decodableStruct.arg1.c)]; + self.arg1.d = [NSData dataWithBytes:decodableStruct.arg1.d.data() length:decodableStruct.arg1.d.size()]; + self.arg1.e = [[NSString alloc] initWithBytes:decodableStruct.arg1.e.data() + length:decodableStruct.arg1.e.size() + encoding:NSUTF8StringEncoding]; + self.arg1.f = [NSNumber numberWithUnsignedChar:decodableStruct.arg1.f.Raw()]; + self.arg1.g = [NSNumber numberWithFloat:decodableStruct.arg1.g]; + self.arg1.h = [NSNumber numberWithDouble:decodableStruct.arg1.h]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterSimpleStructResponseParams @@ -9161,6 +13291,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestEmitTestEventResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType &)decodableStruct +{ + { + self.value = [NSNumber numberWithUnsignedLongLong:decodableStruct.value]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestEmitTestEventResponseParams @@ -9225,6 +13407,58 @@ - (NSString *)description return descriptionString; } +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType &)decodableStruct +{ + { + self.value = [NSNumber numberWithUnsignedLongLong:decodableStruct.value]; + } + return CHIP_NO_ERROR; +} @end @implementation MTRTestClusterClusterTestEmitTestFabricScopedEventResponseParams diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h new file mode 100644 index 00000000000000..1de843868eb61f --- /dev/null +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -0,0 +1,417 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#include + +NS_ASSUME_NONNULL_BEGIN + +@interface MTRGroupsClusterAddGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGroupsClusterViewGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::ViewGroupResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGroupsClusterGetGroupMembershipResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGroupsClusterRemoveGroupResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Groups::Commands::RemoveGroupResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterAddSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::AddSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterViewSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::ViewSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterRemoveSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterRemoveAllScenesResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterStoreSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::StoreSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterGetSceneMembershipResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterEnhancedAddSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterEnhancedViewSceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRScenesClusterCopySceneResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Scenes::Commands::CopySceneResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROTASoftwareUpdateProviderClusterQueryImageResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGeneralCommissioningClusterArmFailSafeResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::SetRegulatoryConfigResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGeneralCommissioningClusterCommissioningCompleteResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GeneralCommissioning::Commands::CommissioningCompleteResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRNetworkCommissioningClusterScanNetworksResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRNetworkCommissioningClusterNetworkConfigResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRNetworkCommissioningClusterConnectNetworkResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDiagnosticLogsClusterRetrieveLogsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROperationalCredentialsClusterAttestationResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROperationalCredentialsClusterCertificateChainResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROperationalCredentialsClusterCSRResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType &)decodableStruct; + +@end + +@interface MTROperationalCredentialsClusterNOCResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGroupKeyManagementClusterKeySetReadResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadAllIndicesResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterGetWeekDayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterGetYearDayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterGetHolidayScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterGetUserResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetUserResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterSetCredentialResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRDoorLockClusterGetCredentialStatusResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRThermostatClusterGetWeeklyScheduleResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRChannelClusterChangeChannelResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::Channel::Commands::ChangeChannelResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRTargetNavigatorClusterNavigateTargetResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRMediaPlaybackClusterPlaybackResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRKeypadInputClusterSendKeyResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRContentLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRApplicationLauncherClusterLauncherResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRAccountLoginClusterGetSetupPINResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRElectricalMeasurementClusterGetProfileInfoResponseCommandParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType &)decodableStruct; + +@end + +@interface MTRElectricalMeasurementClusterGetMeasurementProfileResponseCommandParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType &) + decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestSpecificResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestAddArgumentsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestSimpleArgumentResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestStructArrayArgumentResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestStructArrayArgumentResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestListInt8UReverseResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestListInt8UReverseResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestEnumsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestNullableOptionalResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestNullableOptionalResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestComplexNullableOptionalResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestComplexNullableOptionalResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterBooleanResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::BooleanResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterSimpleStructResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestEmitTestEventResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType &)decodableStruct; + +@end + +@interface MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType &)decodableStruct; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m index 1eee9de6ccaded..53c4e47b498804 100644 --- a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m @@ -973,4 +973,142 @@ - (void)test032_VeryLongListAttribute XCTAssertNil(report.error); } +- (void)test033_CommandResponse +{ + NSDictionary * input = @{ + MTRCommandPathKey : [MTRCommandPath commandPathWithEndpointID:@(0) + clusterID:@(MTRClusterIDTypeGroupsID) + commandID:@(MTRCommandIDTypeClusterGroupsCommandAddGroupResponseID)], + MTRDataKey : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(0), // Status + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(1), + }, + }, + @{ + MTRContextTagKey : @(1), // GroupID + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(0x176), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * payload = [[MTRGroupsClusterAddGroupResponseParams alloc] initWithResponseValue:input error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(payload); + XCTAssertEqualObjects(payload.status, @(1)); + XCTAssertEqualObjects(payload.groupID, @(0x176)); +} + +- (void)test034_CommandResponseWrongCommandID +{ + NSDictionary * input = @{ + MTRCommandPathKey : + [MTRCommandPath commandPathWithEndpointID:@(0) + clusterID:@(MTRClusterIDTypeGroupsID) + commandID:@(MTRCommandIDTypeClusterGroupsCommandGetGroupMembershipResponseID)], + MTRDataKey : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(0), // Status + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(1), + }, + }, + @{ + MTRContextTagKey : @(1), // GroupID + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(0x176), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * payload = [[MTRGroupsClusterAddGroupResponseParams alloc] initWithResponseValue:input error:&error]; + XCTAssertNil(payload); + XCTAssertNotNil(error); + XCTAssertEqual(error.code, MTRErrorCodeSchemaMismatch); +} + +- (void)test035_CommandResponseWrongClusterID +{ + NSDictionary * input = @{ + MTRCommandPathKey : [MTRCommandPath commandPathWithEndpointID:@(0) + clusterID:@(MTRClusterIDTypeOnOffID) + commandID:@(MTRCommandIDTypeClusterGroupsCommandAddGroupResponseID)], + MTRDataKey : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(0), // Status + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(1), + }, + }, + @{ + MTRContextTagKey : @(1), // GroupID + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(0x176), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * payload = [[MTRGroupsClusterAddGroupResponseParams alloc] initWithResponseValue:input error:&error]; + XCTAssertNil(payload); + XCTAssertNotNil(error); + XCTAssertEqual(error.code, MTRErrorCodeSchemaMismatch); +} + +- (void)test036_CommandResponseWrongData +{ + NSDictionary * input = @{ + MTRCommandPathKey : [MTRCommandPath commandPathWithEndpointID:@(0) + clusterID:@(MTRClusterIDTypeGroupsID) + commandID:@(MTRCommandIDTypeClusterGroupsCommandAddGroupResponseID)], + MTRDataKey : @ { + MTRTypeKey : MTRStructureValueType, + MTRValueKey : @[ + @{ + MTRContextTagKey : @(0), // Status + MTRDataKey : @ { + MTRTypeKey : MTRSignedIntegerValueType, // Wrong data type + MTRValueKey : @(1), + }, + }, + @{ + MTRContextTagKey : @(1), // GroupID + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(0x176), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * payload = [[MTRGroupsClusterAddGroupResponseParams alloc] initWithResponseValue:input error:&error]; + XCTAssertNil(payload); + XCTAssertNotNil(error); + XCTAssertEqual(error.code, MTRErrorCodeSchemaMismatch); +} + @end diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 2c3d949ba79ecc..9bef78fe0ab941 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -1271,6 +1271,17 @@ - (void)test014_InvokeCommandWithDifferentIdResponse }; XCTAssertEqualObjects(result[MTRDataKey], expectedResult); XCTAssertNil(result[MTRErrorKey]); + + // Now check our strong-typed parsing bits. + NSError * parseError; + __auto_type * response = + [[MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams alloc] + initWithResponseValue:result + error:&parseError]; + XCTAssertNil(parseError); + XCTAssertNotNil(response); + XCTAssertEqual(response.groupKeySetIDs.count, 1); + XCTAssertEqualObjects(response.groupKeySetIDs[0], @(0)); } XCTAssertEqual([resultArray count], 1); } From f1e0f6844b473264c8304e96cbd35ed258707838 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 17 May 2023 09:25:24 -0700 Subject: [PATCH 06/12] Fix build error 2 files found with path 'META-INF/main.kotlin_module' (#26619) --- examples/android/CHIPTool/app/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/android/CHIPTool/app/build.gradle b/examples/android/CHIPTool/app/build.gradle index 3150e344c91ab5..bdbd03ff48d822 100644 --- a/examples/android/CHIPTool/app/build.gradle +++ b/examples/android/CHIPTool/app/build.gradle @@ -40,6 +40,10 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } + packagingOptions { + exclude 'META-INF/main.kotlin_module' + } + buildFeatures { viewBinding = true } From 8216b976923ec7d67cb7cafb93169cd27f525ac6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 14:57:29 -0400 Subject: [PATCH 07/12] Align Replaceable Monitoring clusters on the "Feature" name. (#26613) We generally want to move all feature maps to this. --- .../chip/replacable-monitoring-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 24 +++---- .../python/chip/clusters/Objects.py | 24 +++---- .../CHIP/zap-generated/MTRBaseClusters.h | 72 +++++++++---------- .../app-common/zap-generated/cluster-enums.h | 48 ++++++------- 5 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml index 0ee370b7156443..5e7f23568ad6c6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/replacable-monitoring-cluster.xml @@ -269,7 +269,7 @@ limitations under the License. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 0f3d32506f0216..5a960777719c68 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -2627,7 +2627,7 @@ client cluster HepaFilterMonitoring = 113 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2660,7 +2660,7 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2693,7 +2693,7 @@ client cluster CeramicFilterMonitoring = 115 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2726,7 +2726,7 @@ client cluster ElectrostaticFilterMonitoring = 116 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2759,7 +2759,7 @@ client cluster UvFilterMonitoring = 117 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2792,7 +2792,7 @@ client cluster IonizingFilterMonitoring = 118 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2825,7 +2825,7 @@ client cluster ZeoliteFilterMonitoring = 119 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2858,7 +2858,7 @@ client cluster OzoneFilterMonitoring = 120 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2891,7 +2891,7 @@ client cluster WaterTankMonitoring = 121 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2924,7 +2924,7 @@ client cluster FuelTankMonitoring = 122 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2957,7 +2957,7 @@ client cluster InkCartridgeMonitoring = 123 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } @@ -2990,7 +2990,7 @@ client cluster TonerCartridgeMonitoring = 124 { kDown = 1; } - bitmap Features : BITMAP32 { + bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; } diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index e1c7392971e3b3..d1d1fd36d0450b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -15314,7 +15314,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -15546,7 +15546,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -15778,7 +15778,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -16010,7 +16010,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -16242,7 +16242,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -16474,7 +16474,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -16706,7 +16706,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -16938,7 +16938,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -17170,7 +17170,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -17402,7 +17402,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -17634,7 +17634,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 @@ -17866,7 +17866,7 @@ class DegradationDirectionEnum(MatterIntEnum): kUnknownEnumValue = 2, class Bitmaps: - class Features(IntFlag): + class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 3ca90637bbff2f..b6701eae3e480b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -21861,9 +21861,9 @@ typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringDegradationDirection) { MTRHEPAFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeatures) { - MTRHEPAFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRHEPAFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeature) { + MTRHEPAFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRHEPAFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringChangeIndication) { @@ -21877,9 +21877,9 @@ typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringDegradationDirection) MTRActivatedCarbonFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeatures) { - MTRActivatedCarbonFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRActivatedCarbonFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeature) { + MTRActivatedCarbonFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRActivatedCarbonFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRCeramicFilterMonitoringChangeIndication) { @@ -21893,9 +21893,9 @@ typedef NS_ENUM(uint8_t, MTRCeramicFilterMonitoringDegradationDirection) { MTRCeramicFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRCeramicFilterMonitoringFeatures) { - MTRCeramicFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRCeramicFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRCeramicFilterMonitoringFeature) { + MTRCeramicFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRCeramicFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRElectrostaticFilterMonitoringChangeIndication) { @@ -21909,9 +21909,9 @@ typedef NS_ENUM(uint8_t, MTRElectrostaticFilterMonitoringDegradationDirection) { MTRElectrostaticFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRElectrostaticFilterMonitoringFeatures) { - MTRElectrostaticFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRElectrostaticFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRElectrostaticFilterMonitoringFeature) { + MTRElectrostaticFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRElectrostaticFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRUVFilterMonitoringChangeIndication) { @@ -21925,9 +21925,9 @@ typedef NS_ENUM(uint8_t, MTRUVFilterMonitoringDegradationDirection) { MTRUVFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRUVFilterMonitoringFeatures) { - MTRUVFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRUVFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRUVFilterMonitoringFeature) { + MTRUVFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRUVFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRIonizingFilterMonitoringChangeIndication) { @@ -21941,9 +21941,9 @@ typedef NS_ENUM(uint8_t, MTRIonizingFilterMonitoringDegradationDirection) { MTRIonizingFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRIonizingFilterMonitoringFeatures) { - MTRIonizingFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRIonizingFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRIonizingFilterMonitoringFeature) { + MTRIonizingFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRIonizingFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRZeoliteFilterMonitoringChangeIndication) { @@ -21957,9 +21957,9 @@ typedef NS_ENUM(uint8_t, MTRZeoliteFilterMonitoringDegradationDirection) { MTRZeoliteFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRZeoliteFilterMonitoringFeatures) { - MTRZeoliteFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRZeoliteFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRZeoliteFilterMonitoringFeature) { + MTRZeoliteFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRZeoliteFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTROzoneFilterMonitoringChangeIndication) { @@ -21973,9 +21973,9 @@ typedef NS_ENUM(uint8_t, MTROzoneFilterMonitoringDegradationDirection) { MTROzoneFilterMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTROzoneFilterMonitoringFeatures) { - MTROzoneFilterMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTROzoneFilterMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTROzoneFilterMonitoringFeature) { + MTROzoneFilterMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTROzoneFilterMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRWaterTankMonitoringChangeIndication) { @@ -21989,9 +21989,9 @@ typedef NS_ENUM(uint8_t, MTRWaterTankMonitoringDegradationDirection) { MTRWaterTankMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRWaterTankMonitoringFeatures) { - MTRWaterTankMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRWaterTankMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRWaterTankMonitoringFeature) { + MTRWaterTankMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRWaterTankMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRFuelTankMonitoringChangeIndication) { @@ -22005,9 +22005,9 @@ typedef NS_ENUM(uint8_t, MTRFuelTankMonitoringDegradationDirection) { MTRFuelTankMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRFuelTankMonitoringFeatures) { - MTRFuelTankMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRFuelTankMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRFuelTankMonitoringFeature) { + MTRFuelTankMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRFuelTankMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRInkCartridgeMonitoringChangeIndication) { @@ -22021,9 +22021,9 @@ typedef NS_ENUM(uint8_t, MTRInkCartridgeMonitoringDegradationDirection) { MTRInkCartridgeMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRInkCartridgeMonitoringFeatures) { - MTRInkCartridgeMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRInkCartridgeMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRInkCartridgeMonitoringFeature) { + MTRInkCartridgeMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRInkCartridgeMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRTonerCartridgeMonitoringChangeIndication) { @@ -22037,9 +22037,9 @@ typedef NS_ENUM(uint8_t, MTRTonerCartridgeMonitoringDegradationDirection) { MTRTonerCartridgeMonitoringDegradationDirectionDown MTR_NEWLY_AVAILABLE = 0x01, } MTR_NEWLY_AVAILABLE; -typedef NS_OPTIONS(uint32_t, MTRTonerCartridgeMonitoringFeatures) { - MTRTonerCartridgeMonitoringFeaturesCondition MTR_NEWLY_AVAILABLE = 0x1, - MTRTonerCartridgeMonitoringFeaturesWarning MTR_NEWLY_AVAILABLE = 0x2, +typedef NS_OPTIONS(uint32_t, MTRTonerCartridgeMonitoringFeature) { + MTRTonerCartridgeMonitoringFeatureCondition MTR_NEWLY_AVAILABLE = 0x1, + MTRTonerCartridgeMonitoringFeatureWarning MTR_NEWLY_AVAILABLE = 0x2, } MTR_NEWLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) { 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 7ba17464cb84f9..f84c4635d79d1a 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 @@ -1560,8 +1560,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1595,8 +1595,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1630,8 +1630,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1665,8 +1665,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1700,8 +1700,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1735,8 +1735,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1770,8 +1770,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1805,8 +1805,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1840,8 +1840,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1875,8 +1875,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1910,8 +1910,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, @@ -1945,8 +1945,8 @@ enum class DegradationDirectionEnum : uint8_t kUnknownEnumValue = 2, }; -// Bitmap for Features -enum class Features : uint32_t +// Bitmap for Feature +enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, From db088d5f386695d68cf450d136d734733cc2ec21 Mon Sep 17 00:00:00 2001 From: Marc Mikolits Date: Wed, 17 May 2023 21:17:04 +0200 Subject: [PATCH 08/12] Apply changes for european lock support to cluster xml (#26632) * apply changes for european lock support to cluster xml * Fix formatting issues. --------- Co-authored-by: Boris Zbarsky --- .../all-clusters-app.matter | 4 + .../all-clusters-minimal-app.matter | 4 + .../rootnode_doorlock_aNKYAreMXE.matter | 4 + examples/lock-app/genio/src/LockManager.cpp | 2 + .../infineon/cyw30739/src/LockManager.cpp | 2 + .../infineon/psoc6/src/LockManager.cpp | 2 + examples/lock-app/lock-common/lock-app.matter | 4 + .../lock-app/lock-common/src/LockEndpoint.cpp | 2 + examples/lock-app/nxp/zap/lock-app.matter | 4 + examples/lock-app/qpg/zap/lock.matter | 4 + .../silabs/SiWx917/src/LockManager.cpp | 2 + .../lock-app/silabs/efr32/src/LockManager.cpp | 2 + .../platform/esp32/lock/BoltLockManager.cpp | 2 + .../zcl/data-model/chip/door-lock-cluster.xml | 11 +++ .../data_model/controller-clusters.matter | 10 +++ .../python/chip/clusters/Objects.py | 30 ++++++- .../CHIP/templates/availability.yaml | 5 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 11 +++ .../CHIP/zap-generated/MTRBaseClusters.mm | 49 +++++++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 1 + .../CHIP/zap-generated/MTRClusters.h | 4 + .../CHIP/zap-generated/MTRClusters.mm | 86 +++++++++++++++++++ .../zap-generated/MTRCommandPayloadsObjc.h | 30 +++++++ .../zap-generated/MTRCommandPayloadsObjc.mm | 31 +++++++ .../app-common/zap-generated/callback.h | 6 ++ .../zap-generated/cluster-enums-check.h | 9 +- .../app-common/zap-generated/cluster-enums.h | 10 ++- .../zap-generated/cluster-objects.cpp | 38 ++++++++ .../zap-generated/cluster-objects.h | 37 ++++++++ .../app-common/zap-generated/ids/Commands.h | 4 + .../zap-generated/cluster/Commands.h | 32 +++++++ .../zap-generated/cluster/Commands.h | 50 +++++++++++ 32 files changed, 483 insertions(+), 9 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 9d76c360803f43..e5c88e10a5e5e3 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 @@ -2361,6 +2361,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -2375,6 +2376,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -2466,6 +2468,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -2654,6 +2657,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { 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 32a2bc72417bcf..256f2299e2c686 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 @@ -2091,6 +2091,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -2105,6 +2106,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -2196,6 +2198,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -2384,6 +2387,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index 7b8f60cf3d3c8d..fc73fb38ad1729 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -1231,6 +1231,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -1245,6 +1246,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -1336,6 +1338,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -1524,6 +1527,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { diff --git a/examples/lock-app/genio/src/LockManager.cpp b/examples/lock-app/genio/src/LockManager.cpp index f558bb1de96070..aa934e3042506a 100644 --- a/examples/lock-app/genio/src/LockManager.cpp +++ b/examples/lock-app/genio/src/LockManager.cpp @@ -640,6 +640,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/lock-app/infineon/cyw30739/src/LockManager.cpp b/examples/lock-app/infineon/cyw30739/src/LockManager.cpp index 3e868f503a84c5..30d680d96500ca 100644 --- a/examples/lock-app/infineon/cyw30739/src/LockManager.cpp +++ b/examples/lock-app/infineon/cyw30739/src/LockManager.cpp @@ -650,6 +650,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/lock-app/infineon/psoc6/src/LockManager.cpp b/examples/lock-app/infineon/psoc6/src/LockManager.cpp index 764ee16ee61c56..4fed23346571dc 100644 --- a/examples/lock-app/infineon/psoc6/src/LockManager.cpp +++ b/examples/lock-app/infineon/psoc6/src/LockManager.cpp @@ -649,6 +649,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 43d0b253a9d1c5..6711806aa657cf 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -1678,6 +1678,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -1692,6 +1693,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -1783,6 +1785,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -1971,6 +1974,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { diff --git a/examples/lock-app/lock-common/src/LockEndpoint.cpp b/examples/lock-app/lock-common/src/LockEndpoint.cpp index db1fde79b9b4dc..eaa24aa1d6f07a 100644 --- a/examples/lock-app/lock-common/src/LockEndpoint.cpp +++ b/examples/lock-app/lock-common/src/LockEndpoint.cpp @@ -547,6 +547,8 @@ const char * LockEndpoint::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index cbe34d3abc1db1..a68dac1f00fab9 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -981,6 +981,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -995,6 +996,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -1086,6 +1088,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -1274,6 +1277,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 51ec266cee8595..9bad58cf0a9894 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -1290,6 +1290,7 @@ server cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -1304,6 +1305,7 @@ server cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -1395,6 +1397,7 @@ server cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -1583,6 +1586,7 @@ server cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { diff --git a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp b/examples/lock-app/silabs/SiWx917/src/LockManager.cpp index b9a8f9db2f515c..c1a5b2ae627067 100644 --- a/examples/lock-app/silabs/SiWx917/src/LockManager.cpp +++ b/examples/lock-app/silabs/SiWx917/src/LockManager.cpp @@ -650,6 +650,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/lock-app/silabs/efr32/src/LockManager.cpp b/examples/lock-app/silabs/efr32/src/LockManager.cpp index c0f0797e7e6eed..b66fca8ec874e6 100644 --- a/examples/lock-app/silabs/efr32/src/LockManager.cpp +++ b/examples/lock-app/silabs/efr32/src/LockManager.cpp @@ -650,6 +650,8 @@ const char * LockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/examples/platform/esp32/lock/BoltLockManager.cpp b/examples/platform/esp32/lock/BoltLockManager.cpp index dd9b1df2ac08b0..262a5991ff0be9 100644 --- a/examples/platform/esp32/lock/BoltLockManager.cpp +++ b/examples/platform/esp32/lock/BoltLockManager.cpp @@ -691,6 +691,8 @@ const char * BoltLockManager::lockStateToString(DlLockState lockState) const return "Locked"; case DlLockState::kUnlocked: return "Unlocked"; + case DlLockState::kUnlatched: + return "Unlatched"; case DlLockState::kUnknownEnumValue: break; } diff --git a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml index 9902fe74d2dd79..b32136aa30394b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/door-lock-cluster.xml @@ -37,6 +37,7 @@ limitations under the License. + true true @@ -57,6 +58,7 @@ limitations under the License. false true true + true + + @@ -531,6 +538,7 @@ limitations under the License. + @@ -594,6 +602,7 @@ limitations under the License. + @@ -610,6 +619,7 @@ limitations under the License. + @@ -758,6 +768,7 @@ limitations under the License. + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 5a960777719c68..b05b5821804791 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3048,6 +3048,7 @@ client cluster DoorLock = 257 { kNotFullyLocked = 0; kLocked = 1; kUnlocked = 2; + kUnlatched = 3; } enum DlLockType : ENUM8 { @@ -3062,6 +3063,7 @@ client cluster DoorLock = 257 { kInterconnectedLock = 8; kDeadLatch = 9; kDoorFurniture = 10; + kEurocylinder = 11; } enum DlStatus : ENUM8 { @@ -3153,6 +3155,7 @@ client cluster DoorLock = 257 { kUnlock = 1; kNonAccessUserEvent = 2; kForcedUserEvent = 3; + kUnlatch = 4; } enum OperatingModeEnum : ENUM8 { @@ -3341,6 +3344,7 @@ client cluster DoorLock = 257 { kNotification = 0x200; kYearDayAccessSchedules = 0x400; kHolidaySchedules = 0x800; + kUnbolt = 0x1000; } struct CredentialStruct { @@ -3582,6 +3586,10 @@ client cluster DoorLock = 257 { nullable CredentialStruct credential = 0; } + request struct UnboltDoorRequest { + optional OCTET_STRING PINCode = 0; + } + /** This command causes the lock device to lock the door. */ timed command LockDoor(LockDoorRequest): DefaultSuccess = 0; /** This command causes the lock device to unlock the door. */ @@ -3618,6 +3626,8 @@ client cluster DoorLock = 257 { command access(invoke: administer) GetCredentialStatus(GetCredentialStatusRequest): GetCredentialStatusResponse = 36; /** Clear one, one type, or all credentials except ProgrammingPIN credential. */ timed command access(invoke: administer) ClearCredential(ClearCredentialRequest): DefaultSuccess = 38; + /** This command causes the lock device to unlock the door without pulling the latch. */ + timed command UnboltDoor(UnboltDoorRequest): DefaultSuccess = 39; } /** Provides an interface for controlling and adjusting automatic window coverings. */ diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index d1d1fd36d0450b..dbcc7d61ff8e64 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18194,11 +18194,12 @@ class DlLockState(MatterIntEnum): kNotFullyLocked = 0x00 kLocked = 0x01 kUnlocked = 0x02 + kUnlatched = 0x03 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 4, class DlLockType(MatterIntEnum): kDeadBolt = 0x00 @@ -18212,11 +18213,12 @@ class DlLockType(MatterIntEnum): kInterconnectedLock = 0x08 kDeadLatch = 0x09 kDoorFurniture = 0x0A + kEurocylinder = 0x0B # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 11, + kUnknownEnumValue = 12, class DlStatus(MatterIntEnum): kSuccess = 0x00 @@ -18339,11 +18341,12 @@ class LockOperationTypeEnum(MatterIntEnum): kUnlock = 0x01 kNonAccessUserEvent = 0x02 kForcedUserEvent = 0x03 + kUnlatch = 0x04 # All received enum values that are not listed above will be mapped # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 5, class OperatingModeEnum(MatterIntEnum): kNormal = 0x00 @@ -18538,6 +18541,7 @@ class DoorLockFeature(IntFlag): kNotification = 0x200 kYearDayAccessSchedules = 0x400 kHolidaySchedules = 0x800 + kUnbolt = 0x1000 class Structs: @dataclass @@ -19082,6 +19086,26 @@ def must_use_timed_invoke(cls) -> bool: credential: 'typing.Union[Nullable, DoorLock.Structs.CredentialStruct]' = NullValue + @dataclass + class UnboltDoor(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x0101 + command_id: typing.ClassVar[int] = 0x00000027 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="PINCode", Tag=0, Type=typing.Optional[bytes]), + ]) + + @ChipUtility.classproperty + def must_use_timed_invoke(cls) -> bool: + return True + + PINCode: 'typing.Optional[bytes]' = None + class Attributes: @dataclass class LockState(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3280cacba0e578..db1318330a792a 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7562,6 +7562,11 @@ BridgedDeviceBasic: - ProductFinishEnum - ColorEnum + enum values: + # Unlatch was never present for the old operation type enum name. + DoorLock: + DlLockOperationType: + - Unlatch renames: attributes: TimeSynchronization: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index b6701eae3e480b..b91a2a0b8c45fb 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -9291,6 +9291,13 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) */ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)params completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +/** + * Command UnboltDoor + * + * This command causes the lock device to unlock the door without pulling the latch. + */ +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - (void)readAttributeLockStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -22148,6 +22155,7 @@ typedef NS_ENUM(uint8_t, MTRDoorLockDlLockState) { MTRDoorLockDlLockStateNotFullyLocked API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, MTRDoorLockDlLockStateLocked API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x01, MTRDoorLockDlLockStateUnlocked API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x02, + MTRDoorLockDlLockStateUnlatched MTR_NEWLY_AVAILABLE = 0x03, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRDoorLockDlLockType) { @@ -22162,6 +22170,7 @@ typedef NS_ENUM(uint8_t, MTRDoorLockDlLockType) { MTRDoorLockDlLockTypeInterconnectedLock API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x08, MTRDoorLockDlLockTypeDeadLatch API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x09, MTRDoorLockDlLockTypeDoorFurniture API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x0A, + MTRDoorLockDlLockTypeEurocylinder MTR_NEWLY_AVAILABLE = 0x0B, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRDoorLockDlStatus) { @@ -22345,6 +22354,7 @@ typedef NS_ENUM(uint8_t, MTRDoorLockLockOperationType) { MTRDoorLockLockOperationTypeUnlock API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, MTRDoorLockLockOperationTypeNonAccessUserEvent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x02, MTRDoorLockLockOperationTypeForcedUserEvent API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x03, + MTRDoorLockLockOperationTypeUnlatch MTR_NEWLY_AVAILABLE = 0x04, } API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); typedef NS_ENUM(uint8_t, MTRDoorLockDlLockOperationType) { @@ -22739,6 +22749,7 @@ typedef NS_OPTIONS(uint32_t, MTRDoorLockFeature) { macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x400, MTRDoorLockFeatureHolidaySchedules API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x800, + MTRDoorLockFeatureUnbolt MTR_NEWLY_AVAILABLE = 0x1000, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_ENUM(uint8_t, MTRWindowCoveringEndProductType) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 69ec342a1f9180..4c84bb38308eea 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -52794,6 +52794,50 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par std::move(*bridge).DispatchAction(self.device); } +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + DoorLock::Commands::UnboltDoor::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + if (params != nil) { + if (params.pinCode != nil) { + auto & definedValue_0 = request.PINCode.Emplace(); + definedValue_0 = [self asByteSpan:params.pinCode]; + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self->_endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + - (void)readAttributeLockStateWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; @@ -55425,6 +55469,11 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par { [self clearCredentialWithParams:params completion:completionHandler]; } +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params + completionHandler:(MTRStatusCompletion)completionHandler +{ + [self unboltDoorWithParams:params completion:completionHandler]; +} - (void)readAttributeLockStateWithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index cb390c88dc7b25..09180049b086b2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -9125,6 +9125,7 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { = 0x00000025, MTRCommandIDTypeClusterDoorLockCommandClearCredentialID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000026, + MTRCommandIDTypeClusterDoorLockCommandUnboltDoorID MTR_NEWLY_AVAILABLE = 0x00000027, // Cluster WindowCovering deprecated command id names MTRClusterWindowCoveringCommandUpOrOpenID MTR_DEPRECATED("Please use MTRCommandIDTypeClusterWindowCoveringCommandUpOrOpenID", diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index ece7422921c04a..27597e8cc9d632 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -3355,6 +3355,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_NEWLY_AVAILABLE; - (NSDictionary *)readAttributeLockStateWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 6bb2a75441c7d4..ef4792e1b86a0a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -16095,6 +16095,82 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par } } +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = + [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, _endpoint, + (unsigned int) MTRClusterIDTypeDoorLockID, (unsigned int) MTRCommandIDTypeClusterDoorLockCommandUnboltDoorID]; + // Make a copy of params before we go async. + params = [params copy]; + NSNumber * timedInvokeTimeoutMsParam = params.timedInvokeTimeoutMs; + if (timedInvokeTimeoutMsParam) { + timedInvokeTimeoutMsParam = MTRClampedNumber(timedInvokeTimeoutMsParam, @(1), @(UINT16_MAX)); + } + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + MTRBaseDevice * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID + controller:self.device.deviceController]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.device.queue, + ^(id _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + DoorLock::Commands::UnboltDoor::Type request; + if (timedInvokeTimeoutMsParam != nil) { + timedInvokeTimeoutMs.SetValue(timedInvokeTimeoutMsParam.unsignedShortValue); + } + if (params != nil) { + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout + = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + if (!timedInvokeTimeoutMs.HasValue()) { + timedInvokeTimeoutMs.SetValue(10000); + } + if (params != nil) { + if (params.pinCode != nil) { + auto & definedValue_0 = request.PINCode.Emplace(); + definedValue_0 = [self asByteSpan:params.pinCode]; + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, + self->_endpoint, timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(baseDevice); + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + - (NSDictionary *)readAttributeLockStateWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:@(_endpoint) @@ -16999,6 +17075,16 @@ - (void)clearCredentialWithParams:(MTRDoorLockClusterClearCredentialParams *)par expectedValueInterval:expectedValueIntervalMs completion:completionHandler]; } +- (void)unboltDoorWithParams:(MTRDoorLockClusterUnboltDoorParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completionHandler:(MTRStatusCompletion)completionHandler +{ + [self unboltDoorWithParams:params + expectedValues:expectedDataValueDictionaries + expectedValueInterval:expectedValueIntervalMs + completion:completionHandler]; +} @end @implementation MTRClusterWindowCovering diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 72c27e3beb05ab..56915dd4293c74 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -5304,6 +5304,36 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; @end +MTR_NEWLY_AVAILABLE +@interface MTRDoorLockClusterUnboltDoorParams : NSObject + +@property (nonatomic, copy) NSData * _Nullable pinCode MTR_NEWLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRWindowCoveringClusterUpOrOpenParams : NSObject /** diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index a835915630ae25..9e7af8854b0c15 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -8251,6 +8251,37 @@ - (NSString *)description return descriptionString; } +@end +@implementation MTRDoorLockClusterUnboltDoorParams +- (instancetype)init +{ + if (self = [super init]) { + + _pinCode = nil; + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRDoorLockClusterUnboltDoorParams alloc] init]; + + other.pinCode = self.pinCode; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString + stringWithFormat:@"<%@: pinCode:%@; >", NSStringFromClass([self class]), [_pinCode base64EncodedStringWithOptions:0]]; + return descriptionString; +} + @end @implementation MTRWindowCoveringClusterUpOrOpenParams - (instancetype)init diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 48fd55330a58fb..087234106a8474 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -7944,6 +7944,12 @@ bool emberAfDoorLockClusterGetCredentialStatusCallback( bool emberAfDoorLockClusterClearCredentialCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::DoorLock::Commands::ClearCredential::DecodableType & commandData); +/** + * @brief Door Lock Cluster UnboltDoor Command callback (from client) + */ +bool emberAfDoorLockClusterUnboltDoorCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::DoorLock::Commands::UnboltDoor::DecodableType & commandData); /** * @brief Window Covering Cluster UpOrOpen Command callback (from client) */ 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 36b1dba039ef38..0c719c6b360e1c 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 @@ -1682,9 +1682,10 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::DlLockState v case EnumType::kNotFullyLocked: case EnumType::kLocked: case EnumType::kUnlocked: + case EnumType::kUnlatched: return val; default: - return static_cast(3); + return static_cast(4); } } static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::DlLockType val) @@ -1703,9 +1704,10 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::DlLockType va case EnumType::kInterconnectedLock: case EnumType::kDeadLatch: case EnumType::kDoorFurniture: + case EnumType::kEurocylinder: return val; default: - return static_cast(11); + return static_cast(12); } } static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::DlStatus val) @@ -1857,9 +1859,10 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::LockOperation case EnumType::kUnlock: case EnumType::kNonAccessUserEvent: case EnumType::kForcedUserEvent: + case EnumType::kUnlatch: return val; default: - return static_cast(4); + return static_cast(5); } } static auto __attribute__((unused)) EnsureKnownEnumValue(DoorLock::OperatingModeEnum val) 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 f84c4635d79d1a..246b5a69dbff80 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 @@ -2021,11 +2021,12 @@ enum class DlLockState : uint8_t kNotFullyLocked = 0x00, kLocked = 0x01, kUnlocked = 0x02, + kUnlatched = 0x03, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 3, + kUnknownEnumValue = 4, }; // Enum for DlLockType @@ -2042,11 +2043,12 @@ enum class DlLockType : uint8_t kInterconnectedLock = 0x08, kDeadLatch = 0x09, kDoorFurniture = 0x0A, + kEurocylinder = 0x0B, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 11, + kUnknownEnumValue = 12, }; // Enum for DlStatus @@ -2196,11 +2198,12 @@ enum class LockOperationTypeEnum : uint8_t kUnlock = 0x01, kNonAccessUserEvent = 0x02, kForcedUserEvent = 0x03, + kUnlatch = 0x04, // All received enum values that are not listed above will be mapped // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 4, + kUnknownEnumValue = 5, }; // Enum for OperatingModeEnum @@ -2454,6 +2457,7 @@ enum class DoorLockFeature : uint32_t kNotification = 0x200, kYearDayAccessSchedules = 0x400, kHolidaySchedules = 0x800, + kUnbolt = 0x1000, }; } // namespace DoorLock diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 75506b25fbd873..04d41b66fcd63e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -13642,6 +13642,43 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) return CHIP_NO_ERROR; } } // namespace ClearCredential. +namespace UnboltDoor { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kPINCode), PINCode)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kPINCode): + ReturnErrorOnFailure(DataModel::Decode(reader, PINCode)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace UnboltDoor. } // namespace Commands namespace Attributes { @@ -23080,6 +23117,7 @@ bool CommandNeedsTimedInvoke(ClusterId aCluster, CommandId aCommand) case Clusters::DoorLock::Commands::ClearUser::Id: case Clusters::DoorLock::Commands::SetCredential::Id: case Clusters::DoorLock::Commands::ClearCredential::Id: + case Clusters::DoorLock::Commands::UnboltDoor::Id: return true; default: return false; 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 4549b4ff4b6873..627433159099d5 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 @@ -16263,6 +16263,11 @@ struct Type; struct DecodableType; } // namespace ClearCredential +namespace UnboltDoor { +struct Type; +struct DecodableType; +} // namespace UnboltDoor + } // namespace Commands namespace Commands { @@ -17208,6 +17213,38 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ClearCredential +namespace UnboltDoor { +enum class Fields : uint8_t +{ + kPINCode = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::UnboltDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } + + Optional PINCode; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return true; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::UnboltDoor::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } + + Optional PINCode; + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace UnboltDoor } // namespace Commands namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index db687d7b7f512f..1d97415c764c37 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -860,6 +860,10 @@ namespace ClearCredential { static constexpr CommandId Id = 0x00000026; } // namespace ClearCredential +namespace UnboltDoor { +static constexpr CommandId Id = 0x00000027; +} // namespace UnboltDoor + } // namespace Commands } // namespace DoorLock diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index d8513c0fbb762d..f6f8372534ef24 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -4687,6 +4687,7 @@ class TonerCartridgeMonitoringResetCondition : public ClusterCommand | * SetCredential | 0x22 | | * GetCredentialStatus | 0x24 | | * ClearCredential | 0x26 | +| * UnboltDoor | 0x27 | |------------------------------------------------------------------------------| | Attributes: | | | * LockState | 0x0000 | @@ -5325,6 +5326,36 @@ class DoorLockClearCredential : public ClusterCommand mComplex_Credential; }; +/* + * Command UnboltDoor + */ +class DoorLockUnboltDoor : public ClusterCommand +{ +public: + DoorLockUnboltDoor(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("unbolt-door", credsIssuerConfig) + { + AddArgument("PINCode", &mRequest.PINCode); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000027) on endpoint %u", endpointIds.at(0)); + + return ClusterCommand::SendCommand(device, endpointIds.at(0), 0x00000101, 0x00000027, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000027) on Group %u", groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, 0x00000101, 0x00000027, mRequest); + } + +private: + chip::app::Clusters::DoorLock::Commands::UnboltDoor::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster WindowCovering | 0x0102 | |------------------------------------------------------------------------------| @@ -13744,6 +13775,7 @@ void registerClusterDoorLock(Commands & commands, CredentialIssuerCommands * cre make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 25faa4cbe1a955..7fa5e6a3d30808 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -46737,6 +46737,7 @@ class SubscribeAttributeTonerCartridgeMonitoringClusterRevision : public Subscri | * SetCredential | 0x22 | | * GetCredentialStatus | 0x24 | | * ClearCredential | 0x26 | +| * UnboltDoor | 0x27 | |------------------------------------------------------------------------------| | Attributes: | | | * LockState | 0x0000 | @@ -47715,6 +47716,54 @@ class DoorLockClearCredential : public ClusterCommand { mComplex_Credential; }; +/* + * Command UnboltDoor + */ +class DoorLockUnboltDoor : public ClusterCommand { +public: + DoorLockUnboltDoor() + : ClusterCommand("unbolt-door") + { + AddArgument("PINCode", &mRequest.PINCode); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x00000101) command (0x00000027) on endpoint %u", endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRDoorLockClusterUnboltDoorParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + if (mRequest.PINCode.HasValue()) { + params.pinCode = [NSData dataWithBytes:mRequest.PINCode.Value().data() length:mRequest.PINCode.Value().size()]; + } else { + params.pinCode = nil; + } + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster unboltDoorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::DoorLock::Commands::UnboltDoor::Type mRequest; +}; + /* * Attribute LockState */ @@ -108484,6 +108533,7 @@ void registerClusterDoorLock(Commands & commands) make_unique(), // make_unique(), // make_unique(), // + make_unique(), // make_unique(Id), // make_unique(), // make_unique(Id), // From 7d47ed687e3f5715d1d6d347218605d7aaa2a024 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 15:39:47 -0400 Subject: [PATCH 09/12] Improve handling of single structs associated with many clusters. (#26495) Instead of having a single set of types under "namespace detail" plus namespace aliases, have actual distinct types in the distinct cluster namespaces, with a common super-class in the detail namespace to improve code sharing. This still leaves the fields enums as an alias of the detail bits, but people are unlikely to be dispatching to overloads on the type of that fields enum. --- .../templates/ComplexArgumentParser-src.zapt | 8 - .../templates/ComplexArgumentParser.zapt | 8 - .../logging/DataModelLogger-src.zapt | 8 - .../templates/logging/DataModelLogger.zapt | 8 - .../templates/app/cluster-objects.zapt | 19 +- .../zap-generated/cluster-objects.h | 52 ++++- .../cluster/ComplexArgumentParser.cpp | 182 ++++++++++++------ .../cluster/ComplexArgumentParser.h | 29 ++- .../cluster/logging/DataModelLogger.cpp | 151 ++++++++++----- .../cluster/logging/DataModelLogger.h | 18 +- 10 files changed, 321 insertions(+), 162 deletions(-) diff --git a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt index f9b0f4bef764c5..1726283f2ef9b7 100644 --- a/examples/chip-tool/templates/ComplexArgumentParser-src.zapt +++ b/examples/chip-tool/templates/ComplexArgumentParser-src.zapt @@ -2,16 +2,8 @@ #include -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{> struct_parser_impl namespace="detail"}} -{{/if}} -{{/zcl_structs}} - {{#zcl_clusters}} {{#zcl_structs}} -{{#unless has_more_than_one_cluster}} {{> struct_parser_impl namespace=(as_camel_cased ../name false)}} -{{/unless}} {{/zcl_structs}} {{/zcl_clusters}} diff --git a/examples/chip-tool/templates/ComplexArgumentParser.zapt b/examples/chip-tool/templates/ComplexArgumentParser.zapt index 7364b243188333..82f6ebfe152c57 100644 --- a/examples/chip-tool/templates/ComplexArgumentParser.zapt +++ b/examples/chip-tool/templates/ComplexArgumentParser.zapt @@ -5,16 +5,8 @@ #include #include -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{> struct_parser_decl namespace="detail"}} -{{/if}} -{{/zcl_structs}} - {{#zcl_clusters}} {{#zcl_structs}} -{{#unless has_more_than_one_cluster}} {{> struct_parser_decl namespace=(as_camel_cased ../name false)}} -{{/unless}} {{/zcl_structs}} {{/zcl_clusters}} diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index 167021f49577d2..5a918bdd5f13cb 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -4,17 +4,9 @@ using namespace chip::app::Clusters; -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{> struct_logger_impl namespace="detail"}} -{{/if}} -{{/zcl_structs}} - {{#zcl_clusters}} {{#zcl_structs}} -{{#unless has_more_than_one_cluster}} {{> struct_logger_impl namespace=(as_camel_cased ../name false)}} -{{/unless}} {{/zcl_structs}} {{/zcl_clusters}} diff --git a/examples/chip-tool/templates/logging/DataModelLogger.zapt b/examples/chip-tool/templates/logging/DataModelLogger.zapt index befe9d4210ce07..1dec72eb32520d 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger.zapt @@ -3,17 +3,9 @@ #include #include -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{> struct_logger_decl namespace="detail"}} -{{/if}} -{{/zcl_structs}} - {{#zcl_clusters}} {{#zcl_structs}} -{{#unless has_more_than_one_cluster}} {{> struct_logger_decl namespace=(as_camel_cased ../name false)}} -{{/unless}} {{/zcl_structs}} {{/zcl_clusters}} diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index 0ed26f740fa34d..e8ffcc3b9bc2a7 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -54,7 +54,24 @@ namespace {{asUpperCamelCase name}} { namespace Structs { {{/first}} {{#if has_more_than_one_cluster}} -namespace {{asUpperCamelCase name}} = Clusters::detail::Structs::{{asUpperCamelCase name}}; +namespace {{asUpperCamelCase name}} { + +using Fields = Clusters::detail::Structs::{{asUpperCamelCase name}}::Fields; + +struct Type : public Clusters::detail::Structs::{{asUpperCamelCase name}}::Type +{ +}; + +{{#if struct_contains_array}} +struct DecodableType : public Clusters::detail::Structs::{{asUpperCamelCase name}}::DecodableType +{ +}; +{{else}} +using DecodableType = Type; +{{/if}} + +} // namespace {{asUpperCamelCase name}} + {{else}} {{> cluster_objects_struct header=true}} {{/if}} 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 627433159099d5..703cec6ef621c1 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 @@ -13175,7 +13175,18 @@ struct TypeInfo } // namespace GroupKeyManagement namespace FixedLabel { namespace Structs { -namespace LabelStruct = Clusters::detail::Structs::LabelStruct; +namespace LabelStruct { + +using Fields = Clusters::detail::Structs::LabelStruct::Fields; + +struct Type : public Clusters::detail::Structs::LabelStruct::Type +{ +}; + +using DecodableType = Type; + +} // namespace LabelStruct + } // namespace Structs namespace Attributes { @@ -13251,7 +13262,18 @@ struct TypeInfo } // namespace FixedLabel namespace UserLabel { namespace Structs { -namespace LabelStruct = Clusters::detail::Structs::LabelStruct; +namespace LabelStruct { + +using Fields = Clusters::detail::Structs::LabelStruct::Fields; + +struct Type : public Clusters::detail::Structs::LabelStruct::Type +{ +}; + +using DecodableType = Type; + +} // namespace LabelStruct + } // namespace Structs namespace Attributes { @@ -26006,7 +26028,18 @@ struct TypeInfo } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct; +namespace ApplicationStruct { + +using Fields = Clusters::detail::Structs::ApplicationStruct::Fields; + +struct Type : public Clusters::detail::Structs::ApplicationStruct::Type +{ +}; + +using DecodableType = Type; + +} // namespace ApplicationStruct + namespace ApplicationEPStruct { enum class Fields : uint8_t { @@ -26281,7 +26314,18 @@ struct TypeInfo } // namespace ApplicationLauncher namespace ApplicationBasic { namespace Structs { -namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct; +namespace ApplicationStruct { + +using Fields = Clusters::detail::Structs::ApplicationStruct::Fields; + +struct Type : public Clusters::detail::Structs::ApplicationStruct::Type +{ +}; + +using DecodableType = Type; + +} // namespace ApplicationStruct + } // namespace Structs namespace Attributes { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 57b7ee1203a6f8..5c53b15986c458 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -19,66 +19,6 @@ #include -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID", - value.isMember("catalogVendorID"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID", - value.isMember("applicationID"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"])); - valueCopy.removeMember("catalogVendorID"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"])); - valueCopy.removeMember("applicationID"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.catalogVendorID); - ComplexArgumentParser::Finalize(request.applicationID); -} - -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - // Copy to track which members we already processed. - Json::Value valueCopy(value); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); - valueCopy.removeMember("label"); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); - valueCopy.removeMember("value"); - - return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request) -{ - ComplexArgumentParser::Finalize(request.label); - ComplexArgumentParser::Finalize(request.value); -} - CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value) @@ -1766,6 +1706,64 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::GroupKeyManagement::St ComplexArgumentParser::Finalize(request.epochStartTime2); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); + valueCopy.removeMember("label"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); + valueCopy.removeMember("value"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.label); + ComplexArgumentParser::Finalize(request.value); +} + +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.label", "label", value.isMember("label"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("LabelStruct.value", "value", value.isMember("value"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "label"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.label, value["label"])); + valueCopy.removeMember("label"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "value"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.value, value["value"])); + valueCopy.removeMember("value"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.label); + ComplexArgumentParser::Finalize(request.value); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request, Json::Value & value) @@ -2434,6 +2432,38 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::AudioOutput::Structs:: ComplexArgumentParser::Finalize(request.name); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID", + value.isMember("catalogVendorID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID", + value.isMember("applicationID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"])); + valueCopy.removeMember("catalogVendorID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"])); + valueCopy.removeMember("applicationID"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.catalogVendorID); + ComplexArgumentParser::Finalize(request.applicationID); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, Json::Value & value) @@ -2467,6 +2497,38 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::S ComplexArgumentParser::Finalize(request.endpoint); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.catalogVendorID", "catalogVendorID", + value.isMember("catalogVendorID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationStruct.applicationID", "applicationID", + value.isMember("applicationID"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorID, value["catalogVendorID"])); + valueCopy.removeMember("catalogVendorID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationID, value["applicationID"])); + valueCopy.removeMember("applicationID"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.catalogVendorID); + ComplexArgumentParser::Finalize(request.applicationID); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index 6d5368acc56cfa..9336e56a89d5e9 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -22,15 +22,6 @@ #include #include -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request); - -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::LabelStruct::Type & request, Json::Value & value); - -static void Finalize(chip::app::Clusters::detail::Structs::LabelStruct::Type & request); - static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); @@ -216,6 +207,16 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::GroupKeyManagem static void Finalize(chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::FixedLabel::Structs::LabelStruct::Type & request); + +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::UserLabel::Structs::LabelStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::Type & request, Json::Value & value); @@ -303,11 +304,21 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::AudioOutput::St static void Finalize(chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::UnitTesting::Structs::SimpleStruct::Type & request, Json::Value & value); 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 596663cfbc6c31..57fcae98c7fddd 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -21,56 +21,6 @@ using namespace chip::app::Clusters; -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("Label", indent + 1, value.label); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("Value", indent + 1, value.value); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value) { @@ -1609,6 +1559,56 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Label", indent + 1, value.label); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Value", indent + 1, value.value); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::UserLabel::Structs::LabelStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("Label", indent + 1, value.label); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Label'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Value", indent + 1, value.value); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Value'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value) @@ -2185,6 +2185,32 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR +DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value) @@ -2211,6 +2237,31 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("CatalogVendorID", indent + 1, value.catalogVendorID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("ApplicationID", indent + 1, value.applicationID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationID'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 4ca2cb87965695..7d96f2afdd379c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -20,12 +20,6 @@ #include #include -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value); - -static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::detail::Structs::LabelStruct::DecodableType & value); - static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); @@ -137,6 +131,12 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::GroupKeyManagement::Structs::GroupKeySetStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::FixedLabel::Structs::LabelStruct::DecodableType & value); + +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::UserLabel::Structs::LabelStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::IcdManagement::Structs::MonitoringRegistrationStruct::DecodableType & value); @@ -188,9 +188,15 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::AudioOutput::Structs::OutputInfoStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Structs::SimpleStruct::DecodableType & value); From c2e12e62a9e9fd1b7089fdc36142e23e54e98b12 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 18:00:59 -0400 Subject: [PATCH 10/12] Remove no-longer-needed Darwin removal annotations. (#26636) * Remove no-longer-needed Darwin removal annotations. Now that isSupported returns false for things that are introduced after a container's deprecation, a bunch of removal annotations are no longer needed. Also: * Adds the missing deprecation for BridgedDeviceBasic. * Adds linux-arm64 ZAP now that it's available. * Update configure script to new ZAP url format. * Fix zap_download.py for new naming scheme as well. --- .../docker/images/chip-cert-bins/Dockerfile | 2 +- scripts/configure | 9 ++- scripts/setup/zap.json | 3 +- scripts/setup/zap.version | 2 +- scripts/tools/zap/zap_download.py | 10 ++- scripts/tools/zap/zap_execution.py | 2 +- .../CHIP/templates/availability.yaml | 67 +++---------------- .../CHIP/zap-generated/MTRBaseClusters.h | 1 + .../CHIP/zap-generated/MTRClusters.h | 1 + .../CHIP/zap-generated/MTRStructsObjc.h | 4 ++ 10 files changed, 35 insertions(+), 66 deletions(-) diff --git a/integrations/docker/images/chip-cert-bins/Dockerfile b/integrations/docker/images/chip-cert-bins/Dockerfile index d1d4992522daf5..51f1bfcf8252b9 100644 --- a/integrations/docker/images/chip-cert-bins/Dockerfile +++ b/integrations/docker/images/chip-cert-bins/Dockerfile @@ -7,7 +7,7 @@ ARG COMMITHASH=7b99e6399c6069037c613782d78132c69b9dcabb # ZAP Development install, so that it runs on both x64 and arm64 # Generally this should match with the ZAP version that is used for codegen within the # specified SHA -ARG ZAP_VERSION=v2023.04.27-nightly +ARG ZAP_VERSION=v2023.05.16-nightly # Ensure TARGETPLATFORM is set RUN case ${TARGETPLATFORM} in \ diff --git a/scripts/configure b/scripts/configure index da5b1852086dbd..d48971862e2943 100755 --- a/scripts/configure +++ b/scripts/configure @@ -254,14 +254,19 @@ function finalize_build_env() { } function download_zap() { - local version platform + local version platform arch read -r version <"${CHIP_ROOT}/scripts/setup/zap.version" case "$OSTYPE" in linux*) platform=linux ;; darwin*) platform=mac ;; *) fail "Unable to determine zap platform for OSTYPE='$OSTYPE'" ;; esac - local url="https://github.com/project-chip/zap/releases/download/${version}/zap-${platform}.zip" + case "$(uname -m)" in + arm64) arch=arm64 ;; + x86_64) arch=x64 ;; + *) fail "Unable to determine zap architecture for 'uname -m'='$(uname -m)'" ;; + esac + local url="https://github.com/project-chip/zap/releases/download/${version}/zap-${platform}-${arch}.zip" progress "Installing zap-cli from $url" call_impl download_and_extract_zip "$url" "${BUILD_ENV_PATH}/bin" zap-cli diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 5877f6395570e0..0b24ea7deff214 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -4,11 +4,12 @@ "path": "fuchsia/third_party/zap/${platform}", "platforms": [ "linux-amd64", + "linux-arm64", "mac-amd64", "mac-arm64", "windows-amd64" ], - "tags": ["version:2@v2023.04.27-nightly.1"] + "tags": ["version:2@v2023.05.16-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 70fb1c57a67ad8..7482c5f526c684 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.04.27-nightly +v2023.05.16-nightly diff --git a/scripts/tools/zap/zap_download.py b/scripts/tools/zap/zap_download.py index 1418133f8df4bd..4e814c6f1fcffb 100755 --- a/scripts/tools/zap/zap_download.py +++ b/scripts/tools/zap/zap_download.py @@ -110,7 +110,15 @@ def _SetupReleaseZap(install_directory: str, zap_version: str): else: raise Exception('Unknown platform - do not know what zip file to download.') - url = f"https://github.com/project-chip/zap/releases/download/{zap_version}/zap-{zap_platform}.zip" + arch = os.uname().machine + if arch == 'arm64': + zap_arch = 'arm64' + elif arch == 'x86_64': + zap_arch = 'x64' + else: + raise Exception(f'Unknown architecture "${arch}" - do not know what zip file to download.') + + url = f"https://github.com/project-chip/zap/releases/download/{zap_version}/zap-{zap_platform}-{zap_arch}.zip" logging.info("Fetching: %s", url) diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 7ada169c086eb4..116ed9c9ad4bb4 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.4.27' +MIN_ZAP_VERSION = '2023.5.16' class ZapTool: diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index db1318330a792a..5df588849e394f 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -6174,19 +6174,7 @@ enum values: EthernetNetworkDiagnostics: # Both the enum and the values got renamed, so don't output the - # new values with the old enum name or the old values with the - # new enum name. - PHYRateType: - - Rate10M - - Rate100M - - Rate1G - - Rate25G - - Rate5G - - Rate10G - - Rate40G - - Rate100G - - Rate200G - - Rate400G + # old values with the new enum name. PHYRateEnum: - 10M - 100M @@ -6199,19 +6187,13 @@ - 200G - 400G OperationalCredentials: - # Both the enum and the values got renamed, so don't output the - # new value with the old enum name or the old value with the - # new enum name. + # Both the enum and the value got renamed, so don't output the + # old value with the new enum name. NodeOperationalCertStatusEnum: - SUCCESS - OperationalCertStatus: - - OK DoorLock: # Both the enum and the values got renamed, so don't output the - # new values with the old enum name or the old values with the - # new enum name. - DlCredentialRule: - - Dual + # old value with the new enum name. CredentialRuleEnum: - Double renames: @@ -6976,14 +6958,6 @@ - EventList FaultInjection: - EventList - removed: - enum values: - DoorLock: - DlLockDataType: - # These values never existed for this enum name so, don't - # start exposing them. They're exposed for LockDataTypeEnum - - FingerVein - - Face renames: attributes: TimeSynchronization: @@ -7531,6 +7505,10 @@ - DefaultNTP - NTPServerAvailable deprecated: + clusters: + # We apparently forgot to deprecate BridgedDeviceBasic when we + # introduced BridgedDeviceBasicInformation. + - BridgedDeviceBasic bitmaps: Groups: - GroupClusterFeature @@ -7538,35 +7516,6 @@ - PressureFeature PumpConfigurationAndControl: - PumpFeature - removed: - attributes: - # The ProductAppearance bits never happened for the old Basic and - # BridgedDeviceBasic cluster names. - Basic: - - ProductAppearance - BridgedDeviceBasic: - - ProductAppearance - structs: - # The ProductAppearance bits never happened for the old Basic and - # BridgedDeviceBasic cluster names. - Basic: - - ProductAppearanceStruct - BridgedDeviceBasic: - - ProductAppearanceStruct - enums: - # The ProductAppearance bits never happened for the old Basic and - # BridgedDeviceBasic cluster names. - Basic: - - ProductFinishEnum - - ColorEnum - BridgedDeviceBasic: - - ProductFinishEnum - - ColorEnum - enum values: - # Unlatch was never present for the old operation type enum name. - DoorLock: - DlLockOperationType: - - Unlatch renames: attributes: TimeSynchronization: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index b91a2a0b8c45fb..4cd60c44d3cd15 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -20520,6 +20520,7 @@ MTR_DEPRECATED( @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRBaseClusterBridgedDeviceBasicInformation") @interface MTRBaseClusterBridgedDeviceBasic : MTRBaseClusterBridgedDeviceBasicInformation @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 27597e8cc9d632..c76c2ee18d734c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -7666,6 +7666,7 @@ MTR_DEPRECATED( @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRClusterBridgedDeviceBasicInformation") @interface MTRClusterBridgedDeviceBasic : MTRClusterBridgedDeviceBasicInformation @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 77be660c039fb5..e03820f9925bc1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -513,6 +513,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRBridgedDeviceBasicInformationClusterStartUpEvent") @interface MTRBridgedDeviceBasicClusterStartUpEvent : MTRBridgedDeviceBasicInformationClusterStartUpEvent @end @@ -521,6 +522,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRBridgedDeviceBasicInformationClusterShutDownEvent") @interface MTRBridgedDeviceBasicClusterShutDownEvent : MTRBridgedDeviceBasicInformationClusterShutDownEvent @end @@ -529,6 +531,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRBridgedDeviceBasicInformationClusterLeaveEvent") @interface MTRBridgedDeviceBasicClusterLeaveEvent : MTRBridgedDeviceBasicInformationClusterLeaveEvent @end @@ -538,6 +541,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) +MTR_NEWLY_DEPRECATED("Please use MTRBridgedDeviceBasicInformationClusterReachableChangedEvent") @interface MTRBridgedDeviceBasicClusterReachableChangedEvent : MTRBridgedDeviceBasicInformationClusterReachableChangedEvent @end From 935538c2f98c647f24e4024a78dc8d98173746c3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 17 May 2023 18:10:59 -0400 Subject: [PATCH 11/12] Remove includes of CHIPClusters.h in Darwin code. (#26635) Darwin bits don't use CHIPClusters at all anymore. --- .../Framework/CHIP/MTRCluster_Internal.h | 1 - .../CHIP/templates/MTRBaseClusters-src.zapt | 4 +- .../templates/MTRBaseClusters_Internal.zapt | 2 - .../CHIP/templates/MTRClusters_Internal.zapt | 2 - .../CHIP/zap-generated/MTRBaseClusters.mm | 452 +++++++++--------- .../zap-generated/MTRBaseClusters_Internal.h | 2 - .../CHIP/zap-generated/MTRClusters_Internal.h | 2 - 7 files changed, 230 insertions(+), 235 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRCluster_Internal.h b/src/darwin/Framework/CHIP/MTRCluster_Internal.h index 5683ca717fea57..077628fd118a09 100644 --- a/src/darwin/Framework/CHIP/MTRCluster_Internal.h +++ b/src/darwin/Framework/CHIP/MTRCluster_Internal.h @@ -21,7 +21,6 @@ #import "MTRBaseDevice_Internal.h" #import "MTRCluster.h" -#import "zap-generated/CHIPClusters.h" #import "zap-generated/MTRBaseClusters.h" #include diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt index db2bc872960c86..6ff3a05793ee17 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters-src.zapt @@ -12,8 +12,10 @@ #import "MTRDevice_Internal.h" #import "MTRStructsObjc.h" +#include #include #include + #include using chip::Callback::Callback; @@ -194,7 +196,7 @@ MTR{{cluster}}Cluster{{command}}Params TypeInfo::Type cppValue; {{>encode_value target="cppValue" source="value" cluster=parent.name errorCode="return CHIP_ERROR_INVALID_ARGUMENT;" depth=0}} - chip::Controller::{{asUpperCamelCase parent.name}}Cluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt index 0a8c82459ec042..73ac0c844c96e7 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters_Internal.zapt @@ -5,8 +5,6 @@ #import "MTRBaseClusters.h" #import "MTRBaseDevice.h" -#include - {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt index 12d6882cd182b4..8af0b89a300cf1 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters_Internal.zapt @@ -6,8 +6,6 @@ #import "MTRDevice.h" #import "MTRDevice_Internal.h" -#include - {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 4c84bb38308eea..e0f40b28570567 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -27,8 +27,10 @@ #import "MTRDevice_Internal.h" #import "MTRStructsObjc.h" +#include #include #include + #include using chip::Callback::Callback; @@ -170,7 +172,7 @@ - (void)writeAttributeIdentifyTimeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::IdentifyCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -3622,7 +3624,7 @@ - (void)writeAttributeOnTimeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -3702,7 +3704,7 @@ - (void)writeAttributeOffWaitTimeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -3787,7 +3789,7 @@ - (void)writeAttributeStartUpOnOffWithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedCharValue); } - chip::Controller::OnOffCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -4662,7 +4664,7 @@ - (void)writeAttributeSwitchActionsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::OnOffSwitchConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6001,7 +6003,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6081,7 +6083,7 @@ - (void)writeAttributeOnOffTransitionTimeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6168,7 +6170,7 @@ - (void)writeAttributeOnLevelWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6253,7 +6255,7 @@ - (void)writeAttributeOnTransitionTimeWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6339,7 +6341,7 @@ - (void)writeAttributeOffTransitionTimeWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6425,7 +6427,7 @@ - (void)writeAttributeDefaultMoveRateWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -6511,7 +6513,7 @@ - (void)writeAttributeStartUpCurrentLevelWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::LevelControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -7780,7 +7782,7 @@ - (void)writeAttributeActiveTextWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -7860,7 +7862,7 @@ - (void)writeAttributeDescriptionWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -7940,7 +7942,7 @@ - (void)writeAttributeInactiveTextWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -8020,7 +8022,7 @@ - (void)writeAttributeOutOfServiceWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -8143,7 +8145,7 @@ - (void)writeAttributePresentValueWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -8223,7 +8225,7 @@ - (void)writeAttributeReliabilityWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::BinaryInputBasicCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -10144,7 +10146,7 @@ - (void)writeAttributeBindingWithValue:(NSArray * _Nonnull)value } } - chip::Controller::BindingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -10841,7 +10843,7 @@ - (void)writeAttributeACLWithValue:(NSArray * _Nonnull)value } } - chip::Controller::AccessControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -10944,7 +10946,7 @@ - (void)writeAttributeExtensionWithValue:(NSArray * _Nonnull)value } } - chip::Controller::AccessControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -13396,7 +13398,7 @@ - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BasicInformationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -13476,7 +13478,7 @@ - (void)writeAttributeLocationWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BasicInformationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -13950,7 +13952,7 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::BasicInformationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -16311,7 +16313,7 @@ - (void)writeAttributeDefaultOTAProvidersWithValue:(NSArray * _Nonnull)value } } - chip::Controller::OtaSoftwareUpdateRequestorCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -17191,7 +17193,7 @@ - (void)writeAttributeActiveLocaleWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::LocalizationConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -17881,7 +17883,7 @@ - (void)writeAttributeHourFormatWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::TimeFormatLocalizationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -17962,7 +17964,7 @@ - (void)writeAttributeActiveCalendarTypeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::TimeFormatLocalizationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -18710,7 +18712,7 @@ - (void)writeAttributeTemperatureUnitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::UnitLocalizationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -23182,7 +23184,7 @@ - (void)writeAttributeBreadcrumbWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::GeneralCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -24628,7 +24630,7 @@ - (void)writeAttributeInterfaceEnabledWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::NetworkCommissioningCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -37610,7 +37612,7 @@ - (void)writeAttributeNodeLabelWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BridgedDeviceBasicInformationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -42564,7 +42566,7 @@ - (void)writeAttributeGroupKeyMapWithValue:(NSArray * _Nonnull)value } } - chip::Controller::GroupKeyManagementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -44034,7 +44036,7 @@ - (void)writeAttributeLabelListWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UserLabelCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -45395,7 +45397,7 @@ - (void)writeAttributeStartUpModeWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ModeSelectCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -45480,7 +45482,7 @@ - (void)writeAttributeOnModeWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ModeSelectCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -53050,7 +53052,7 @@ - (void)writeAttributeDoorOpenEventsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -53130,7 +53132,7 @@ - (void)writeAttributeDoorClosedEventsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -53211,7 +53213,7 @@ - (void)writeAttributeOpenPeriodWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -53843,7 +53845,7 @@ - (void)writeAttributeLanguageWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -53923,7 +53925,7 @@ - (void)writeAttributeLEDSettingsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54003,7 +54005,7 @@ - (void)writeAttributeAutoRelockTimeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54083,7 +54085,7 @@ - (void)writeAttributeSoundVolumeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54163,7 +54165,7 @@ - (void)writeAttributeOperatingModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54337,7 +54339,7 @@ - (void)writeAttributeEnableLocalProgrammingWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54419,7 +54421,7 @@ - (void)writeAttributeEnableOneTouchLockingWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54501,7 +54503,7 @@ - (void)writeAttributeEnableInsideStatusLEDWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54584,7 +54586,7 @@ - (void)writeAttributeEnablePrivacyModeButtonWithValue:(NSNumber * _Nonnull)valu TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54667,7 +54669,7 @@ - (void)writeAttributeLocalProgrammingFeaturesWithValue:(NSNumber * _Nonnull)val TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54749,7 +54751,7 @@ - (void)writeAttributeWrongCodeEntryLimitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54832,7 +54834,7 @@ - (void)writeAttributeUserCodeTemporaryDisableTimeWithValue:(NSNumber * _Nonnull TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54915,7 +54917,7 @@ - (void)writeAttributeSendPINOverTheAirWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -54997,7 +54999,7 @@ - (void)writeAttributeRequirePINforRemoteOperationWithValue:(NSNumber * _Nonnull TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -55080,7 +55082,7 @@ - (void)writeAttributeExpiringUserTimeoutWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::DoorLockCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -58734,7 +58736,7 @@ - (void)writeAttributeModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::WindowCoveringCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60573,7 +60575,7 @@ - (void)writeAttributeBarrierOpenEventsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60654,7 +60656,7 @@ - (void)writeAttributeBarrierCloseEventsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60737,7 +60739,7 @@ - (void)writeAttributeBarrierCommandOpenEventsWithValue:(NSNumber * _Nonnull)val TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60820,7 +60822,7 @@ - (void)writeAttributeBarrierCommandCloseEventsWithValue:(NSNumber * _Nonnull)va TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60902,7 +60904,7 @@ - (void)writeAttributeBarrierOpenPeriodWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -60983,7 +60985,7 @@ - (void)writeAttributeBarrierClosePeriodWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::BarrierControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -62892,7 +62894,7 @@ - (void)writeAttributeLifetimeRunningHoursWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::PumpConfigurationAndControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -63023,7 +63025,7 @@ - (void)writeAttributeLifetimeEnergyConsumedWithValue:(NSNumber * _Nullable)valu nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::PumpConfigurationAndControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -63106,7 +63108,7 @@ - (void)writeAttributeOperationModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::PumpConfigurationAndControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -63187,7 +63189,7 @@ - (void)writeAttributeControlModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::PumpConfigurationAndControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65367,7 +65369,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65450,7 +65452,7 @@ - (void)writeAttributeLocalTemperatureCalibrationWithValue:(NSNumber * _Nonnull) TypeInfo::Type cppValue; cppValue = value.charValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65533,7 +65535,7 @@ - (void)writeAttributeOccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)valu TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65616,7 +65618,7 @@ - (void)writeAttributeOccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)valu TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65699,7 +65701,7 @@ - (void)writeAttributeUnoccupiedCoolingSetpointWithValue:(NSNumber * _Nonnull)va TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65782,7 +65784,7 @@ - (void)writeAttributeUnoccupiedHeatingSetpointWithValue:(NSNumber * _Nonnull)va TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65864,7 +65866,7 @@ - (void)writeAttributeMinHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -65946,7 +65948,7 @@ - (void)writeAttributeMaxHeatSetpointLimitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66028,7 +66030,7 @@ - (void)writeAttributeMinCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66110,7 +66112,7 @@ - (void)writeAttributeMaxCoolSetpointLimitWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66192,7 +66194,7 @@ - (void)writeAttributeMinSetpointDeadBandWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.charValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66274,7 +66276,7 @@ - (void)writeAttributeRemoteSensingWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66356,7 +66358,7 @@ - (void)writeAttributeControlSequenceOfOperationWithValue:(NSNumber * _Nonnull)v TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66438,7 +66440,7 @@ - (void)writeAttributeSystemModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66699,7 +66701,7 @@ - (void)writeAttributeTemperatureSetpointHoldWithValue:(NSNumber * _Nonnull)valu TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66788,7 +66790,7 @@ - (void)writeAttributeTemperatureSetpointHoldDurationWithValue:(NSNumber * _Null nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -66874,7 +66876,7 @@ - (void)writeAttributeThermostatProgrammingOperationModeWithValue:(NSNumber * _N TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67146,7 +67148,7 @@ - (void)writeAttributeOccupiedSetbackWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67322,7 +67324,7 @@ - (void)writeAttributeUnoccupiedSetbackWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67493,7 +67495,7 @@ - (void)writeAttributeEmergencyHeatDeltaWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67575,7 +67577,7 @@ - (void)writeAttributeACTypeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67655,7 +67657,7 @@ - (void)writeAttributeACCapacityWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67735,7 +67737,7 @@ - (void)writeAttributeACRefrigerantTypeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67816,7 +67818,7 @@ - (void)writeAttributeACCompressorTypeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67897,7 +67899,7 @@ - (void)writeAttributeACErrorCodeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -67977,7 +67979,7 @@ - (void)writeAttributeACLouverPositionWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -68102,7 +68104,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71148,7 +71150,7 @@ - (void)writeAttributeFanModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71228,7 +71230,7 @@ - (void)writeAttributeFanModeSequenceWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71314,7 +71316,7 @@ - (void)writeAttributePercentSettingWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71485,7 +71487,7 @@ - (void)writeAttributeSpeedSettingWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71651,7 +71653,7 @@ - (void)writeAttributeRockSettingWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -71774,7 +71776,7 @@ - (void)writeAttributeWindSettingWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::FanControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -72853,7 +72855,7 @@ - (void)writeAttributeTemperatureDisplayModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatUserInterfaceConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -72935,7 +72937,7 @@ - (void)writeAttributeKeypadLockoutWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatUserInterfaceConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -73016,7 +73018,7 @@ - (void)writeAttributeScheduleProgrammingVisibilityWithValue:(NSNumber * _Nonnul TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ThermostatUserInterfaceConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -74892,7 +74894,7 @@ - (void)writeAttributeOptionsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -75796,7 +75798,7 @@ - (void)writeAttributeWhitePointXWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -75876,7 +75878,7 @@ - (void)writeAttributeWhitePointYWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -75956,7 +75958,7 @@ - (void)writeAttributeColorPointRXWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76036,7 +76038,7 @@ - (void)writeAttributeColorPointRYWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76121,7 +76123,7 @@ - (void)writeAttributeColorPointRIntensityWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76203,7 +76205,7 @@ - (void)writeAttributeColorPointGXWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76283,7 +76285,7 @@ - (void)writeAttributeColorPointGYWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76368,7 +76370,7 @@ - (void)writeAttributeColorPointGIntensityWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76450,7 +76452,7 @@ - (void)writeAttributeColorPointBXWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76530,7 +76532,7 @@ - (void)writeAttributeColorPointBYWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -76615,7 +76617,7 @@ - (void)writeAttributeColorPointBIntensityWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -77200,7 +77202,7 @@ - (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(NSNumber * _Nullab nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::ColorControlCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80373,7 +80375,7 @@ - (void)writeAttributeMinLevelWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80453,7 +80455,7 @@ - (void)writeAttributeMaxLevelWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80539,7 +80541,7 @@ - (void)writeAttributeIntrinsicBallastFactorWithValue:(NSNumber * _Nullable)valu nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80627,7 +80629,7 @@ - (void)writeAttributeBallastFactorAdjustmentWithValue:(NSNumber * _Nullable)val nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80752,7 +80754,7 @@ - (void)writeAttributeLampTypeWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80832,7 +80834,7 @@ - (void)writeAttributeLampManufacturerWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -80918,7 +80920,7 @@ - (void)writeAttributeLampRatedHoursWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -81003,7 +81005,7 @@ - (void)writeAttributeLampBurnHoursWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -81083,7 +81085,7 @@ - (void)writeAttributeLampAlarmModeWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -81169,7 +81171,7 @@ - (void)writeAttributeLampBurnHoursTripPointWithValue:(NSNumber * _Nullable)valu nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::BallastConfigurationCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87162,7 +87164,7 @@ - (void)writeAttributePIROccupiedToUnoccupiedDelayWithValue:(NSNumber * _Nonnull TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87246,7 +87248,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedDelayWithValue:(NSNumber * _Nonnull TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87331,7 +87333,7 @@ - (void)writeAttributePIRUnoccupiedToOccupiedThresholdWithValue:(NSNumber * _Non TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87417,7 +87419,7 @@ - (void)writeAttributeUltrasonicOccupiedToUnoccupiedDelayWithValue:(NSNumber * _ TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87503,7 +87505,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedDelayWithValue:(NSNumber * _ TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87591,7 +87593,7 @@ - (void)writeAttributeUltrasonicUnoccupiedToOccupiedThresholdWithValue:(NSNumber TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87679,7 +87681,7 @@ - (void)writeAttributePhysicalContactOccupiedToUnoccupiedDelayWithValue:(NSNumbe TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87767,7 +87769,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedDelayWithValue:(NSNumbe TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -87855,7 +87857,7 @@ - (void)writeAttributePhysicalContactUnoccupiedToOccupiedThresholdWithValue:(NSN TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::OccupancySensingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -94928,7 +94930,7 @@ - (void)writeAttributeSupportedStreamingProtocolsWithValue:(NSNumber * _Nonnull) TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::ContentLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -96501,7 +96503,7 @@ - (void)writeAttributeCurrentAppWithValue:(MTRApplicationLauncherClusterApplicat } } - chip::Controller::ApplicationLauncherCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -101622,7 +101624,7 @@ - (void)writeAttributeAverageRmsVoltageMeasurementPeriodWithValue:(NSNumber * _N TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -101707,7 +101709,7 @@ - (void)writeAttributeAverageRmsUnderVoltageCounterWithValue:(NSNumber * _Nonnul TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -101791,7 +101793,7 @@ - (void)writeAttributeRmsExtremeOverVoltagePeriodWithValue:(NSNumber * _Nonnull) TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -101874,7 +101876,7 @@ - (void)writeAttributeRmsExtremeUnderVoltagePeriodWithValue:(NSNumber * _Nonnull TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -101957,7 +101959,7 @@ - (void)writeAttributeRmsVoltageSagPeriodWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -102039,7 +102041,7 @@ - (void)writeAttributeRmsVoltageSwellPeriodWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -102386,7 +102388,7 @@ - (void)writeAttributeOverloadAlarmsMaskWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -102556,7 +102558,7 @@ - (void)writeAttributeAcOverloadAlarmsMaskWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::ElectricalMeasurementCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -112910,7 +112912,7 @@ - (void)writeAttributeBooleanWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -112990,7 +112992,7 @@ - (void)writeAttributeBitmap8WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113070,7 +113072,7 @@ - (void)writeAttributeBitmap16WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedShortValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113150,7 +113152,7 @@ - (void)writeAttributeBitmap32WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedIntValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113230,7 +113232,7 @@ - (void)writeAttributeBitmap64WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedLongLongValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113310,7 +113312,7 @@ - (void)writeAttributeInt8uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113390,7 +113392,7 @@ - (void)writeAttributeInt16uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113470,7 +113472,7 @@ - (void)writeAttributeInt24uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113550,7 +113552,7 @@ - (void)writeAttributeInt32uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113630,7 +113632,7 @@ - (void)writeAttributeInt40uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113710,7 +113712,7 @@ - (void)writeAttributeInt48uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113790,7 +113792,7 @@ - (void)writeAttributeInt56uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113870,7 +113872,7 @@ - (void)writeAttributeInt64uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -113950,7 +113952,7 @@ - (void)writeAttributeInt8sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.charValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114030,7 +114032,7 @@ - (void)writeAttributeInt16sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114110,7 +114112,7 @@ - (void)writeAttributeInt24sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.intValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114190,7 +114192,7 @@ - (void)writeAttributeInt32sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.intValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114270,7 +114272,7 @@ - (void)writeAttributeInt40sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.longLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114350,7 +114352,7 @@ - (void)writeAttributeInt48sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.longLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114430,7 +114432,7 @@ - (void)writeAttributeInt56sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.longLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114510,7 +114512,7 @@ - (void)writeAttributeInt64sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.longLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114590,7 +114592,7 @@ - (void)writeAttributeEnum8WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114670,7 +114672,7 @@ - (void)writeAttributeEnum16WithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114750,7 +114752,7 @@ - (void)writeAttributeFloatSingleWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.floatValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114830,7 +114832,7 @@ - (void)writeAttributeFloatDoubleWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.doubleValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -114910,7 +114912,7 @@ - (void)writeAttributeOctetStringWithValue:(NSData * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asByteSpan:value]; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115011,7 +115013,7 @@ - (void)writeAttributeListInt8uWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115112,7 +115114,7 @@ - (void)writeAttributeListOctetStringWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115214,7 +115216,7 @@ - (void)writeAttributeListStructOctetStringWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115296,7 +115298,7 @@ - (void)writeAttributeLongOctetStringWithValue:(NSData * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asByteSpan:value]; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115376,7 +115378,7 @@ - (void)writeAttributeCharStringWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115456,7 +115458,7 @@ - (void)writeAttributeLongCharStringWithValue:(NSString * _Nonnull)value TypeInfo::Type cppValue; cppValue = [self asCharSpan:value]; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115536,7 +115538,7 @@ - (void)writeAttributeEpochUsWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedLongLongValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115616,7 +115618,7 @@ - (void)writeAttributeEpochSWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedIntValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115696,7 +115698,7 @@ - (void)writeAttributeVendorIdWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedShortValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -115971,7 +115973,7 @@ - (void)writeAttributeListNullablesAndOptionalsStructWithValue:(NSArray * _Nonnu } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116055,7 +116057,7 @@ - (void)writeAttributeEnumAttrWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116145,7 +116147,7 @@ - (void)writeAttributeStructAttrWithValue:(MTRUnitTestingClusterSimpleStruct * _ cppValue.g = value.g.floatValue; cppValue.h = value.h.doubleValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116227,7 +116229,7 @@ - (void)writeAttributeRangeRestrictedInt8uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116309,7 +116311,7 @@ - (void)writeAttributeRangeRestrictedInt8sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.charValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116391,7 +116393,7 @@ - (void)writeAttributeRangeRestrictedInt16uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedShortValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116473,7 +116475,7 @@ - (void)writeAttributeRangeRestrictedInt16sWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.shortValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116576,7 +116578,7 @@ - (void)writeAttributeListLongOctetStringWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116736,7 +116738,7 @@ - (void)writeAttributeListFabricScopedWithValue:(NSArray * _Nonnull)value } } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116817,7 +116819,7 @@ - (void)writeAttributeTimedWriteBooleanWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116898,7 +116900,7 @@ - (void)writeAttributeGeneralErrorBooleanWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -116980,7 +116982,7 @@ - (void)writeAttributeClusterErrorBooleanWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117062,7 +117064,7 @@ - (void)writeAttributeUnsupportedWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.boolValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117147,7 +117149,7 @@ - (void)writeAttributeNullableBooleanWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.boolValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117233,7 +117235,7 @@ - (void)writeAttributeNullableBitmap8WithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedCharValue); } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117319,7 +117321,7 @@ - (void)writeAttributeNullableBitmap16WithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedShortValue); } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117405,7 +117407,7 @@ - (void)writeAttributeNullableBitmap32WithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedIntValue); } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117491,7 +117493,7 @@ - (void)writeAttributeNullableBitmap64WithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedLongLongValue); } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117577,7 +117579,7 @@ - (void)writeAttributeNullableInt8uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117662,7 +117664,7 @@ - (void)writeAttributeNullableInt16uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117747,7 +117749,7 @@ - (void)writeAttributeNullableInt24uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117832,7 +117834,7 @@ - (void)writeAttributeNullableInt32uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedIntValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -117917,7 +117919,7 @@ - (void)writeAttributeNullableInt40uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedLongLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118002,7 +118004,7 @@ - (void)writeAttributeNullableInt48uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedLongLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118087,7 +118089,7 @@ - (void)writeAttributeNullableInt56uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedLongLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118172,7 +118174,7 @@ - (void)writeAttributeNullableInt64uWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedLongLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118257,7 +118259,7 @@ - (void)writeAttributeNullableInt8sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.charValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118342,7 +118344,7 @@ - (void)writeAttributeNullableInt16sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.shortValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118427,7 +118429,7 @@ - (void)writeAttributeNullableInt24sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.intValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118512,7 +118514,7 @@ - (void)writeAttributeNullableInt32sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.intValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118597,7 +118599,7 @@ - (void)writeAttributeNullableInt40sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.longLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118682,7 +118684,7 @@ - (void)writeAttributeNullableInt48sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.longLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118767,7 +118769,7 @@ - (void)writeAttributeNullableInt56sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.longLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118852,7 +118854,7 @@ - (void)writeAttributeNullableInt64sWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.longLongValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -118937,7 +118939,7 @@ - (void)writeAttributeNullableEnum8WithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119022,7 +119024,7 @@ - (void)writeAttributeNullableEnum16WithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119107,7 +119109,7 @@ - (void)writeAttributeNullableFloatSingleWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.floatValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119194,7 +119196,7 @@ - (void)writeAttributeNullableFloatDoubleWithValue:(NSNumber * _Nullable)value nonNullValue_0 = value.doubleValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119281,7 +119283,7 @@ - (void)writeAttributeNullableOctetStringWithValue:(NSData * _Nullable)value nonNullValue_0 = [self asByteSpan:value]; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119367,7 +119369,7 @@ - (void)writeAttributeNullableCharStringWithValue:(NSString * _Nullable)value nonNullValue_0 = [self asCharSpan:value]; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119454,7 +119456,7 @@ - (void)writeAttributeNullableEnumAttrWithValue:(NSNumber * _Nullable)value nonNullValue_0 = static_cast>(value.unsignedCharValue); } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119552,7 +119554,7 @@ - (void)writeAttributeNullableStructWithValue:(MTRUnitTestingClusterSimpleStruct nonNullValue_0.h = value.h.doubleValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119640,7 +119642,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8uWithValue:(NSNumber * _Nullabl nonNullValue_0 = value.unsignedCharValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119729,7 +119731,7 @@ - (void)writeAttributeNullableRangeRestrictedInt8sWithValue:(NSNumber * _Nullabl nonNullValue_0 = value.charValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119818,7 +119820,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16uWithValue:(NSNumber * _Nullab nonNullValue_0 = value.unsignedShortValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119907,7 +119909,7 @@ - (void)writeAttributeNullableRangeRestrictedInt16sWithValue:(NSNumber * _Nullab nonNullValue_0 = value.shortValue; } - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); @@ -119990,7 +119992,7 @@ - (void)writeAttributeWriteOnlyInt8uWithValue:(NSNumber * _Nonnull)value TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; - chip::Controller::UnitTestingCluster cppCluster(exchangeManager, session, self->_endpoint); + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self->_endpoint); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); std::move(*bridge).DispatchAction(self.device); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index a6f1fd5cb10125..fb9bd379fd1b5f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -20,8 +20,6 @@ #import "MTRBaseClusters.h" #import "MTRBaseDevice.h" -#include - @interface MTRBaseClusterIdentify () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @property (nonatomic, assign, readonly) chip::EndpointId endpoint; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index f5fa1c36720734..62f9e11b8a2f0d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -21,8 +21,6 @@ #import "MTRDevice.h" #import "MTRDevice_Internal.h" -#include - @interface MTRClusterIdentify () @property (nonatomic, readonly) uint16_t endpoint; @property (nonatomic, readonly) MTRDevice * device; From a295e01694bf7ef57d3fa2c0d54c75b05d6d599a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 17 May 2023 21:52:17 -0400 Subject: [PATCH 12/12] Use `zcl_clusters` to loop over clusters for controller_clusters.zap (#26617) * split out client cluster generation for IDL client and server * Update to use client-side codegen and correct loop definition for matter_idl_client * make generation work * Fix typo * Update spacing to match what we had before * Ran zap_regen_all * regen all again ... to get java changes * Regen java files for devicecontroller * update dependencies in chip_codegen.cmake * Application templates do not actually depend on IDL anymore - IDL codegen is separate * Fix up the expected java output files * Update java to not use CHIPClusters and only use ClusterBase * Move callbacks to zcl_clusters as well * remove conditional from callbacks src * Switch one more file to use zcl_clusters * Switch to zcl_clusters for a LOT of java templates * unit test update --------- Co-authored-by: Andrei Litvin --- build/chip/chip_codegen.cmake | 6 - .../generators/java/ChipClustersCpp.jinja | 20 +- .../generators/java/ChipClustersRead.jinja | 4 +- .../DemoClusterClient-InvokeSubscribeImpl.cpp | 10 +- .../jni/DemoClusterClient-ReadImpl.cpp | 4 +- .../DemoClusterClient-InvokeSubscribeImpl.cpp | 10 +- .../jni/DemoClusterClient-ReadImpl.cpp | 4 +- .../MyClusterClient-InvokeSubscribeImpl.cpp | 14 +- .../jni/MyClusterClient-ReadImpl.cpp | 2 +- .../jni/FirstClient-InvokeSubscribeImpl.cpp | 10 +- .../jni/FirstClient-ReadImpl.cpp | 4 +- .../jni/SecondClient-InvokeSubscribeImpl.cpp | 10 +- .../jni/SecondClient-ReadImpl.cpp | 4 +- .../jni/ThirdClient-InvokeSubscribeImpl.cpp | 12 +- .../jni/ThirdClient-ReadImpl.cpp | 6 +- .../MyClusterClient-InvokeSubscribeImpl.cpp | 10 +- .../jni/MyClusterClient-ReadImpl.cpp | 4 +- scripts/tools/zap/generate.py | 2 +- scripts/tools/zap_regen_all.py | 13 +- src/app/zap-templates/matter-idl-client.json | 50 + ...matter-idl.json => matter-idl-server.json} | 8 +- .../idl/cluster_definition.zapt} | 79 +- .../templates/app/MatterIDL_Client.zapt | 12 + .../templates/app/MatterIDL_Server.zapt | 63 + src/controller/data_model/BUILD.gn | 304 +- .../data_model/controller-clusters.matter | 303 +- .../devicecontroller/ClusterReadMapping.java | 730 ++++ .../devicecontroller/ClusterWriteMapping.java | 12 + .../CHIPAttributeTLVValueDecoder-src.zapt | 4 +- .../java/templates/CHIPClustersWrite-JNI.zapt | 6 +- .../CHIPEventTLVValueDecoder-src.zapt | 4 +- .../templates/CHIPInvokeCallbacks-src.zapt | 4 +- .../java/templates/CHIPInvokeCallbacks.zapt | 6 +- .../java/templates/CHIPReadCallbacks-src.zapt | 7 +- .../java/templates/ChipClusters-java.zapt | 4 +- .../java/templates/ChipEventStructs-java.zapt | 8 +- .../java/templates/ChipIdLookup-java.zapt | 12 +- .../java/templates/ChipStructs-java.zapt | 8 +- .../java/templates/ClusterInfo-java.zapt | 16 +- .../CHIPAttributeTLVValueDecoder.cpp | 2239 ++++++++--- .../CHIPEventTLVValueDecoder.cpp | 221 ++ .../zap-generated/CHIPInvokeCallbacks.cpp | 62 + .../java/zap-generated/CHIPInvokeCallbacks.h | 15 + .../java/zap-generated/CHIPReadCallbacks.cpp | 3465 +++++++++++++---- .../chip/devicecontroller/ChipClusters.java | 2927 +++++++++----- .../devicecontroller/ChipEventStructs.java | 82 + .../chip/devicecontroller/ChipIdLookup.java | 216 + .../chip/devicecontroller/ChipStructs.java | 115 + .../devicecontroller/ClusterInfoMapping.java | 1111 +++++- 49 files changed, 9513 insertions(+), 2729 deletions(-) create mode 100644 src/app/zap-templates/matter-idl-client.json rename src/app/zap-templates/{matter-idl.json => matter-idl-server.json} (83%) rename src/app/zap-templates/{templates/app/MatterIDL.zapt => partials/idl/cluster_definition.zapt} (66%) create mode 100644 src/app/zap-templates/templates/app/MatterIDL_Client.zapt create mode 100644 src/app/zap-templates/templates/app/MatterIDL_Server.zapt diff --git a/build/chip/chip_codegen.cmake b/build/chip/chip_codegen.cmake index dd7e4a645d92f9..77c65ba6a4ea52 100644 --- a/build/chip/chip_codegen.cmake +++ b/build/chip/chip_codegen.cmake @@ -162,11 +162,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/idl/command_request_response.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/command_request_struct.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/command_response_struct.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/structure_definition.zapt" - "${CHIP_ROOT}/src/app/zap-templates/partials/idl/structure_member.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/CHIPClientCallbacks.zapt" @@ -174,7 +169,6 @@ function(chip_zapgen TARGET_NAME) "${CHIP_ROOT}/src/app/zap-templates/templates/app/endpoint_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/gen_config.zapt" "${CHIP_ROOT}/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt" - "${CHIP_ROOT}/src/app/zap-templates/templates/app/MatterIDL.zapt" ) SET(OUTPUT_SUBDIR "zap-generated") else() diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja index 9af7eb5712c40f..596cc5d4feef67 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersCpp.jinja @@ -86,11 +86,11 @@ #include #include +#include #include #include #include -#include #include #include @@ -104,17 +104,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, {{cluster.name | capitalcase}}Cluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - {{cluster.name | capitalcase}}Cluster * cppCluster = new {{cluster.name | capitalcase}}Cluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -131,8 +133,8 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - {{cluster.name | capitalcase}}Cluster * cppCluster; - + ClusterBase * cppCluster; + ListFreer listFreer; chip::app::Clusters::{{cluster.name | capitalcase}}::Commands::{{command.name | capitalcase}}::Type request; @@ -142,8 +144,8 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, {%- for field in (cluster.structs | named(command.input_param)).fields -%} {{ encode_value( "request." + (field.name | lowercaseFirst), - (field.name | lowercaseFirst), - 0, + (field.name | lowercaseFirst), + 0, field | asEncodable(typeLookup) )}} {%- endfor -%} @@ -156,7 +158,7 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, VerifyOrReturn(onSuccess.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast<{{cluster.name | capitalcase}}Cluster *>(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); @@ -194,7 +196,7 @@ JNI_METHOD(void, {{cluster.name}}Cluster, subscribe{{attr.definition.name | capi VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - {{cluster.name}}Cluster * cppCluster = reinterpret_cast<{{cluster.name}}Cluster *>(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::{{cluster.name}}::Attributes::{{attr.definition.name | capitalcase}}::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja index e75779cf790624..96572922054095 100644 --- a/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja +++ b/scripts/py_matter_idl/matter_idl/generators/java/ChipClustersRead.jinja @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ JNI_METHOD(void, {{cluster.name | capitalcase}}Cluster, read{{attr.definition.na VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::{{cluster.name | capitalcase}}Cluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp index 31bd11a9f16249..7766e049220c95 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, DemoClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - DemoClusterCluster * cppCluster = new DemoClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, DemoClusterCluster, subscribeArmFailsafesAttribute)(JNIEnv * en VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::DemoCluster::Attributes::ArmFailsafes::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp index 3976dcbd9243df..400f3dee271a2a 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/cluster_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, DemoClusterCluster, readArmFailsafesAttribute)(JNIEnv * env, jo VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp index c91759c71b12f2..1a5bbad380cb30 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, DemoClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - DemoClusterCluster * cppCluster = new DemoClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, DemoClusterCluster, subscribeSomeLabelsAttribute)(JNIEnv * env, VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::DemoCluster::Attributes::SomeLabels::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp index 1059cd32fe92da..243f4a46273139 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/global_struct_attribute/jni/DemoClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, DemoClusterCluster, readSomeLabelsAttribute)(JNIEnv * env, jobj VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::DemoClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp index f55394ec269721..7365fbcdb62384 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, MyClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - MyClusterCluster * cppCluster = new MyClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -37,8 +39,8 @@ JNI_METHOD(void, MyClusterCluster, { chip::DeviceLayer::StackLock lock; CHIP_ERROR err = CHIP_NO_ERROR; - MyClusterCluster * cppCluster; - + ClusterBase * cppCluster; + ListFreer listFreer; chip::app::Clusters::MyCluster::Commands::Foo::Type request; @@ -60,7 +62,7 @@ JNI_METHOD(void, MyClusterCluster, VerifyOrReturn(onSuccess.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); VerifyOrReturn(onFailure.get() != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native callback", CHIP_ERROR_NO_MEMORY)); - cppCluster = reinterpret_cast(clusterPtr); + cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error getting native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp index 57d84d3501b751..30a766dd4563aa 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/optional_argument/jni/MyClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp index 753863ee7814c4..6f25efc37a1eb6 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, FirstCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - FirstCluster * cppCluster = new FirstCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, FirstCluster, subscribeSomeIntegerAttribute)(JNIEnv * env, jobj VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - FirstCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::First::Attributes::SomeInteger::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp index 11efe7541f40b6..0d09a2adced29f 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/FirstClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, FirstCluster, readSomeIntegerAttribute)(JNIEnv * env, jobject s VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::FirstCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp index 671610e33cdc7f..f459123ba675e1 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, SecondCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - SecondCluster * cppCluster = new SecondCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, SecondCluster, subscribeSomeBytesAttribute)(JNIEnv * env, jobje VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - SecondCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Second::Attributes::SomeBytes::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp index 8d07cda4cac889..9f718035cd39f5 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/SecondClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, SecondCluster, readSomeBytesAttribute)(JNIEnv * env, jobject se VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::SecondCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp index 2a7256ffbb526d..8ff4a4cbd77c5b 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, ThirdCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - ThirdCluster * cppCluster = new ThirdCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, ThirdCluster, subscribeSomeEnumAttribute)(JNIEnv * env, jobject VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Third::Attributes::SomeEnum::TypeInfo; @@ -62,7 +64,7 @@ JNI_METHOD(void, ThirdCluster, subscribeSomeEnumAttribute)(JNIEnv * env, jobject VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::Third::Attributes::Options::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp index 31012d0240eb99..5799f7a6f4a3e0 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/several_clusters/jni/ThirdClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, ThirdCluster, readSomeEnumAttribute)(JNIEnv * env, jobject self VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); @@ -47,7 +47,7 @@ JNI_METHOD(void, ThirdCluster, readOptionsAttribute)(JNIEnv * env, jobject self, VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::ThirdCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp index b6a4957c3a7d83..3aa51bc87b99a8 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-InvokeSubscribeImpl.cpp @@ -1,10 +1,10 @@ #include #include +#include #include #include #include -#include #include #include @@ -18,17 +18,19 @@ #include #include +#include + #define JNI_METHOD(RETURN, CLASS_NAME, METHOD_NAME) \ extern "C" JNIEXPORT RETURN JNICALL Java_chip_devicecontroller_ChipClusters_00024##CLASS_NAME##_##METHOD_NAME using namespace chip; -using namespace chip::Controller; +using chip::Controller::ClusterBase; JNI_METHOD(jlong, MyClusterCluster, initWithDevice)(JNIEnv * env, jobject self, jlong devicePtr, jint endpointId) { chip::DeviceLayer::StackLock lock; DeviceProxy * device = reinterpret_cast(devicePtr); - MyClusterCluster * cppCluster = new MyClusterCluster(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); + ClusterBase * cppCluster = new ClusterBase(*device->GetExchangeManager(), device->GetSecureSession().Value(), endpointId); return reinterpret_cast(cppCluster); } @@ -41,7 +43,7 @@ JNI_METHOD(void, MyClusterCluster, subscribeClusterAttrAttribute)(JNIEnv * env, VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - MyClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); using TypeInfo = chip::app::Clusters::MyCluster::Attributes::ClusterAttr::TypeInfo; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp index b8a9ef3264b3cb..504996a2928a51 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/simple_attribute/jni/MyClusterClient-ReadImpl.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include @@ -23,7 +23,7 @@ JNI_METHOD(void, MyClusterCluster, readClusterAttrAttribute)(JNIEnv * env, jobje VerifyOrReturn(onFailure.get() != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error creating native failure callback", CHIP_ERROR_NO_MEMORY)); CHIP_ERROR err = CHIP_NO_ERROR; - chip::Controller::MyClusterCluster * cppCluster = reinterpret_cast(clusterPtr); + chip::Controller::ClusterBase * cppCluster = reinterpret_cast(clusterPtr); VerifyOrReturn(cppCluster != nullptr, chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); diff --git a/scripts/tools/zap/generate.py b/scripts/tools/zap/generate.py index a4d36a7cbc730e..6bcc94d734f22c 100755 --- a/scripts/tools/zap/generate.py +++ b/scripts/tools/zap/generate.py @@ -113,7 +113,7 @@ def runArgumentsParser() -> CmdLineArgs: # # All the rest of the files (app-templates.json) are generally built at # compile time. - default_templates = 'src/app/zap-templates/matter-idl.json' + default_templates = 'src/app/zap-templates/matter-idl-server.json' parser = argparse.ArgumentParser( description='Generate artifacts from .zapt templates') diff --git a/scripts/tools/zap_regen_all.py b/scripts/tools/zap_regen_all.py index 94407cae55b634..80229e108d2a90 100755 --- a/scripts/tools/zap_regen_all.py +++ b/scripts/tools/zap_regen_all.py @@ -90,10 +90,13 @@ class ZapDistinctOutput: class ZAPGenerateTarget: @staticmethod - def MatterIdlTarget(zap_config): - # NOTE: this assumes `src/app/zap-templates/matter-idl.json` is the - # DEFAULT generation target and it needs no output_dir - return ZAPGenerateTarget(zap_config, template=None, output_dir=None) + def MatterIdlTarget(zap_config, client_side=False): + if client_side: + return ZAPGenerateTarget(zap_config, template="src/app/zap-templates/matter-idl-client.json", output_dir=None) + else: + # NOTE: this assumes `src/app/zap-templates/matter-idl-server.json` is the + # DEFAULT generation target and it needs no output_dir + return ZAPGenerateTarget(zap_config, template=None, output_dir=None) def __init__(self, zap_config, template, output_dir=None): self.script = './scripts/tools/zap/generate.py' @@ -347,7 +350,7 @@ def getGlobalTemplatesTargets(): 'zzz_generated', generate_subdir, 'zap-generated') targets.append(ZAPGenerateTarget.MatterIdlTarget(filepath)) - targets.append(ZAPGenerateTarget.MatterIdlTarget('src/controller/data_model/controller-clusters.zap')) + targets.append(ZAPGenerateTarget.MatterIdlTarget('src/controller/data_model/controller-clusters.zap', client_side=True)) # This generates app headers for darwin only, for easier/clearer include # in .pbxproj files. diff --git a/src/app/zap-templates/matter-idl-client.json b/src/app/zap-templates/matter-idl-client.json new file mode 100644 index 00000000000000..98bddf36ffaad1 --- /dev/null +++ b/src/app/zap-templates/matter-idl-client.json @@ -0,0 +1,50 @@ +{ + "name": "CHIP Application templates", + "version": "chip-v1", + "helpers": [ + "partials/helper.js", + "common/ListHelper.js", + "common/StringHelper.js", + "common/ChipTypesHelper.js", + "templates/app/helper.js", + "templates/chip/helper.js" + ], + "override": "common/override.js", + "partials": [ + { + "name": "idl_structure_definition", + "path": "partials/idl/structure_definition.zapt" + }, + { + "name": "idl_structure_member", + "path": "partials/idl/structure_member.zapt" + }, + { + "name": "idl_command_request_response", + "path": "partials/idl/command_request_response.zapt" + }, + { + "name": "idl_command_request_struct", + "path": "partials/idl/command_request_struct.zapt" + }, + { + "name": "idl_command_response_struct", + "path": "partials/idl/command_response_struct.zapt" + }, + { + "name": "idl_attribute_definition", + "path": "partials/idl/attribute_definition.zapt" + }, + { + "name": "idl_cluster_definition", + "path": "partials/idl/cluster_definition.zapt" + } + ], + "templates": [ + { + "path": "templates/app/MatterIDL_Client.zapt", + "name": "Human-readable Matter IDL (All client clusters)", + "output": "Clusters.matter" + } + ] +} diff --git a/src/app/zap-templates/matter-idl.json b/src/app/zap-templates/matter-idl-server.json similarity index 83% rename from src/app/zap-templates/matter-idl.json rename to src/app/zap-templates/matter-idl-server.json index eda0b9e59db7ae..6b39f04826d6ee 100644 --- a/src/app/zap-templates/matter-idl.json +++ b/src/app/zap-templates/matter-idl-server.json @@ -34,12 +34,16 @@ { "name": "idl_attribute_definition", "path": "partials/idl/attribute_definition.zapt" + }, + { + "name": "idl_cluster_definition", + "path": "partials/idl/cluster_definition.zapt" } ], "templates": [ { - "path": "templates/app/MatterIDL.zapt", - "name": "Human-readable Matter IDL", + "path": "templates/app/MatterIDL_Server.zapt", + "name": "Human-readable Matter IDL (Server-side)", "output": "Clusters.matter" } ] diff --git a/src/app/zap-templates/templates/app/MatterIDL.zapt b/src/app/zap-templates/partials/idl/cluster_definition.zapt similarity index 66% rename from src/app/zap-templates/templates/app/MatterIDL.zapt rename to src/app/zap-templates/partials/idl/cluster_definition.zapt index 9802426b29f942..01943b176c6da7 100644 --- a/src/app/zap-templates/templates/app/MatterIDL.zapt +++ b/src/app/zap-templates/partials/idl/cluster_definition.zapt @@ -1,15 +1,6 @@ -// This IDL was generated automatically by ZAP. -// It is for view/code review purposes only. - -{{#zcl_structs}} -{{#if has_more_than_one_cluster}} -{{>idl_structure_definition extraIndent=0}} - -{{/if}} -{{/zcl_structs}} -{{#all_user_clusters~}} /** {{description}} */ -{{side}} cluster {{asUpperCamelCase name}} = {{code}} { +{{#if generateClientCluster}}client {{else}}server {{/if~}} +cluster {{asUpperCamelCase name}} = {{code}} { {{#zcl_enums}} enum {{asUpperCamelCase name}} : ENUM{{multiply size 8}} { {{#zcl_enum_items}} @@ -46,7 +37,7 @@ } {{/zcl_events}} - {{#if (is_client side)}} + {{#if generateClientCluster}} {{#zcl_attributes_server}} {{#if clusterRef}} {{! ensure indent }}{{>idl_attribute_definition}} @@ -71,14 +62,14 @@ readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; {{!--Open:Generating command request structs for all incoming commands into server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_incoming_commands_for_cluster name side}} {{~>idl_command_request_struct}} {{/all_incoming_commands_for_cluster}} - {{/if}} + {{/unless}} {{~!--Close:Generating command request structs for all incoming commands into server side--~}} {{~!--Open:Generating command request structs for all outgoing commands from client side--~}} - {{#if (is_client side)}} + {{#if generateClientCluster}} {{#zcl_commands}} {{#if (isStrEqual source "client")}} {{~>idl_command_request_struct}} @@ -91,69 +82,21 @@ {{~!--Open:Generating command response structs for all incoming commands into client side--~}} {{~!--Close:Generating command response structs for all incoming commands into client side--~}} {{~!--Open:Generating command response structs for all outgoing commands from server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_outgoing_commands_for_cluster name side}} {{~>idl_command_response_struct}} {{/all_outgoing_commands_for_cluster}} - {{/if}} + {{/unless}} {{~!--Close:Generating command response structs for all outgoing commands from server side--~}} - {{#if (is_server side)}} + {{#unless generateClientCluster}} {{#all_incoming_commands_for_cluster name side}} {{~>idl_command_request_response}}{{~new_line 1~}} {{/all_incoming_commands_for_cluster}} - {{/if}} - {{#if (is_client side)}} + {{/unless}} + {{#if generateClientCluster}} {{#zcl_commands_source_client}} {{~>idl_command_request_response}}{{~new_line 1~}} {{/zcl_commands_source_client}} {{/if}} } -{{/all_user_clusters}} -{{#user_endpoints}} -endpoint {{endpointId}} { - {{#if deviceIdentifier}} - device type {{chip_friendly_endpoint_type_name}} = {{deviceIdentifier}}, version {{endpointVersion}}; - {{/if~}} - - {{#user_clusters}} - {{#if enabled}} - {{#unless (isServer side)}} - binding cluster {{asUpperCamelCase name}}; - {{/unless}} - {{/if}} - {{/user_clusters}} - {{#user_clusters}} - {{#if enabled}} - {{#if (isServer side)}} - - server cluster {{asUpperCamelCase name}} { - {{#user_cluster_events}} - {{#if included}} - emits event {{name}}; - {{/if}} - {{/user_cluster_events}} - {{#user_cluster_attributes}} - {{#if included}} - {{~#if (is_str_equal storageOption "NVM")}} - persist {{!align~}} - {{~else if (is_str_equal storageOption "External")}} - callback {{!align~}} - {{~else}} - ram {{!align~}} - {{~/if~}} - attribute {{asLowerCamelCase name}} - {{~#if defaultValue~}} - {{!need space}} default = {{#if (isString type)}}"{{defaultValue}}"{{else}}{{defaultValue}}{{/if}} - {{~/if~}} - ; - {{/if}} - {{/user_cluster_attributes}} - } - {{/if}} - {{/if}} - {{/user_clusters}} -} -{{/user_endpoints}} - - diff --git a/src/app/zap-templates/templates/app/MatterIDL_Client.zapt b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt new file mode 100644 index 00000000000000..50d59f4fc2f38e --- /dev/null +++ b/src/app/zap-templates/templates/app/MatterIDL_Client.zapt @@ -0,0 +1,12 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +{{#zcl_structs}} +{{#if has_more_than_one_cluster}} +{{>idl_structure_definition extraIndent=0}} + +{{/if}} +{{/zcl_structs}} +{{#zcl_clusters~}} +{{>idl_cluster_definition generateClientCluster=1}} +{{/zcl_clusters}} diff --git a/src/app/zap-templates/templates/app/MatterIDL_Server.zapt b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt new file mode 100644 index 00000000000000..7180d2fb78d7eb --- /dev/null +++ b/src/app/zap-templates/templates/app/MatterIDL_Server.zapt @@ -0,0 +1,63 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +{{#zcl_structs}} +{{#if has_more_than_one_cluster}} +{{>idl_structure_definition extraIndent=0}} + +{{/if}} +{{/zcl_structs}} +{{#all_user_clusters~}} +{{#if (is_client side)~}} +{{>idl_cluster_definition generateClientCluster=1}} +{{else~}} +{{>idl_cluster_definition generateClientCluster=0}} +{{/if}} +{{/all_user_clusters}} +{{#user_endpoints}} +endpoint {{endpointId}} { + {{#if deviceIdentifier}} + device type {{chip_friendly_endpoint_type_name}} = {{deviceIdentifier}}, version {{endpointVersion}}; + {{/if~}} + + {{#user_clusters}} + {{#if enabled}} + {{#unless (isServer side)}} + binding cluster {{asUpperCamelCase name}}; + {{/unless}} + {{/if}} + {{/user_clusters}} + {{#user_clusters}} + {{#if enabled}} + {{#if (isServer side)}} + + server cluster {{asUpperCamelCase name}} { + {{#user_cluster_events}} + {{#if included}} + emits event {{name}}; + {{/if}} + {{/user_cluster_events}} + {{#user_cluster_attributes}} + {{#if included}} + {{~#if (is_str_equal storageOption "NVM")}} + persist {{!align~}} + {{~else if (is_str_equal storageOption "External")}} + callback {{!align~}} + {{~else}} + ram {{!align~}} + {{~/if~}} + attribute {{asLowerCamelCase name}} + {{~#if defaultValue~}} + {{!need space}} default = {{#if (isString type)}}"{{defaultValue}}"{{else}}{{defaultValue}}{{/if}} + {{~/if~}} + ; + {{/if}} + {{/user_cluster_attributes}} + } + {{/if}} + {{/if}} + {{/user_clusters}} +} +{{/user_endpoints}} + + diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index e3359d83d369df..69ffd6f2e36488 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -42,166 +42,178 @@ if (current_os == "android" || build_java_matter_controller) { generator = "java-jni" outputs = [ + "jni/AccessControlClient-InvokeSubscribeImpl.cpp", + "jni/AccessControlClient-ReadImpl.cpp", + "jni/AccountLoginClient-InvokeSubscribeImpl.cpp", + "jni/AccountLoginClient-ReadImpl.cpp", + "jni/ActionsClient-InvokeSubscribeImpl.cpp", + "jni/ActionsClient-ReadImpl.cpp", + "jni/ActivatedCarbonFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ActivatedCarbonFilterMonitoringClient-ReadImpl.cpp", + "jni/AdministratorCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/AdministratorCommissioningClient-ReadImpl.cpp", + "jni/AirQualityClient-InvokeSubscribeImpl.cpp", + "jni/AirQualityClient-ReadImpl.cpp", + "jni/ApplicationBasicClient-InvokeSubscribeImpl.cpp", + "jni/ApplicationBasicClient-ReadImpl.cpp", + "jni/ApplicationLauncherClient-InvokeSubscribeImpl.cpp", + "jni/ApplicationLauncherClient-ReadImpl.cpp", + "jni/AudioOutputClient-InvokeSubscribeImpl.cpp", + "jni/AudioOutputClient-ReadImpl.cpp", + "jni/BallastConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/BallastConfigurationClient-ReadImpl.cpp", + "jni/BarrierControlClient-InvokeSubscribeImpl.cpp", + "jni/BarrierControlClient-ReadImpl.cpp", + "jni/BasicInformationClient-InvokeSubscribeImpl.cpp", + "jni/BasicInformationClient-ReadImpl.cpp", + "jni/BinaryInputBasicClient-InvokeSubscribeImpl.cpp", + "jni/BinaryInputBasicClient-ReadImpl.cpp", + "jni/BindingClient-InvokeSubscribeImpl.cpp", + "jni/BindingClient-ReadImpl.cpp", + "jni/BooleanStateClient-InvokeSubscribeImpl.cpp", + "jni/BooleanStateClient-ReadImpl.cpp", + "jni/BridgedDeviceBasicInformationClient-InvokeSubscribeImpl.cpp", + "jni/BridgedDeviceBasicInformationClient-ReadImpl.cpp", + "jni/CeramicFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/CeramicFilterMonitoringClient-ReadImpl.cpp", + "jni/ChannelClient-InvokeSubscribeImpl.cpp", + "jni/ChannelClient-ReadImpl.cpp", "jni/CHIPCallbackTypes.h", "jni/CHIPReadCallbacks.h", - "jni/IdentifyClient-ReadImpl.cpp", - "jni/IdentifyClient-InvokeSubscribeImpl.cpp", - "jni/GroupsClient-ReadImpl.cpp", + "jni/ColorControlClient-InvokeSubscribeImpl.cpp", + "jni/ColorControlClient-ReadImpl.cpp", + "jni/ContentLauncherClient-InvokeSubscribeImpl.cpp", + "jni/ContentLauncherClient-ReadImpl.cpp", + "jni/DescriptorClient-InvokeSubscribeImpl.cpp", + "jni/DescriptorClient-ReadImpl.cpp", + "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", + "jni/DiagnosticLogsClient-ReadImpl.cpp", + "jni/DoorLockClient-InvokeSubscribeImpl.cpp", + "jni/DoorLockClient-ReadImpl.cpp", + "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/ElectricalMeasurementClient-ReadImpl.cpp", + "jni/ElectrostaticFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ElectrostaticFilterMonitoringClient-ReadImpl.cpp", + "jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/FanControlClient-InvokeSubscribeImpl.cpp", + "jni/FanControlClient-ReadImpl.cpp", + "jni/FaultInjectionClient-InvokeSubscribeImpl.cpp", + "jni/FaultInjectionClient-ReadImpl.cpp", + "jni/FixedLabelClient-InvokeSubscribeImpl.cpp", + "jni/FixedLabelClient-ReadImpl.cpp", + "jni/FlowMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/FlowMeasurementClient-ReadImpl.cpp", + "jni/FuelTankMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/FuelTankMonitoringClient-ReadImpl.cpp", + "jni/GeneralCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/GeneralCommissioningClient-ReadImpl.cpp", + "jni/GeneralDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/GeneralDiagnosticsClient-ReadImpl.cpp", + "jni/GroupKeyManagementClient-InvokeSubscribeImpl.cpp", + "jni/GroupKeyManagementClient-ReadImpl.cpp", "jni/GroupsClient-InvokeSubscribeImpl.cpp", - "jni/ScenesClient-ReadImpl.cpp", - "jni/ScenesClient-InvokeSubscribeImpl.cpp", - "jni/OnOffClient-ReadImpl.cpp", + "jni/GroupsClient-ReadImpl.cpp", + "jni/HepaFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/HepaFilterMonitoringClient-ReadImpl.cpp", + "jni/IcdManagementClient-InvokeSubscribeImpl.cpp", + "jni/IcdManagementClient-ReadImpl.cpp", + "jni/IdentifyClient-InvokeSubscribeImpl.cpp", + "jni/IdentifyClient-ReadImpl.cpp", + "jni/IlluminanceMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/IlluminanceMeasurementClient-ReadImpl.cpp", + "jni/InkCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/InkCartridgeMonitoringClient-ReadImpl.cpp", + "jni/IonizingFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", + "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", + "jni/KeypadInputClient-ReadImpl.cpp", + "jni/LevelControlClient-InvokeSubscribeImpl.cpp", + "jni/LevelControlClient-ReadImpl.cpp", + "jni/LocalizationConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/LocalizationConfigurationClient-ReadImpl.cpp", + "jni/LowPowerClient-InvokeSubscribeImpl.cpp", + "jni/LowPowerClient-ReadImpl.cpp", + "jni/MediaInputClient-InvokeSubscribeImpl.cpp", + "jni/MediaInputClient-ReadImpl.cpp", + "jni/MediaPlaybackClient-InvokeSubscribeImpl.cpp", + "jni/MediaPlaybackClient-ReadImpl.cpp", + "jni/ModeSelectClient-InvokeSubscribeImpl.cpp", + "jni/ModeSelectClient-ReadImpl.cpp", + "jni/NetworkCommissioningClient-InvokeSubscribeImpl.cpp", + "jni/NetworkCommissioningClient-ReadImpl.cpp", + "jni/OccupancySensingClient-InvokeSubscribeImpl.cpp", + "jni/OccupancySensingClient-ReadImpl.cpp", "jni/OnOffClient-InvokeSubscribeImpl.cpp", - "jni/OnOffSwitchConfigurationClient-ReadImpl.cpp", + "jni/OnOffClient-ReadImpl.cpp", "jni/OnOffSwitchConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/LevelControlClient-ReadImpl.cpp", - "jni/LevelControlClient-InvokeSubscribeImpl.cpp", - "jni/BinaryInputBasicClient-ReadImpl.cpp", - "jni/BinaryInputBasicClient-InvokeSubscribeImpl.cpp", - "jni/DescriptorClient-ReadImpl.cpp", - "jni/DescriptorClient-InvokeSubscribeImpl.cpp", - "jni/BindingClient-ReadImpl.cpp", - "jni/BindingClient-InvokeSubscribeImpl.cpp", - "jni/AccessControlClient-ReadImpl.cpp", - "jni/AccessControlClient-InvokeSubscribeImpl.cpp", - "jni/ActionsClient-ReadImpl.cpp", - "jni/ActionsClient-InvokeSubscribeImpl.cpp", - "jni/BasicInformationClient-ReadImpl.cpp", - "jni/BasicInformationClient-InvokeSubscribeImpl.cpp", - "jni/OtaSoftwareUpdateProviderClient-ReadImpl.cpp", + "jni/OnOffSwitchConfigurationClient-ReadImpl.cpp", + "jni/OperationalCredentialsClient-InvokeSubscribeImpl.cpp", + "jni/OperationalCredentialsClient-ReadImpl.cpp", "jni/OtaSoftwareUpdateProviderClient-InvokeSubscribeImpl.cpp", - "jni/OtaSoftwareUpdateRequestorClient-ReadImpl.cpp", + "jni/OtaSoftwareUpdateProviderClient-ReadImpl.cpp", "jni/OtaSoftwareUpdateRequestorClient-InvokeSubscribeImpl.cpp", - "jni/LocalizationConfigurationClient-ReadImpl.cpp", - "jni/LocalizationConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/TimeFormatLocalizationClient-ReadImpl.cpp", - "jni/TimeFormatLocalizationClient-InvokeSubscribeImpl.cpp", - "jni/UnitLocalizationClient-ReadImpl.cpp", - "jni/UnitLocalizationClient-InvokeSubscribeImpl.cpp", - "jni/PowerSourceConfigurationClient-ReadImpl.cpp", - "jni/PowerSourceConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/PowerSourceClient-ReadImpl.cpp", + "jni/OtaSoftwareUpdateRequestorClient-ReadImpl.cpp", + "jni/OzoneFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/OzoneFilterMonitoringClient-ReadImpl.cpp", "jni/PowerSourceClient-InvokeSubscribeImpl.cpp", - "jni/GeneralCommissioningClient-ReadImpl.cpp", - "jni/GeneralCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/NetworkCommissioningClient-ReadImpl.cpp", - "jni/NetworkCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/DiagnosticLogsClient-ReadImpl.cpp", - "jni/DiagnosticLogsClient-InvokeSubscribeImpl.cpp", - "jni/GeneralDiagnosticsClient-ReadImpl.cpp", - "jni/GeneralDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/SoftwareDiagnosticsClient-ReadImpl.cpp", + "jni/PowerSourceClient-ReadImpl.cpp", + "jni/PowerSourceConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/PowerSourceConfigurationClient-ReadImpl.cpp", + "jni/PressureMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/PressureMeasurementClient-ReadImpl.cpp", + "jni/ProxyConfigurationClient-InvokeSubscribeImpl.cpp", + "jni/ProxyConfigurationClient-ReadImpl.cpp", + "jni/ProxyDiscoveryClient-InvokeSubscribeImpl.cpp", + "jni/ProxyDiscoveryClient-ReadImpl.cpp", + "jni/ProxyValidClient-InvokeSubscribeImpl.cpp", + "jni/ProxyValidClient-ReadImpl.cpp", + "jni/PulseWidthModulationClient-InvokeSubscribeImpl.cpp", + "jni/PulseWidthModulationClient-ReadImpl.cpp", + "jni/PumpConfigurationAndControlClient-InvokeSubscribeImpl.cpp", + "jni/PumpConfigurationAndControlClient-ReadImpl.cpp", + "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", + "jni/ScenesClient-InvokeSubscribeImpl.cpp", + "jni/ScenesClient-ReadImpl.cpp", "jni/SoftwareDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/ThreadNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/ThreadNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/WiFiNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/WiFiNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/EthernetNetworkDiagnosticsClient-ReadImpl.cpp", - "jni/EthernetNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", - "jni/BridgedDeviceBasicInformationClient-ReadImpl.cpp", - "jni/BridgedDeviceBasicInformationClient-InvokeSubscribeImpl.cpp", - "jni/SwitchClient-ReadImpl.cpp", + "jni/SoftwareDiagnosticsClient-ReadImpl.cpp", "jni/SwitchClient-InvokeSubscribeImpl.cpp", - "jni/AdministratorCommissioningClient-ReadImpl.cpp", - "jni/AdministratorCommissioningClient-InvokeSubscribeImpl.cpp", - "jni/OperationalCredentialsClient-ReadImpl.cpp", - "jni/OperationalCredentialsClient-InvokeSubscribeImpl.cpp", - "jni/GroupKeyManagementClient-ReadImpl.cpp", - "jni/GroupKeyManagementClient-InvokeSubscribeImpl.cpp", - "jni/FixedLabelClient-ReadImpl.cpp", - "jni/FixedLabelClient-InvokeSubscribeImpl.cpp", - "jni/UserLabelClient-ReadImpl.cpp", - "jni/UserLabelClient-InvokeSubscribeImpl.cpp", - "jni/BooleanStateClient-ReadImpl.cpp", - "jni/BooleanStateClient-InvokeSubscribeImpl.cpp", - "jni/ModeSelectClient-ReadImpl.cpp", - "jni/ModeSelectClient-InvokeSubscribeImpl.cpp", - "jni/DoorLockClient-ReadImpl.cpp", - "jni/DoorLockClient-InvokeSubscribeImpl.cpp", - "jni/WindowCoveringClient-ReadImpl.cpp", - "jni/WindowCoveringClient-InvokeSubscribeImpl.cpp", - "jni/BarrierControlClient-ReadImpl.cpp", - "jni/BarrierControlClient-InvokeSubscribeImpl.cpp", - "jni/PumpConfigurationAndControlClient-ReadImpl.cpp", - "jni/PumpConfigurationAndControlClient-InvokeSubscribeImpl.cpp", - "jni/ThermostatClient-ReadImpl.cpp", + "jni/SwitchClient-ReadImpl.cpp", + "jni/TargetNavigatorClient-InvokeSubscribeImpl.cpp", + "jni/TargetNavigatorClient-ReadImpl.cpp", + "jni/TemperatureMeasurementClient-InvokeSubscribeImpl.cpp", + "jni/TemperatureMeasurementClient-ReadImpl.cpp", "jni/ThermostatClient-InvokeSubscribeImpl.cpp", - "jni/FanControlClient-ReadImpl.cpp", - "jni/FanControlClient-InvokeSubscribeImpl.cpp", - "jni/ThermostatUserInterfaceConfigurationClient-ReadImpl.cpp", + "jni/ThermostatClient-ReadImpl.cpp", "jni/ThermostatUserInterfaceConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/ColorControlClient-ReadImpl.cpp", - "jni/ColorControlClient-InvokeSubscribeImpl.cpp", - "jni/BallastConfigurationClient-ReadImpl.cpp", - "jni/BallastConfigurationClient-InvokeSubscribeImpl.cpp", - "jni/IlluminanceMeasurementClient-ReadImpl.cpp", - "jni/IlluminanceMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/TemperatureMeasurementClient-ReadImpl.cpp", - "jni/TemperatureMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/PressureMeasurementClient-ReadImpl.cpp", - "jni/PressureMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/FlowMeasurementClient-ReadImpl.cpp", - "jni/FlowMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/RelativeHumidityMeasurementClient-ReadImpl.cpp", - "jni/RelativeHumidityMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/OccupancySensingClient-ReadImpl.cpp", - "jni/OccupancySensingClient-InvokeSubscribeImpl.cpp", - "jni/WakeOnLanClient-ReadImpl.cpp", - "jni/WakeOnLanClient-InvokeSubscribeImpl.cpp", - "jni/ChannelClient-ReadImpl.cpp", - "jni/ChannelClient-InvokeSubscribeImpl.cpp", - "jni/TargetNavigatorClient-ReadImpl.cpp", - "jni/TargetNavigatorClient-InvokeSubscribeImpl.cpp", - "jni/MediaPlaybackClient-ReadImpl.cpp", - "jni/MediaPlaybackClient-InvokeSubscribeImpl.cpp", - "jni/MediaInputClient-ReadImpl.cpp", - "jni/MediaInputClient-InvokeSubscribeImpl.cpp", - "jni/LowPowerClient-ReadImpl.cpp", - "jni/LowPowerClient-InvokeSubscribeImpl.cpp", - "jni/KeypadInputClient-ReadImpl.cpp", - "jni/KeypadInputClient-InvokeSubscribeImpl.cpp", - "jni/ContentLauncherClient-ReadImpl.cpp", - "jni/ContentLauncherClient-InvokeSubscribeImpl.cpp", - "jni/AudioOutputClient-ReadImpl.cpp", - "jni/AudioOutputClient-InvokeSubscribeImpl.cpp", - "jni/ApplicationLauncherClient-ReadImpl.cpp", - "jni/ApplicationLauncherClient-InvokeSubscribeImpl.cpp", - "jni/ApplicationBasicClient-ReadImpl.cpp", - "jni/ApplicationBasicClient-InvokeSubscribeImpl.cpp", - "jni/AccountLoginClient-ReadImpl.cpp", - "jni/AccountLoginClient-InvokeSubscribeImpl.cpp", - "jni/ElectricalMeasurementClient-ReadImpl.cpp", - "jni/ElectricalMeasurementClient-InvokeSubscribeImpl.cpp", - "jni/UnitTestingClient-ReadImpl.cpp", + "jni/ThermostatUserInterfaceConfigurationClient-ReadImpl.cpp", + "jni/ThreadNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/ThreadNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/TimeFormatLocalizationClient-InvokeSubscribeImpl.cpp", + "jni/TimeFormatLocalizationClient-ReadImpl.cpp", + "jni/TimeSynchronizationClient-InvokeSubscribeImpl.cpp", + "jni/TimeSynchronizationClient-ReadImpl.cpp", + "jni/TonerCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/TonerCartridgeMonitoringClient-ReadImpl.cpp", + "jni/UnitLocalizationClient-InvokeSubscribeImpl.cpp", + "jni/UnitLocalizationClient-ReadImpl.cpp", "jni/UnitTestingClient-InvokeSubscribeImpl.cpp", - "jni/AirQualityClient-ReadImpl.cpp", - "jni/AirQualityClient-InvokeSubscribeImpl.cpp", - "jni/IonizingFilterMonitoringClient-ReadImpl.cpp", - "jni/IonizingFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ZeoliteFilterMonitoringClient-ReadImpl.cpp", - "jni/ZeoliteFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/HepaFilterMonitoringClient-ReadImpl.cpp", - "jni/HepaFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ElectrostaticFilterMonitoringClient-ReadImpl.cpp", - "jni/ElectrostaticFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/WaterTankMonitoringClient-ReadImpl.cpp", - "jni/WaterTankMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/OzoneFilterMonitoringClient-ReadImpl.cpp", - "jni/OzoneFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/InkCartridgeMonitoringClient-ReadImpl.cpp", - "jni/InkCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/CeramicFilterMonitoringClient-ReadImpl.cpp", - "jni/CeramicFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/ActivatedCarbonFilterMonitoringClient-ReadImpl.cpp", - "jni/ActivatedCarbonFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/FuelTankMonitoringClient-ReadImpl.cpp", - "jni/FuelTankMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/UvFilterMonitoringClient-ReadImpl.cpp", + "jni/UnitTestingClient-ReadImpl.cpp", + "jni/UserLabelClient-InvokeSubscribeImpl.cpp", + "jni/UserLabelClient-ReadImpl.cpp", "jni/UvFilterMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/TonerCartridgeMonitoringClient-ReadImpl.cpp", - "jni/TonerCartridgeMonitoringClient-InvokeSubscribeImpl.cpp", - "jni/IcdManagementClient-ReadImpl.cpp", - "jni/IcdManagementClient-InvokeSubscribeImpl.cpp", + "jni/UvFilterMonitoringClient-ReadImpl.cpp", + "jni/WakeOnLanClient-InvokeSubscribeImpl.cpp", + "jni/WakeOnLanClient-ReadImpl.cpp", + "jni/WaterTankMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/WaterTankMonitoringClient-ReadImpl.cpp", + "jni/WiFiNetworkDiagnosticsClient-InvokeSubscribeImpl.cpp", + "jni/WiFiNetworkDiagnosticsClient-ReadImpl.cpp", + "jni/WindowCoveringClient-InvokeSubscribeImpl.cpp", + "jni/WindowCoveringClient-ReadImpl.cpp", + "jni/ZeoliteFilterMonitoringClient-InvokeSubscribeImpl.cpp", + "jni/ZeoliteFilterMonitoringClient-ReadImpl.cpp", ] deps = [ diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b05b5821804791..13d57667665187 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -525,6 +525,16 @@ client cluster BinaryInputBasic = 15 { readonly attribute int16u clusterRevision = 65533; } +/** Cluster to control pulse width modulation */ +client cluster PulseWidthModulation = 28 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ client cluster Descriptor = 29 { struct DeviceTypeStruct { @@ -2072,6 +2082,152 @@ client cluster EthernetNetworkDiagnostics = 55 { command ResetCounts(): DefaultSuccess = 0; } +/** Accurate time is required for a number of reasons, including scheduling, display and validating security materials. */ +client cluster TimeSynchronization = 56 { + enum GranularityEnum : ENUM8 { + kNoTimeGranularity = 0; + kMinutesGranularity = 1; + kSecondsGranularity = 2; + kMillisecondsGranularity = 3; + kMicrosecondsGranularity = 4; + } + + enum StatusCode : ENUM8 { + kTimeNotAccepted = 2; + } + + enum TimeSourceEnum : ENUM8 { + kNone = 0; + kUnknown = 1; + kAdmin = 2; + kNodeTimeCluster = 3; + kNonMatterSNTP = 4; + kNonMatterNTP = 5; + kMatterSNTP = 6; + kMatterNTP = 7; + kMixedNTP = 8; + kNonMatterSNTPNTS = 9; + kNonMatterNTPNTS = 10; + kMatterSNTPNTS = 11; + kMatterNTPNTS = 12; + kMixedNTPNTS = 13; + kCloudSource = 14; + kPtp = 15; + kGnss = 16; + } + + enum TimeZoneDatabaseEnum : ENUM8 { + kFull = 0; + kPartial = 1; + kNone = 2; + } + + bitmap TimeSynchronizationFeature : BITMAP32 { + kTimeZone = 0x1; + kNTPClient = 0x2; + kNTPServer = 0x4; + kTimeSyncClient = 0x8; + } + + struct DSTOffsetStruct { + int32s offset = 0; + epoch_us validStarting = 1; + nullable epoch_us validUntil = 2; + } + + struct FabricScopedTrustedTimeSourceStruct { + node_id nodeID = 0; + endpoint_no endpoint = 1; + } + + struct TimeZoneStruct { + int32s offset = 0; + epoch_us validAt = 1; + optional char_string<64> name = 2; + } + + struct TrustedTimeSourceStruct { + fabric_idx fabricIndex = 0; + node_id nodeID = 1; + endpoint_no endpoint = 2; + } + + info event DSTTableEmpty = 0 { + } + + info event DSTStatus = 1 { + boolean DSTOffsetActive = 0; + } + + info event TimeZoneStatus = 2 { + INT32S offset = 0; + optional CHAR_STRING name = 1; + } + + info event TimeFailure = 3 { + } + + info event MissingTrustedTimeSource = 4 { + } + + readonly attribute nullable epoch_us UTCTime = 0; + readonly attribute GranularityEnum granularity = 1; + readonly attribute optional TimeSourceEnum timeSource = 2; + readonly attribute optional nullable TrustedTimeSourceStruct trustedTimeSource = 3; + readonly attribute optional nullable char_string<128> defaultNTP = 4; + readonly attribute optional TimeZoneStruct timeZone[] = 5; + readonly attribute optional DSTOffsetStruct DSTOffset[] = 6; + readonly attribute optional nullable epoch_us localTime = 7; + readonly attribute optional TimeZoneDatabaseEnum timeZoneDatabase = 8; + readonly attribute optional boolean NTPServerAvailable = 9; + readonly attribute optional int8u timeZoneListMaxSize = 10; + readonly attribute optional int8u DSTOffsetListMaxSize = 11; + readonly attribute optional boolean supportsDNSResolve = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetUTCTimeRequest { + epoch_us UTCTime = 0; + GranularityEnum granularity = 1; + optional TimeSourceEnum timeSource = 2; + } + + request struct SetTrustedTimeSourceRequest { + nullable FabricScopedTrustedTimeSourceStruct trustedTimeSource = 0; + } + + request struct SetTimeZoneRequest { + TimeZoneStruct timeZone[] = 0; + } + + response struct SetTimeZoneResponse = 3 { + boolean DSTOffsetRequired = 0; + } + + request struct SetDSTOffsetRequest { + DSTOffsetStruct DSTOffset[] = 0; + } + + request struct SetDefaultNTPRequest { + nullable CHAR_STRING<128> defaultNTP = 0; + } + + /** This command MAY be issued by Administrator to set the time. */ + command access(invoke: administer) SetUTCTime(SetUTCTimeRequest): DefaultSuccess = 0; + /** This command SHALL set TrustedTimeSource. */ + fabric command access(invoke: administer) SetTrustedTimeSource(SetTrustedTimeSourceRequest): DefaultSuccess = 1; + /** This command SHALL set TimeZone. */ + command access(invoke: manage) SetTimeZone(SetTimeZoneRequest): SetTimeZoneResponse = 2; + /** This command SHALL set DSTOffset. */ + command access(invoke: manage) SetDSTOffset(SetDSTOffsetRequest): DefaultSuccess = 4; + /** This command is used to set DefaultNTP. */ + command access(invoke: administer) SetDefaultNTP(SetDefaultNTPRequest): DefaultSuccess = 5; +} + /** This Cluster serves two purposes towards a Node communicating with a Bridge: indicate that the functionality on the Endpoint where it is placed (and its Parts) is bridged from a non-CHIP technology; and provide a centralized collection of attributes that the Node MAY collect to aid in conveying information regarding the Bridged Device to a user, @@ -2483,6 +2639,36 @@ client cluster UserLabel = 65 { readonly attribute int16u clusterRevision = 65533; } +/** Cluster to control Proxy Configuration */ +client cluster ProxyConfiguration = 66 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Cluster to control Proxy Discovery */ +client cluster ProxyDiscovery = 67 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Cluster to control Proxy Valid */ +client cluster ProxyValid = 68 { + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** This cluster provides an interface to a boolean state called StateValue. */ client cluster BooleanState = 69 { info event StateChange = 0 { @@ -5900,87 +6086,40 @@ client cluster UnitTesting = 4294048773 { command TestEmitTestFabricScopedEventRequest(TestEmitTestFabricScopedEventRequestRequest): TestEmitTestFabricScopedEventResponse = 21; } -endpoint 1 { - device type rootdevice = 22, version 1; - binding cluster Identify; - binding cluster Groups; - binding cluster Scenes; - binding cluster OnOff; - binding cluster OnOffSwitchConfiguration; - binding cluster LevelControl; - binding cluster BinaryInputBasic; - binding cluster Descriptor; - binding cluster Binding; - binding cluster AccessControl; - binding cluster Actions; - binding cluster BasicInformation; - binding cluster OtaSoftwareUpdateProvider; - binding cluster OtaSoftwareUpdateRequestor; - binding cluster LocalizationConfiguration; - binding cluster TimeFormatLocalization; - binding cluster UnitLocalization; - binding cluster PowerSourceConfiguration; - binding cluster PowerSource; - binding cluster GeneralCommissioning; - binding cluster NetworkCommissioning; - binding cluster DiagnosticLogs; - binding cluster GeneralDiagnostics; - binding cluster SoftwareDiagnostics; - binding cluster ThreadNetworkDiagnostics; - binding cluster WiFiNetworkDiagnostics; - binding cluster EthernetNetworkDiagnostics; - binding cluster BridgedDeviceBasicInformation; - binding cluster Switch; - binding cluster AdministratorCommissioning; - binding cluster OperationalCredentials; - binding cluster GroupKeyManagement; - binding cluster FixedLabel; - binding cluster UserLabel; - binding cluster BooleanState; - binding cluster IcdManagement; - binding cluster ModeSelect; - binding cluster AirQuality; - binding cluster HepaFilterMonitoring; - binding cluster ActivatedCarbonFilterMonitoring; - binding cluster CeramicFilterMonitoring; - binding cluster ElectrostaticFilterMonitoring; - binding cluster UvFilterMonitoring; - binding cluster IonizingFilterMonitoring; - binding cluster ZeoliteFilterMonitoring; - binding cluster OzoneFilterMonitoring; - binding cluster WaterTankMonitoring; - binding cluster FuelTankMonitoring; - binding cluster InkCartridgeMonitoring; - binding cluster TonerCartridgeMonitoring; - binding cluster DoorLock; - binding cluster WindowCovering; - binding cluster BarrierControl; - binding cluster PumpConfigurationAndControl; - binding cluster Thermostat; - binding cluster FanControl; - binding cluster ThermostatUserInterfaceConfiguration; - binding cluster ColorControl; - binding cluster BallastConfiguration; - binding cluster IlluminanceMeasurement; - binding cluster TemperatureMeasurement; - binding cluster PressureMeasurement; - binding cluster FlowMeasurement; - binding cluster RelativeHumidityMeasurement; - binding cluster OccupancySensing; - binding cluster WakeOnLan; - binding cluster Channel; - binding cluster TargetNavigator; - binding cluster MediaPlayback; - binding cluster MediaInput; - binding cluster LowPower; - binding cluster KeypadInput; - binding cluster ContentLauncher; - binding cluster AudioOutput; - binding cluster ApplicationLauncher; - binding cluster ApplicationBasic; - binding cluster AccountLogin; - binding cluster ElectricalMeasurement; - binding cluster UnitTesting; -} +/** The Fault Injection Cluster provide a means for a test harness to configure faults(for example triggering a fault in the system). */ +client cluster FaultInjection = 4294048774 { + enum FaultType : ENUM8 { + kUnspecified = 0; + kSystemFault = 1; + kInetFault = 2; + kChipFault = 3; + kCertFault = 4; + } + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct FailAtFaultRequest { + FaultType type = 0; + INT32U id = 1; + INT32U numCallsToSkip = 2; + INT32U numCallsToFail = 3; + BOOLEAN takeMutex = 4; + } + + request struct FailRandomlyAtFaultRequest { + FaultType type = 0; + INT32U id = 1; + INT8U percentage = 2; + } + + /** Configure a fault to be triggered deterministically */ + command access(invoke: manage) FailAtFault(FailAtFaultRequest): DefaultSuccess = 0; + /** Configure a fault to be triggered randomly, with a given probability defined as a percentage */ + command access(invoke: manage) FailRandomlyAtFault(FailRandomlyAtFaultRequest): DefaultSuccess = 1; +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 20574c1135c838..da9947fda4e402 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -1104,6 +1104,105 @@ private static Map readBinaryInputBasicInteractionInfo( return result; } + private static Map readPulseWidthModulationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readPulseWidthModulationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.PulseWidthModulationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterGeneratedCommandListAttributeCallback(), + readPulseWidthModulationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readPulseWidthModulationGeneratedCommandListAttributeInteractionInfo); + Map readPulseWidthModulationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.PulseWidthModulationCluster + .AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterAcceptedCommandListAttributeCallback(), + readPulseWidthModulationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readPulseWidthModulationAcceptedCommandListAttributeInteractionInfo); + Map readPulseWidthModulationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readEventListAttribute( + (ChipClusters.PulseWidthModulationCluster.EventListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterEventListAttributeCallback(), + readPulseWidthModulationEventListCommandParams); + result.put("readEventListAttribute", readPulseWidthModulationEventListAttributeInteractionInfo); + Map readPulseWidthModulationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.PulseWidthModulationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedPulseWidthModulationClusterAttributeListAttributeCallback(), + readPulseWidthModulationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", + readPulseWidthModulationAttributeListAttributeInteractionInfo); + Map readPulseWidthModulationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readPulseWidthModulationFeatureMapCommandParams); + result.put( + "readFeatureMapAttribute", readPulseWidthModulationFeatureMapAttributeInteractionInfo); + Map readPulseWidthModulationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readPulseWidthModulationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.PulseWidthModulationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readPulseWidthModulationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readPulseWidthModulationClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readDescriptorInteractionInfo() { Map result = new LinkedHashMap<>(); Map readDescriptorDeviceTypeListCommandParams = @@ -5598,6 +5697,270 @@ private static Map readEthernetNetworkDiagnosticsIntera return result; } + private static Map readTimeSynchronizationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readTimeSynchronizationUTCTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationUTCTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readUTCTimeAttribute( + (ChipClusters.TimeSynchronizationCluster.UTCTimeAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterUTCTimeAttributeCallback(), + readTimeSynchronizationUTCTimeCommandParams); + result.put("readUTCTimeAttribute", readTimeSynchronizationUTCTimeAttributeInteractionInfo); + Map readTimeSynchronizationGranularityCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationGranularityAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readGranularityAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationGranularityCommandParams); + result.put( + "readGranularityAttribute", readTimeSynchronizationGranularityAttributeInteractionInfo); + Map readTimeSynchronizationTimeSourceCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeSourceAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeSourceAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeSourceCommandParams); + result.put( + "readTimeSourceAttribute", readTimeSynchronizationTimeSourceAttributeInteractionInfo); + Map readTimeSynchronizationDefaultNTPCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDefaultNTPAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDefaultNTPAttribute( + (ChipClusters.TimeSynchronizationCluster.DefaultNTPAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterDefaultNTPAttributeCallback(), + readTimeSynchronizationDefaultNTPCommandParams); + result.put( + "readDefaultNTPAttribute", readTimeSynchronizationDefaultNTPAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneAttribute( + (ChipClusters.TimeSynchronizationCluster.TimeZoneAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterTimeZoneAttributeCallback(), + readTimeSynchronizationTimeZoneCommandParams); + result.put("readTimeZoneAttribute", readTimeSynchronizationTimeZoneAttributeInteractionInfo); + Map readTimeSynchronizationDSTOffsetCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDSTOffsetAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDSTOffsetAttribute( + (ChipClusters.TimeSynchronizationCluster.DSTOffsetAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterDSTOffsetAttributeCallback(), + readTimeSynchronizationDSTOffsetCommandParams); + result.put("readDSTOffsetAttribute", readTimeSynchronizationDSTOffsetAttributeInteractionInfo); + Map readTimeSynchronizationLocalTimeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationLocalTimeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readLocalTimeAttribute( + (ChipClusters.TimeSynchronizationCluster.LocalTimeAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterLocalTimeAttributeCallback(), + readTimeSynchronizationLocalTimeCommandParams); + result.put("readLocalTimeAttribute", readTimeSynchronizationLocalTimeAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneDatabaseCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneDatabaseAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneDatabaseAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeZoneDatabaseCommandParams); + result.put( + "readTimeZoneDatabaseAttribute", + readTimeSynchronizationTimeZoneDatabaseAttributeInteractionInfo); + Map readTimeSynchronizationNTPServerAvailableCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationNTPServerAvailableAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readNTPServerAvailableAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTimeSynchronizationNTPServerAvailableCommandParams); + result.put( + "readNTPServerAvailableAttribute", + readTimeSynchronizationNTPServerAvailableAttributeInteractionInfo); + Map readTimeSynchronizationTimeZoneListMaxSizeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationTimeZoneListMaxSizeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readTimeZoneListMaxSizeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationTimeZoneListMaxSizeCommandParams); + result.put( + "readTimeZoneListMaxSizeAttribute", + readTimeSynchronizationTimeZoneListMaxSizeAttributeInteractionInfo); + Map readTimeSynchronizationDSTOffsetListMaxSizeCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationDSTOffsetListMaxSizeAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readDSTOffsetListMaxSizeAttribute( + (ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationDSTOffsetListMaxSizeCommandParams); + result.put( + "readDSTOffsetListMaxSizeAttribute", + readTimeSynchronizationDSTOffsetListMaxSizeAttributeInteractionInfo); + Map readTimeSynchronizationSupportsDNSResolveCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationSupportsDNSResolveAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readSupportsDNSResolveAttribute( + (ChipClusters.BooleanAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readTimeSynchronizationSupportsDNSResolveCommandParams); + result.put( + "readSupportsDNSResolveAttribute", + readTimeSynchronizationSupportsDNSResolveAttributeInteractionInfo); + Map readTimeSynchronizationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.TimeSynchronizationCluster + .GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterGeneratedCommandListAttributeCallback(), + readTimeSynchronizationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readTimeSynchronizationGeneratedCommandListAttributeInteractionInfo); + Map readTimeSynchronizationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.TimeSynchronizationCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterAcceptedCommandListAttributeCallback(), + readTimeSynchronizationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readTimeSynchronizationAcceptedCommandListAttributeInteractionInfo); + Map readTimeSynchronizationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readEventListAttribute( + (ChipClusters.TimeSynchronizationCluster.EventListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterEventListAttributeCallback(), + readTimeSynchronizationEventListCommandParams); + result.put("readEventListAttribute", readTimeSynchronizationEventListAttributeInteractionInfo); + Map readTimeSynchronizationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.TimeSynchronizationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedTimeSynchronizationClusterAttributeListAttributeCallback(), + readTimeSynchronizationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readTimeSynchronizationAttributeListAttributeInteractionInfo); + Map readTimeSynchronizationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readTimeSynchronizationFeatureMapCommandParams); + result.put( + "readFeatureMapAttribute", readTimeSynchronizationFeatureMapAttributeInteractionInfo); + Map readTimeSynchronizationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readTimeSynchronizationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.TimeSynchronizationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readTimeSynchronizationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readTimeSynchronizationClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readBridgedDeviceBasicInformationInteractionInfo() { Map result = new LinkedHashMap<>(); Map readBridgedDeviceBasicInformationVendorNameCommandParams = @@ -6714,6 +7077,277 @@ private static Map readUserLabelInteractionInfo() { return result; } + private static Map readProxyConfigurationInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyConfigurationGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyConfigurationCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterGeneratedCommandListAttributeCallback(), + readProxyConfigurationGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyConfigurationGeneratedCommandListAttributeInteractionInfo); + Map readProxyConfigurationAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyConfigurationCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterAcceptedCommandListAttributeCallback(), + readProxyConfigurationAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyConfigurationAcceptedCommandListAttributeInteractionInfo); + Map readProxyConfigurationEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyConfigurationCluster.EventListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterEventListAttributeCallback(), + readProxyConfigurationEventListCommandParams); + result.put("readEventListAttribute", readProxyConfigurationEventListAttributeInteractionInfo); + Map readProxyConfigurationAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyConfigurationCluster.AttributeListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyConfigurationClusterAttributeListAttributeCallback(), + readProxyConfigurationAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readProxyConfigurationAttributeListAttributeInteractionInfo); + Map readProxyConfigurationFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyConfigurationFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyConfigurationFeatureMapAttributeInteractionInfo); + Map readProxyConfigurationClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyConfigurationClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyConfigurationCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyConfigurationClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", + readProxyConfigurationClusterRevisionAttributeInteractionInfo); + + return result; + } + + private static Map readProxyDiscoveryInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyDiscoveryGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyDiscoveryCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterGeneratedCommandListAttributeCallback(), + readProxyDiscoveryGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyDiscoveryGeneratedCommandListAttributeInteractionInfo); + Map readProxyDiscoveryAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyDiscoveryCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterAcceptedCommandListAttributeCallback(), + readProxyDiscoveryAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyDiscoveryAcceptedCommandListAttributeInteractionInfo); + Map readProxyDiscoveryEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyDiscoveryCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyDiscoveryClusterEventListAttributeCallback(), + readProxyDiscoveryEventListCommandParams); + result.put("readEventListAttribute", readProxyDiscoveryEventListAttributeInteractionInfo); + Map readProxyDiscoveryAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyDiscoveryCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyDiscoveryClusterAttributeListAttributeCallback(), + readProxyDiscoveryAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readProxyDiscoveryAttributeListAttributeInteractionInfo); + Map readProxyDiscoveryFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyDiscoveryFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyDiscoveryFeatureMapAttributeInteractionInfo); + Map readProxyDiscoveryClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyDiscoveryClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyDiscoveryCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyDiscoveryClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readProxyDiscoveryClusterRevisionAttributeInteractionInfo); + + return result; + } + + private static Map readProxyValidInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readProxyValidGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.ProxyValidCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyValidClusterGeneratedCommandListAttributeCallback(), + readProxyValidGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readProxyValidGeneratedCommandListAttributeInteractionInfo); + Map readProxyValidAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.ProxyValidCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedProxyValidClusterAcceptedCommandListAttributeCallback(), + readProxyValidAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readProxyValidAcceptedCommandListAttributeInteractionInfo); + Map readProxyValidEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readEventListAttribute( + (ChipClusters.ProxyValidCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyValidClusterEventListAttributeCallback(), + readProxyValidEventListCommandParams); + result.put("readEventListAttribute", readProxyValidEventListAttributeInteractionInfo); + Map readProxyValidAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.ProxyValidCluster.AttributeListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedProxyValidClusterAttributeListAttributeCallback(), + readProxyValidAttributeListCommandParams); + result.put("readAttributeListAttribute", readProxyValidAttributeListAttributeInteractionInfo); + Map readProxyValidFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readProxyValidFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readProxyValidFeatureMapAttributeInteractionInfo); + Map readProxyValidClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readProxyValidClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ProxyValidCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readProxyValidClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readProxyValidClusterRevisionAttributeInteractionInfo); + + return result; + } + private static Map readBooleanStateInteractionInfo() { Map result = new LinkedHashMap<>(); Map readBooleanStateStateValueCommandParams = @@ -18516,6 +19150,96 @@ private static Map readUnitTestingInteractionInfo() { return result; } + private static Map readFaultInjectionInteractionInfo() { + Map result = new LinkedHashMap<>(); + Map readFaultInjectionGeneratedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionGeneratedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readGeneratedCommandListAttribute( + (ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback(), + readFaultInjectionGeneratedCommandListCommandParams); + result.put( + "readGeneratedCommandListAttribute", + readFaultInjectionGeneratedCommandListAttributeInteractionInfo); + Map readFaultInjectionAcceptedCommandListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionAcceptedCommandListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readAcceptedCommandListAttribute( + (ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback) + callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback(), + readFaultInjectionAcceptedCommandListCommandParams); + result.put( + "readAcceptedCommandListAttribute", + readFaultInjectionAcceptedCommandListAttributeInteractionInfo); + Map readFaultInjectionEventListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionEventListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readEventListAttribute( + (ChipClusters.FaultInjectionCluster.EventListAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedFaultInjectionClusterEventListAttributeCallback(), + readFaultInjectionEventListCommandParams); + result.put("readEventListAttribute", readFaultInjectionEventListAttributeInteractionInfo); + Map readFaultInjectionAttributeListCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionAttributeListAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readAttributeListAttribute( + (ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback) callback); + }, + () -> + new ClusterInfoMapping + .DelegatedFaultInjectionClusterAttributeListAttributeCallback(), + readFaultInjectionAttributeListCommandParams); + result.put( + "readAttributeListAttribute", readFaultInjectionAttributeListAttributeInteractionInfo); + Map readFaultInjectionFeatureMapCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionFeatureMapAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readFeatureMapAttribute((ChipClusters.LongAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readFaultInjectionFeatureMapCommandParams); + result.put("readFeatureMapAttribute", readFaultInjectionFeatureMapAttributeInteractionInfo); + Map readFaultInjectionClusterRevisionCommandParams = + new LinkedHashMap(); + InteractionInfo readFaultInjectionClusterRevisionAttributeInteractionInfo = + new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.FaultInjectionCluster) cluster) + .readClusterRevisionAttribute((ChipClusters.IntegerAttributeCallback) callback); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readFaultInjectionClusterRevisionCommandParams); + result.put( + "readClusterRevisionAttribute", readFaultInjectionClusterRevisionAttributeInteractionInfo); + + return result; + } + @SuppressWarnings("serial") public Map> getReadAttributeMap() { @@ -18528,6 +19252,7 @@ public Map> getReadAttributeMap() { put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo()); put("levelControl", readLevelControlInteractionInfo()); put("binaryInputBasic", readBinaryInputBasicInteractionInfo()); + put("pulseWidthModulation", readPulseWidthModulationInteractionInfo()); put("descriptor", readDescriptorInteractionInfo()); put("binding", readBindingInteractionInfo()); put("accessControl", readAccessControlInteractionInfo()); @@ -18548,6 +19273,7 @@ public Map> getReadAttributeMap() { put("threadNetworkDiagnostics", readThreadNetworkDiagnosticsInteractionInfo()); put("wiFiNetworkDiagnostics", readWiFiNetworkDiagnosticsInteractionInfo()); put("ethernetNetworkDiagnostics", readEthernetNetworkDiagnosticsInteractionInfo()); + put("timeSynchronization", readTimeSynchronizationInteractionInfo()); put("bridgedDeviceBasicInformation", readBridgedDeviceBasicInformationInteractionInfo()); put("switch", readSwitchInteractionInfo()); put("administratorCommissioning", readAdministratorCommissioningInteractionInfo()); @@ -18555,6 +19281,9 @@ public Map> getReadAttributeMap() { put("groupKeyManagement", readGroupKeyManagementInteractionInfo()); put("fixedLabel", readFixedLabelInteractionInfo()); put("userLabel", readUserLabelInteractionInfo()); + put("proxyConfiguration", readProxyConfigurationInteractionInfo()); + put("proxyDiscovery", readProxyDiscoveryInteractionInfo()); + put("proxyValid", readProxyValidInteractionInfo()); put("booleanState", readBooleanStateInteractionInfo()); put("icdManagement", readIcdManagementInteractionInfo()); put("modeSelect", readModeSelectInteractionInfo()); @@ -18604,6 +19333,7 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); + put("faultInjection", readFaultInjectionInteractionInfo()); } }; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index c3d7038d4358b6..b58f840370f8a2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -345,6 +345,8 @@ public Map> getWriteAttributeMap() { writeBinaryInputBasicInteractionInfo.put( "writeReliabilityAttribute", writeBinaryInputBasicReliabilityAttributeInteractionInfo); writeAttributeMap.put("binaryInputBasic", writeBinaryInputBasicInteractionInfo); + Map writePulseWidthModulationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("pulseWidthModulation", writePulseWidthModulationInteractionInfo); Map writeDescriptorInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("descriptor", writeDescriptorInteractionInfo); Map writeBindingInteractionInfo = new LinkedHashMap<>(); @@ -553,6 +555,8 @@ public Map> getWriteAttributeMap() { new LinkedHashMap<>(); writeAttributeMap.put( "ethernetNetworkDiagnostics", writeEthernetNetworkDiagnosticsInteractionInfo); + Map writeTimeSynchronizationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("timeSynchronization", writeTimeSynchronizationInteractionInfo); Map writeBridgedDeviceBasicInformationInteractionInfo = new LinkedHashMap<>(); Map writeBridgedDeviceBasicInformationNodeLabelCommandParams = @@ -589,6 +593,12 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("fixedLabel", writeFixedLabelInteractionInfo); Map writeUserLabelInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("userLabel", writeUserLabelInteractionInfo); + Map writeProxyConfigurationInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyConfiguration", writeProxyConfigurationInteractionInfo); + Map writeProxyDiscoveryInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyDiscovery", writeProxyDiscoveryInteractionInfo); + Map writeProxyValidInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("proxyValid", writeProxyValidInteractionInfo); Map writeBooleanStateInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("booleanState", writeBooleanStateInteractionInfo); Map writeIcdManagementInteractionInfo = new LinkedHashMap<>(); @@ -3878,6 +3888,8 @@ public Map> getWriteAttributeMap() { writeUnitTestingInteractionInfo.put( "writeWriteOnlyInt8uAttribute", writeUnitTestingWriteOnlyInt8uAttributeInteractionInfo); writeAttributeMap.put("unitTesting", writeUnitTestingInteractionInfo); + Map writeFaultInjectionInteractionInfo = new LinkedHashMap<>(); + writeAttributeMap.put("faultInjection", writeFaultInjectionInteractionInfo); return writeAttributeMap; } } diff --git a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt index c4ecf0256ace49..a27e442a4ba785 100644 --- a/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt +++ b/src/controller/java/templates/CHIPAttributeTLVValueDecoder-src.zapt @@ -37,7 +37,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR switch (aPath.mClusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} case app::Clusters::{{asUpperCamelCase name}}::Id: { using namespace app::Clusters::{{asUpperCamelCase name}}; switch (aPath.mAttributeId) @@ -61,7 +61,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - {{/all_user_clusters}} + {{/zcl_clusters}} default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/templates/CHIPClustersWrite-JNI.zapt b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt index 2a77e14c42d1bb..e7744ed2fc8e5e 100644 --- a/src/controller/java/templates/CHIPClustersWrite-JNI.zapt +++ b/src/controller/java/templates/CHIPClustersWrite-JNI.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include #include "CHIPInvokeCallbacks.h" @@ -29,7 +28,7 @@ using namespace chip; using namespace chip::Controller; -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_attributes_server removeKeys='isOptional'}} {{#if_unsupported_attribute_callback type isArray ../id}} {{else}} @@ -77,7 +76,6 @@ JNI_METHOD(void, {{asUpperCamelCase ../name}}Cluster, write{{asUpperCamelCase na {{/if}} {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} #pragma clang diagnostic pop diff --git a/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt b/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt index a9e78ba6590ff8..1a7fb3b853e344 100644 --- a/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt +++ b/src/controller/java/templates/CHIPEventTLVValueDecoder-src.zapt @@ -37,7 +37,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & switch (aPath.mClusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} case app::Clusters::{{asUpperCamelCase name}}::Id: { using namespace app::Clusters::{{asUpperCamelCase name}}; switch (aPath.mEventId) @@ -82,7 +82,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - {{/all_user_clusters}} + {{/zcl_clusters}} default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt index 29a6769214ee7e..b9e5f54409d65d 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks-src.zapt @@ -14,7 +14,7 @@ namespace chip { -{{#all_user_clusters}} +{{#zcl_clusters}} {{#zcl_commands_source_server}} CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback::CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callback(jobject javaCallback): Callback::Callback(CallbackFn, this) { @@ -70,5 +70,5 @@ void CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Callbac env->CallVoidMethod(javaCallbackRef, javaMethod{{#zcl_command_arguments}}, {{asSymbol label}}{{/zcl_command_arguments}}); } {{/zcl_commands_source_server}} -{{/all_user_clusters}} +{{/zcl_clusters}} } // namespace chip diff --git a/src/controller/java/templates/CHIPInvokeCallbacks.zapt b/src/controller/java/templates/CHIPInvokeCallbacks.zapt index 59adcfe73961f0..1edf8811986e11 100644 --- a/src/controller/java/templates/CHIPInvokeCallbacks.zapt +++ b/src/controller/java/templates/CHIPInvokeCallbacks.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include @@ -8,7 +7,7 @@ namespace chip { -{{#all_user_clusters}} +{{#zcl_clusters}} {{#zcl_commands_source_server}} class CHIP{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase commandName}}Callback : public Callback::Callback { @@ -24,6 +23,5 @@ private: }; {{/zcl_commands_source_server}} -{{/all_user_clusters}} +{{/zcl_clusters}} } // namespace chip -{{/if_enabled_clusters}} diff --git a/src/controller/java/templates/CHIPReadCallbacks-src.zapt b/src/controller/java/templates/CHIPReadCallbacks-src.zapt index 5a643e5369079d..e45548df890964 100644 --- a/src/controller/java/templates/CHIPReadCallbacks-src.zapt +++ b/src/controller/java/templates/CHIPReadCallbacks-src.zapt @@ -1,5 +1,4 @@ {{> header}} -{{#if_enabled_clusters side='client'}} #include #include @@ -85,7 +84,7 @@ void CHIP{{chipCallback.name}}AttributeCallback::CallbackFn(void * context, {{ch {{/unless}} {{/chip_server_global_responses}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_attributes_server removeKeys='isOptional'}} {{! TODO: Add support for struct-typed attributes }} {{#if_unsupported_attribute_callback type isArray ../id}} @@ -173,6 +172,4 @@ void CHIP{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallb {{/if}} {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} -{{/all_user_clusters}} - -{{/if_enabled_clusters}} +{{/zcl_clusters}} diff --git a/src/controller/java/templates/ChipClusters-java.zapt b/src/controller/java/templates/ChipClusters-java.zapt index d46005ce04ff9b..92621720aba6b4 100644 --- a/src/controller/java/templates/ChipClusters-java.zapt +++ b/src/controller/java/templates/ChipClusters-java.zapt @@ -102,7 +102,7 @@ public class ChipClusters { } } - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} public static class {{asUpperCamelCase name}}Cluster extends BaseChipCluster { public static final long CLUSTER_ID = {{code}}L; @@ -245,6 +245,6 @@ public class ChipClusters { {{#not_last}} {{/not_last}} - {{/all_user_clusters}} + {{/zcl_clusters}} } {{/if_enabled_clusters}} diff --git a/src/controller/java/templates/ChipEventStructs-java.zapt b/src/controller/java/templates/ChipEventStructs-java.zapt index e180b3c3a75b70..51a1e91ee299fe 100644 --- a/src/controller/java/templates/ChipEventStructs-java.zapt +++ b/src/controller/java/templates/ChipEventStructs-java.zapt @@ -1,17 +1,14 @@ {{> header}} package chip.devicecontroller; -{{#if_enabled_clusters side='client'}} import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Optional; -{{/if_enabled_clusters}} {{! TODO: Use AutoValue for inner classes. }} public class ChipEventStructs { -{{#if_enabled_clusters side='client'}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_events}} public static class {{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase name}}Event { {{#zcl_event_fields}} @@ -54,6 +51,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL } {{/zcl_events}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} } \ No newline at end of file diff --git a/src/controller/java/templates/ChipIdLookup-java.zapt b/src/controller/java/templates/ChipIdLookup-java.zapt index aa744a98cd94ac..cd2475af515b1a 100644 --- a/src/controller/java/templates/ChipIdLookup-java.zapt +++ b/src/controller/java/templates/ChipIdLookup-java.zapt @@ -9,11 +9,11 @@ public final class ChipIdLookup { * ID is found, returns an empty string. */ public static String clusterIdToName(long clusterId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { return "{{asUpperCamelCase name}}"; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } @@ -22,7 +22,7 @@ public final class ChipIdLookup { * If no matching IDs are found, returns an empty string. */ public static String attributeIdToName(long clusterId, long attributeId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { {{#zcl_attributes_server}} if (attributeId == {{code}}L) { @@ -31,7 +31,7 @@ public final class ChipIdLookup { {{/zcl_attributes_server}} return ""; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } @@ -40,7 +40,7 @@ public final class ChipIdLookup { * If no matching IDs are found, returns an empty string. */ public static String eventIdToName(long clusterId, long eventId) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} if (clusterId == {{code}}L) { {{#zcl_events}} if (eventId == {{code}}L) { @@ -49,7 +49,7 @@ public final class ChipIdLookup { {{/zcl_events}} return ""; } - {{/all_user_clusters}} + {{/zcl_clusters}} return ""; } } diff --git a/src/controller/java/templates/ChipStructs-java.zapt b/src/controller/java/templates/ChipStructs-java.zapt index 595b47afa42830..8ab62d9308fbbf 100644 --- a/src/controller/java/templates/ChipStructs-java.zapt +++ b/src/controller/java/templates/ChipStructs-java.zapt @@ -1,17 +1,14 @@ {{> header}} package chip.devicecontroller; -{{#if_enabled_clusters side='client'}} import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Arrays; import java.util.Optional; -{{/if_enabled_clusters}} {{! TODO: Use AutoValue for inner classes. }} public class ChipStructs { -{{#if_enabled_clusters side='client'}} -{{#all_user_clusters side='client'}} +{{#zcl_clusters}} {{#zcl_structs}} {{#if itemCnt}} public static class {{asUpperCamelCase parent.name}}Cluster{{asUnderlyingType name}} { @@ -52,6 +49,5 @@ public {{asJavaType type null parent.parent.name includeAnnotations=true}} {{asL {{/if}} {{/zcl_structs}} -{{/all_user_clusters}} -{{/if_enabled_clusters}} +{{/zcl_clusters}} } \ No newline at end of file diff --git a/src/controller/java/templates/ClusterInfo-java.zapt b/src/controller/java/templates/ClusterInfo-java.zapt index 45234bd42a1b39..cb4c9893c55413 100644 --- a/src/controller/java/templates/ClusterInfo-java.zapt +++ b/src/controller/java/templates/ClusterInfo-java.zapt @@ -199,7 +199,7 @@ public class ClusterInfoMapping { callback.onFailure(e); } } - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} {{#all_user_cluster_generated_commands}} {{#if_compare clusterId ../id operator='=='}} {{#if (is_str_equal commandSource 'server')}} @@ -279,7 +279,7 @@ public class ClusterInfoMapping { {{/if_unsupported_attribute_callback}} {{/zcl_attributes_server}} - {{/all_user_clusters}} + {{/zcl_clusters}} public Map getClusterMap() { Map clusterMap = initializeClusterMap(); @@ -294,24 +294,24 @@ public class ClusterInfoMapping { public Map initializeClusterMap() { Map clusterMap = new HashMap<>(); - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} ClusterInfo {{asLowerCamelCase name}}ClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.{{asUpperCamelCase name}}Cluster(ptr, endpointId), new HashMap<>()); clusterMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInfo); - {{/all_user_clusters}} + {{/zcl_clusters}} return clusterMap; } public void combineCommand(Map destination, Map> source) { - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} destination.get("{{asLowerCamelCase name}}").combineCommands(source.get("{{asLowerCamelCase name}}")); - {{/all_user_clusters}} + {{/zcl_clusters}} } @SuppressWarnings("unchecked") public Map> getCommandMap() { Map> commandMap = new HashMap<>(); - {{#all_user_clusters side='client'}} + {{#zcl_clusters}} Map {{asLowerCamelCase name}}ClusterInteractionInfoMap = new LinkedHashMap<>(); {{#all_user_cluster_generated_commands}} {{#if_compare clusterId ../id operator='=='}} @@ -367,7 +367,7 @@ public class ClusterInfoMapping { {{/if_compare}} {{/all_user_cluster_generated_commands}} commandMap.put("{{asLowerCamelCase name}}", {{asLowerCamelCase name}}ClusterInteractionInfoMap); - {{/all_user_clusters}} + {{/zcl_clusters}} return commandMap; } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index f8a1f257a0af6b..769ead58483f84 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -1621,6 +1621,142 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::PulseWidthModulation::Id: { + using namespace app::Clusters::PulseWidthModulation; + switch (aPath.mAttributeId) + { + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::Descriptor::Id: { using namespace app::Clusters::Descriptor; switch (aPath.mAttributeId) @@ -8643,12 +8779,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::BridgedDeviceBasicInformation::Id: { - using namespace app::Clusters::BridgedDeviceBasicInformation; + case app::Clusters::TimeSynchronization::Id: { + using namespace app::Clusters::TimeSynchronization; switch (aPath.mAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; + case Attributes::UTCTime::Id: { + using TypeInfo = Attributes::UTCTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8656,38 +8792,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + if (cppValue.IsNull()) { - return nullptr; + value = nullptr; } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - static_cast(cppValue), value); - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + else { - return nullptr; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; + case Attributes::Granularity::Id: { + using TypeInfo = Attributes::Granularity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8695,11 +8814,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; + case Attributes::TimeSource::Id: { + using TypeInfo = Attributes::TimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8709,12 +8831,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; + case Attributes::TrustedTimeSource::Id: { + using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8722,11 +8844,54 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_fabricIndex; + std::string value_fabricIndexClassName = "java/lang/Integer"; + std::string value_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_fabricIndexClassName.c_str(), + value_fabricIndexCtorSignature.c_str(), + cppValue.Value().fabricIndex, value_fabricIndex); + jobject value_nodeID; + std::string value_nodeIDClassName = "java/lang/Long"; + std::string value_nodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_nodeIDClassName.c_str(), value_nodeIDCtorSignature.c_str(), cppValue.Value().nodeID, value_nodeID); + jobject value_endpoint; + std::string value_endpointClassName = "java/lang/Integer"; + std::string value_endpointCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_endpointClassName.c_str(), + value_endpointCtorSignature.c_str(), + cppValue.Value().endpoint, value_endpoint); + + jclass trustedTimeSourceStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct", + trustedTimeSourceStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct"); + return nullptr; + } + jmethodID trustedTimeSourceStructStructCtor_1 = env->GetMethodID( + trustedTimeSourceStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Long;Ljava/lang/Integer;)V"); + if (trustedTimeSourceStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTrustedTimeSourceStruct constructor"); + return nullptr; + } + + value = env->NewObject(trustedTimeSourceStructStructClass_1, trustedTimeSourceStructStructCtor_1, value_fabricIndex, + value_nodeID, value_endpoint); + } return value; } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; + case Attributes::DefaultNTP::Id: { + using TypeInfo = Attributes::DefaultNTP::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8734,14 +8899,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value(), value)); + } return value; } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; + case Attributes::TimeZone::Id: { + using TypeInfo = Attributes::TimeZone::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8749,11 +8918,62 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_offsetClassName.c_str(), + newElement_0_offsetCtorSignature.c_str(), + entry_0.offset, newElement_0_offset); + jobject newElement_0_validAt; + std::string newElement_0_validAtClassName = "java/lang/Long"; + std::string newElement_0_validAtCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validAtClassName.c_str(), + newElement_0_validAtCtorSignature.c_str(), + entry_0.validAt, newElement_0_validAt); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return nullptr; + } + jmethodID timeZoneStructStructCtor_1 = env->GetMethodID(timeZoneStructStructClass_1, "", + "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } return value; } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; + case Attributes::DSTOffset::Id: { + using TypeInfo = Attributes::DSTOffset::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8761,23 +8981,64 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) { - return nullptr; + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_offsetClassName.c_str(), + newElement_0_offsetCtorSignature.c_str(), + entry_0.offset, newElement_0_offset); + jobject newElement_0_validStarting; + std::string newElement_0_validStartingClassName = "java/lang/Long"; + std::string newElement_0_validStartingCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validStartingClassName.c_str(), + newElement_0_validStartingCtorSignature.c_str(), + entry_0.validStarting, newElement_0_validStarting); + jobject newElement_0_validUntil; + if (entry_0.validUntil.IsNull()) + { + newElement_0_validUntil = nullptr; + } + else + { + std::string newElement_0_validUntilClassName = "java/lang/Long"; + std::string newElement_0_validUntilCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_validUntilClassName.c_str(), newElement_0_validUntilCtorSignature.c_str(), + entry_0.validUntil.Value(), newElement_0_validUntil); + } + + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", + DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return nullptr; + } + jmethodID DSTOffsetStructStructCtor_1 = + env->GetMethodID(DSTOffsetStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + if (DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; + case Attributes::LocalTime::Id: { + using TypeInfo = Attributes::LocalTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8785,23 +9046,21 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) + if (cppValue.IsNull()) { - return nullptr; + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; + case Attributes::TimeZoneDatabase::Id: { + using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8809,11 +9068,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; + case Attributes::NTPServerAvailable::Id: { + using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8827,8 +9089,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR value); return value; } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; + case Attributes::TimeZoneListMaxSize::Id: { + using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8836,11 +9098,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; + case Attributes::DSTOffsetListMaxSize::Id: { + using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -8848,46 +9113,25 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jobject value_finish; - std::string value_finishClassName = "java/lang/Integer"; - std::string value_finishCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(value_finishClassName.c_str(), - value_finishCtorSignature.c_str(), - static_cast(cppValue.finish), value_finish); - jobject value_primaryColor; - if (cppValue.primaryColor.IsNull()) - { - value_primaryColor = nullptr; - } - else - { - std::string value_primaryColorClassName = "java/lang/Integer"; - std::string value_primaryColorCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - value_primaryColorClassName.c_str(), value_primaryColorCtorSignature.c_str(), - static_cast(cppValue.primaryColor.Value()), value_primaryColor); - } - - jclass productAppearanceStructStructClass_0; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", - productAppearanceStructStructClass_0); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); - return nullptr; - } - jmethodID productAppearanceStructStructCtor_0 = - env->GetMethodID(productAppearanceStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (productAppearanceStructStructCtor_0 == nullptr) + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::SupportsDNSResolve::Id: { + using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); return nullptr; } - - value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, - value_primaryColor); + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); return value; } case Attributes::GeneratedCommandList::Id: { @@ -9022,12 +9266,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::Switch::Id: { - using namespace app::Clusters::Switch; + case app::Clusters::BridgedDeviceBasicInformation::Id: { + using namespace app::Clusters::BridgedDeviceBasicInformation; switch (aPath.mAttributeId) { - case Attributes::NumberOfPositions::Id: { - using TypeInfo = Attributes::NumberOfPositions::TypeInfo; + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9035,14 +9279,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::CurrentPosition::Id: { - using TypeInfo = Attributes::CurrentPosition::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9052,12 +9293,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); return value; } - case Attributes::MultiPressMax::Id: { - using TypeInfo = Attributes::MultiPressMax::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9065,14 +9306,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9080,23 +9318,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9104,23 +9330,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9128,23 +9345,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9152,23 +9357,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9176,14 +9372,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9191,24 +9384,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } - case app::Clusters::AdministratorCommissioning::Id: { - using namespace app::Clusters::AdministratorCommissioning; - switch (aPath.mAttributeId) - { - case Attributes::WindowStatus::Id: { - using TypeInfo = Attributes::WindowStatus::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9216,14 +9396,11 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - static_cast(cppValue), value); + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AdminFabricIndex::Id: { - using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9231,21 +9408,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - if (cppValue.IsNull()) + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - value = nullptr; + return nullptr; } - else + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + return nullptr; } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); return value; } - case Attributes::AdminVendorId::Id: { - using TypeInfo = Attributes::AdminVendorId::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9253,17 +9444,73 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - if (cppValue.IsNull()) + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, + value); + return value; + } + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { - value = nullptr; + return nullptr; + } + jobject value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); + return value; + } + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + jobject value_finish; + std::string value_finishClassName = "java/lang/Integer"; + std::string value_finishCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_finishClassName.c_str(), + value_finishCtorSignature.c_str(), + static_cast(cppValue.finish), value_finish); + jobject value_primaryColor; + if (cppValue.primaryColor.IsNull()) + { + value_primaryColor = nullptr; } else { - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + std::string value_primaryColorClassName = "java/lang/Integer"; + std::string value_primaryColorCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_primaryColorClassName.c_str(), value_primaryColorCtorSignature.c_str(), + static_cast(cppValue.primaryColor.Value()), value_primaryColor); + } + + jclass productAppearanceStructStructClass_0; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct", + productAppearanceStructStructClass_0); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct"); + return nullptr; + } + jmethodID productAppearanceStructStructCtor_0 = + env->GetMethodID(productAppearanceStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (productAppearanceStructStructCtor_0 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$BridgedDeviceBasicInformationClusterProductAppearanceStruct constructor"); + return nullptr; } + + value = env->NewObject(productAppearanceStructStructClass_0, productAppearanceStructStructCtor_0, value_finish, + value_primaryColor); return value; } case Attributes::GeneratedCommandList::Id: { @@ -9398,12 +9645,57 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::OperationalCredentials::Id: { - using namespace app::Clusters::OperationalCredentials; + case app::Clusters::Switch::Id: { + using namespace app::Clusters::Switch; switch (aPath.mAttributeId) { - case Attributes::NOCs::Id: { - using TypeInfo = Attributes::NOCs::TypeInfo; + case Attributes::NumberOfPositions::Id: { + using TypeInfo = Attributes::NumberOfPositions::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::CurrentPosition::Id: { + using TypeInfo = Attributes::CurrentPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MultiPressMax::Id: { + using TypeInfo = Attributes::MultiPressMax::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9418,53 +9710,40 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_noc; - jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); - env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), - reinterpret_cast(entry_0.noc.data())); - newElement_0_noc = newElement_0_nocByteArray; - jobject newElement_0_icac; - if (entry_0.icac.IsNull()) - { - newElement_0_icac = nullptr; - } - else - { - jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); - env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), - reinterpret_cast(entry_0.icac.Value().data())); - newElement_0_icac = newElement_0_icacByteArray; - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return nullptr; - } - jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); - if (NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return nullptr; - } + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::Fabrics::Id: { - using TypeInfo = Attributes::Fabrics::TypeInfo; + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9479,22 +9758,366 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_rootPublicKey; - jbyteArray newElement_0_rootPublicKeyByteArray = - env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); - env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), - reinterpret_cast(entry_0.rootPublicKey.data())); - newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; - jobject newElement_0_vendorID; - std::string newElement_0_vendorIDClassName = "java/lang/Integer"; - std::string newElement_0_vendorIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), - static_cast(entry_0.vendorID), newElement_0_vendorID); - jobject newElement_0_fabricID; - std::string newElement_0_fabricIDClassName = "java/lang/Long"; - std::string newElement_0_fabricIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::AdministratorCommissioning::Id: { + using namespace app::Clusters::AdministratorCommissioning; + switch (aPath.mAttributeId) + { + case Attributes::WindowStatus::Id: { + using TypeInfo = Attributes::WindowStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + static_cast(cppValue), value); + return value; + } + case Attributes::AdminFabricIndex::Id: { + using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::AdminVendorId::Id: { + using TypeInfo = Attributes::AdminVendorId::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue.Value(), value); + } + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::OperationalCredentials::Id: { + using namespace app::Clusters::OperationalCredentials; + switch (aPath.mAttributeId) + { + case Attributes::NOCs::Id: { + using TypeInfo = Attributes::NOCs::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_noc; + jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); + env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), + reinterpret_cast(entry_0.noc.data())); + newElement_0_noc = newElement_0_nocByteArray; + jobject newElement_0_icac; + if (entry_0.icac.IsNull()) + { + newElement_0_icac = nullptr; + } + else + { + jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); + env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), + reinterpret_cast(entry_0.icac.Value().data())); + newElement_0_icac = newElement_0_icacByteArray; + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass NOCStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); + return nullptr; + } + jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); + if (NOCStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, + newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_rootPublicKey; + jbyteArray newElement_0_rootPublicKeyByteArray = + env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); + env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), + reinterpret_cast(entry_0.rootPublicKey.data())); + newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; + jobject newElement_0_vendorID; + std::string newElement_0_vendorIDClassName = "java/lang/Integer"; + std::string newElement_0_vendorIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), + static_cast(entry_0.vendorID), newElement_0_vendorID); + jobject newElement_0_fabricID; + std::string newElement_0_fabricIDClassName = "java/lang/Long"; + std::string newElement_0_fabricIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, newElement_0_fabricID); jobject newElement_0_nodeID; @@ -9512,33 +10135,501 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass fabricDescriptorStructStructClass_1; + jclass fabricDescriptorStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + return nullptr; + } + jmethodID fabricDescriptorStructStructCtor_1 = env->GetMethodID( + fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); + if (fabricDescriptorStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, + newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::SupportedFabrics::Id: { + using TypeInfo = Attributes::SupportedFabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::CommissionedFabrics::Id: { + using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::TrustedRootCertificates::Id: { + using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::CurrentFabricIndex::Id: { + using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::GroupKeyManagement::Id: { + using namespace app::Clusters::GroupKeyManagement; + switch (aPath.mAttributeId) + { + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), + entry_0.groupId, newElement_0_groupId); + jobject newElement_0_groupKeySetID; + std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; + std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), + newElement_0_groupKeySetIDCtorSignature.c_str(), + entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupKeyMapStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", + groupKeyMapStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); return nullptr; } - jmethodID fabricDescriptorStructStructCtor_1 = env->GetMethodID( - fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); - if (fabricDescriptorStructStructCtor_1 == nullptr) + jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID( + groupKeyMapStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (groupKeyMapStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, - newElement_0_nodeID, newElement_0_label, newElement_0_fabricIndex); + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, + newElement_0_groupKeySetID, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), + entry_0.groupId, newElement_0_groupId); + jobject newElement_0_endpoints; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); + + auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); + while (iter_newElement_0_endpoints_2.Next()) + { + auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); + } + jobject newElement_0_groupName; + if (!entry_0.groupName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); + } + else + { + jobject newElement_0_groupNameInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", + groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return nullptr; + } + jmethodID groupInfoMapStructStructCtor_1 = + env->GetMethodID(groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); + if (groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::SupportedFabrics::Id: { - using TypeInfo = Attributes::SupportedFabrics::TypeInfo; + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9546,14 +10637,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::CommissionedFabrics::Id: { - using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9563,12 +10654,22 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); return value; } - case Attributes::TrustedRootCertificates::Id: { - using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::FixedLabel::Id: { + using namespace app::Clusters::FixedLabel; + switch (aPath.mAttributeId) + { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9583,29 +10684,33 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); - env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), - reinterpret_cast(entry_0.data())); - newElement_0 = newElement_0ByteArray; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return nullptr; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return nullptr; + } + + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::CurrentFabricIndex::Id: { - using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -9738,12 +10843,12 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::GroupKeyManagement::Id: { - using namespace app::Clusters::GroupKeyManagement; + case app::Clusters::UserLabel::Id: { + using namespace app::Clusters::UserLabel; switch (aPath.mAttributeId) { - case Attributes::GroupKeyMap::Id: { - using TypeInfo = Attributes::GroupKeyMap::TypeInfo; + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9758,50 +10863,35 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), - entry_0.groupId, newElement_0_groupId); - jobject newElement_0_groupKeySetID; - std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; - std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), - newElement_0_groupKeySetIDCtorSignature.c_str(), - entry_0.groupKeySetID, newElement_0_groupKeySetID); - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - jclass groupKeyMapStructStructClass_1; + jclass labelStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", - groupKeyMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); return nullptr; } - jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID( - groupKeyMapStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (groupKeyMapStructStructCtor_1 == nullptr) + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); return nullptr; } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = + env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::GroupTable::Id: { - using TypeInfo = Attributes::GroupTable::TypeInfo; + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9816,71 +10906,88 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), - entry_0.groupId, newElement_0_groupId); - jobject newElement_0_endpoints; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); - - auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); - while (iter_newElement_0_endpoints_2.Next()) - { - auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); - jobject newElement_2; - std::string newElement_2ClassName = "java/lang/Integer"; - std::string newElement_2CtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); - chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); - } - jobject newElement_0_groupName; - if (!entry_0.groupName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); - } - else - { - jobject newElement_0_groupNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), - newElement_0_groupNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - jclass groupInfoMapStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", - groupInfoMapStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); - return nullptr; - } - jmethodID groupInfoMapStructStructCtor_1 = - env->GetMethodID(groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); - if (groupInfoMapStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); - return nullptr; - } + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::MaxGroupsPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9888,14 +10995,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), cppValue, value); return value; } - case Attributes::MaxGroupKeysPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -9909,6 +11016,16 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR cppValue, value); return value; } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyConfiguration::Id: { + using namespace app::Clusters::ProxyConfiguration; + switch (aPath.mAttributeId) + { case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -10041,53 +11158,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::FixedLabel::Id: { - using namespace app::Clusters::FixedLabel; + case app::Clusters::ProxyDiscovery::Id: { + using namespace app::Clusters::ProxyDiscovery; switch (aPath.mAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return nullptr; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return nullptr; - } - - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -10220,53 +11294,10 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::UserLabel::Id: { - using namespace app::Clusters::UserLabel; + case app::Clusters::ProxyValid::Id: { + using namespace app::Clusters::ProxyValid; switch (aPath.mAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return nullptr; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return nullptr; - } - - newElement_0 = - env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -27119,6 +28150,142 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::FaultInjection::Id: { + using namespace app::Clusters::FaultInjection; + switch (aPath.mAttributeId) + { + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + cppValue, value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index ecbffc60ee818b..9889badb090a46 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -107,6 +107,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::PulseWidthModulation::Id: { + using namespace app::Clusters::PulseWidthModulation; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::Descriptor::Id: { using namespace app::Clusters::Descriptor; switch (aPath.mEventId) @@ -1707,6 +1717,177 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::TimeSynchronization::Id: { + using namespace app::Clusters::TimeSynchronization; + switch (aPath.mEventId) + { + case Events::DSTTableEmpty::Id: { + Events::DSTTableEmpty::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass DSTTableEmptyStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent", + DSTTableEmptyStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent"); + return nullptr; + } + jmethodID DSTTableEmptyStructCtor = env->GetMethodID(DSTTableEmptyStructClass, "", "()V"); + if (DSTTableEmptyStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterDSTTableEmptyEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(DSTTableEmptyStructClass, DSTTableEmptyStructCtor); + + return value; + } + case Events::DSTStatus::Id: { + Events::DSTStatus::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_DSTOffsetActive; + std::string value_DSTOffsetActiveClassName = "java/lang/Boolean"; + std::string value_DSTOffsetActiveCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_DSTOffsetActiveClassName.c_str(), + value_DSTOffsetActiveCtorSignature.c_str(), + cppValue.DSTOffsetActive, value_DSTOffsetActive); + + jclass DSTStatusStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent", DSTStatusStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent"); + return nullptr; + } + jmethodID DSTStatusStructCtor = env->GetMethodID(DSTStatusStructClass, "", "(Ljava/lang/Boolean;)V"); + if (DSTStatusStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterDSTStatusEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(DSTStatusStructClass, DSTStatusStructCtor, value_DSTOffsetActive); + + return value; + } + case Events::TimeZoneStatus::Id: { + Events::TimeZoneStatus::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value_offset; + std::string value_offsetClassName = "java/lang/Long"; + std::string value_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + value_offsetClassName.c_str(), value_offsetCtorSignature.c_str(), cppValue.offset, value_offset); + + jobject value_name; + if (!cppValue.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, value_name); + } + else + { + jobject value_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.name.Value(), value_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(value_nameInsideOptional, value_name); + } + + jclass timeZoneStatusStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent", + timeZoneStatusStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent"); + return nullptr; + } + jmethodID timeZoneStatusStructCtor = + env->GetMethodID(timeZoneStatusStructClass, "", "(Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStatusStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterTimeZoneStatusEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(timeZoneStatusStructClass, timeZoneStatusStructCtor, value_offset, value_name); + + return value; + } + case Events::TimeFailure::Id: { + Events::TimeFailure::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass timeFailureStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent", timeFailureStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent"); + return nullptr; + } + jmethodID timeFailureStructCtor = env->GetMethodID(timeFailureStructClass, "", "()V"); + if (timeFailureStructCtor == nullptr) + { + ChipLogError(Zcl, "Could not find ChipEventStructs$TimeSynchronizationClusterTimeFailureEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(timeFailureStructClass, timeFailureStructCtor); + + return value; + } + case Events::MissingTrustedTimeSource::Id: { + Events::MissingTrustedTimeSource::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jclass missingTrustedTimeSourceStructClass; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent", + missingTrustedTimeSourceStructClass); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent"); + return nullptr; + } + jmethodID missingTrustedTimeSourceStructCtor = env->GetMethodID(missingTrustedTimeSourceStructClass, "", "()V"); + if (missingTrustedTimeSourceStructCtor == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipEventStructs$TimeSynchronizationClusterMissingTrustedTimeSourceEvent constructor"); + return nullptr; + } + + jobject value = env->NewObject(missingTrustedTimeSourceStructClass, missingTrustedTimeSourceStructCtor); + + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::BridgedDeviceBasicInformation::Id: { using namespace app::Clusters::BridgedDeviceBasicInformation; switch (aPath.mEventId) @@ -2149,6 +2330,36 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::ProxyConfiguration::Id: { + using namespace app::Clusters::ProxyConfiguration; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyDiscovery::Id: { + using namespace app::Clusters::ProxyDiscovery; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } + case app::Clusters::ProxyValid::Id: { + using namespace app::Clusters::ProxyValid; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::BooleanState::Id: { using namespace app::Clusters::BooleanState; switch (aPath.mEventId) @@ -3816,6 +4027,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::FaultInjection::Id: { + using namespace app::Clusters::FaultInjection; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 0c1c13cfef0297..fed93140fc0ac8 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -2174,6 +2174,68 @@ void CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, Status, LogContent, UTCTimeStamp, TimeSinceBoot); } +CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback( + jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::~CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Boolean;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject DSTOffsetRequired; + std::string DSTOffsetRequiredClassName = "java/lang/Boolean"; + std::string DSTOffsetRequiredCtorSignature = "(Z)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(DSTOffsetRequiredClassName.c_str(), + DSTOffsetRequiredCtorSignature.c_str(), + dataResponse.DSTOffsetRequired, DSTOffsetRequired); + + env->CallVoidMethod(javaCallbackRef, javaMethod, DSTOffsetRequired); +} CHIPOperationalCredentialsClusterAttestationResponseCallback::CHIPOperationalCredentialsClusterAttestationResponseCallback( jobject javaCallback) : Callback::Callback(CallbackFn, this) diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 1c0c13df135b5c..41fdc876e9a115 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -342,6 +342,21 @@ class CHIPDiagnosticLogsClusterRetrieveLogsResponseCallback jobject javaCallbackRef; }; +class CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback + : public Callback::Callback +{ +public: + CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback(jobject javaCallback); + + ~CHIPTimeSynchronizationClusterSetTimeZoneResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + class CHIPOperationalCredentialsClusterAttestationResponseCallback : public Callback::Callback { diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index a46f9158eff9fd..484a3887c3523f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -3171,6 +3171,290 @@ void CHIPBinaryInputBasicAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } +CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::CHIPPulseWidthModulationGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::~CHIPPulseWidthModulationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::CHIPPulseWidthModulationAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::~CHIPPulseWidthModulationAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationEventListAttributeCallback::CHIPPulseWidthModulationEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPPulseWidthModulationEventListAttributeCallback::~CHIPPulseWidthModulationEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPPulseWidthModulationAttributeListAttributeCallback::CHIPPulseWidthModulationAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPPulseWidthModulationAttributeListAttributeCallback::~CHIPPulseWidthModulationAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPPulseWidthModulationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + CHIPDescriptorDeviceTypeListAttributeCallback::CHIPDescriptorDeviceTypeListAttributeCallback(jobject javaCallback, bool keepAlive) : chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { @@ -14287,9 +14571,9 @@ void CHIPEthernetNetworkDiagnosticsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationUTCTimeAttributeCallback::CHIPTimeSynchronizationUTCTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14306,8 +14590,7 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() +CHIPTimeSynchronizationUTCTimeAttributeCallback::~CHIPTimeSynchronizationUTCTimeAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14318,8 +14601,8 @@ CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationUTCTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14327,9 +14610,8 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14337,31 +14619,92 @@ void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::Cal ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationDefaultNTPAttributeCallback::CHIPTimeSynchronizationDefaultNTPAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationDefaultNTPAttributeCallback::~CHIPTimeSynchronizationDefaultNTPAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTimeSynchronizationDefaultNTPAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/String;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(value.Value(), javaValue)); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationTimeZoneAttributeCallback::CHIPTimeSynchronizationTimeZoneAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14378,8 +14721,7 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: } } -CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: - ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() +CHIPTimeSynchronizationTimeZoneAttributeCallback::~CHIPTimeSynchronizationTimeZoneAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14390,8 +14732,10 @@ CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationTimeZoneAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14400,8 +14744,8 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14420,10 +14764,48 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offsetClassName.c_str(), newElement_0_offsetCtorSignature.c_str(), entry_0.offset, newElement_0_offset); + jobject newElement_0_validAt; + std::string newElement_0_validAtClassName = "java/lang/Long"; + std::string newElement_0_validAtCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validAtClassName.c_str(), + newElement_0_validAtCtorSignature.c_str(), entry_0.validAt, + newElement_0_validAt); + jobject newElement_0_name; + if (!entry_0.name.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_name); + } + else + { + jobject newElement_0_nameInsideOptional; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name.Value(), newElement_0_nameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_nameInsideOptional, newElement_0_name); + } + + jclass timeZoneStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterTimeZoneStruct", timeZoneStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterTimeZoneStruct"); + return; + } + jmethodID timeZoneStructStructCtor_1 = + env->GetMethodID(timeZoneStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/util/Optional;)V"); + if (timeZoneStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterTimeZoneStruct constructor"); + return; + } + + newElement_0 = env->NewObject(timeZoneStructStructClass_1, timeZoneStructStructCtor_1, newElement_0_offset, + newElement_0_validAt, newElement_0_name); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -14431,9 +14813,9 @@ void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::Call env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBasicInformationEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationDSTOffsetAttributeCallback::CHIPTimeSynchronizationDSTOffsetAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14450,7 +14832,7 @@ CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBa } } -CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceBasicInformationEventListAttributeCallback() +CHIPTimeSynchronizationDSTOffsetAttributeCallback::~CHIPTimeSynchronizationDSTOffsetAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14461,8 +14843,10 @@ CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceB env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationDSTOffsetAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14471,8 +14855,8 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14491,10 +14875,49 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), - newElement_0CtorSignature.c_str(), entry_0, newElement_0); + jobject newElement_0_offset; + std::string newElement_0_offsetClassName = "java/lang/Long"; + std::string newElement_0_offsetCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_offsetClassName.c_str(), newElement_0_offsetCtorSignature.c_str(), entry_0.offset, newElement_0_offset); + jobject newElement_0_validStarting; + std::string newElement_0_validStartingClassName = "java/lang/Long"; + std::string newElement_0_validStartingCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validStartingClassName.c_str(), + newElement_0_validStartingCtorSignature.c_str(), + entry_0.validStarting, newElement_0_validStarting); + jobject newElement_0_validUntil; + if (entry_0.validUntil.IsNull()) + { + newElement_0_validUntil = nullptr; + } + else + { + std::string newElement_0_validUntilClassName = "java/lang/Long"; + std::string newElement_0_validUntilCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_validUntilClassName.c_str(), + newElement_0_validUntilCtorSignature.c_str(), + entry_0.validUntil.Value(), newElement_0_validUntil); + } + + jclass DSTOffsetStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$TimeSynchronizationClusterDSTOffsetStruct", DSTOffsetStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$TimeSynchronizationClusterDSTOffsetStruct"); + return; + } + jmethodID DSTOffsetStructStructCtor_1 = + env->GetMethodID(DSTOffsetStructStructClass_1, "", "(Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;)V"); + if (DSTOffsetStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$TimeSynchronizationClusterDSTOffsetStruct constructor"); + return; + } + + newElement_0 = env->NewObject(DSTOffsetStructStructClass_1, DSTOffsetStructStructCtor_1, newElement_0_offset, + newElement_0_validStarting, newElement_0_validUntil); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -14502,9 +14925,76 @@ void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback( +CHIPTimeSynchronizationLocalTimeAttributeCallback::CHIPTimeSynchronizationLocalTimeAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPTimeSynchronizationLocalTimeAttributeCallback::~CHIPTimeSynchronizationLocalTimeAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPTimeSynchronizationLocalTimeAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::Nullable & value) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Long;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject javaValue; + if (value.IsNull()) + { + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Long"; + std::string javaValueCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); + } + + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); +} + +CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::CHIPTimeSynchronizationGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14521,7 +15011,7 @@ CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDevi } } -CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback() +CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::~CHIPTimeSynchronizationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14532,8 +15022,8 @@ CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDev env->DeleteGlobalRef(javaCallbackRef); } -void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14542,8 +15032,8 @@ void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14573,9 +15063,9 @@ void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::CHIPTimeSynchronizationAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14592,7 +15082,7 @@ CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListA } } -CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandListAttributeCallback() +CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::~CHIPTimeSynchronizationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14603,8 +15093,8 @@ CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandList env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14613,8 +15103,8 @@ void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14644,9 +15134,9 @@ void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPTimeSynchronizationEventListAttributeCallback::CHIPTimeSynchronizationEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14663,7 +15153,7 @@ CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAtt } } -CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAttributeCallback() +CHIPTimeSynchronizationEventListAttributeCallback::~CHIPTimeSynchronizationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14674,8 +15164,8 @@ CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14684,8 +15174,8 @@ void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14715,8 +15205,10 @@ void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPTimeSynchronizationAttributeListAttributeCallback::CHIPTimeSynchronizationAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14732,7 +15224,7 @@ CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobje } } -CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() +CHIPTimeSynchronizationAttributeListAttributeCallback::~CHIPTimeSynchronizationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14743,8 +15235,8 @@ CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPTimeSynchronizationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14753,8 +15245,8 @@ void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14784,8 +15276,10 @@ void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: + CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14801,7 +15295,8 @@ CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallba } } -CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallback() +CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14812,8 +15307,8 @@ CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPBridgedDeviceBasicInformationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14822,8 +15317,8 @@ void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14853,9 +15348,9 @@ void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: + CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14872,7 +15367,8 @@ CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministrat } } -CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback() +CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback:: + ~CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14883,8 +15379,8 @@ CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministra env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPBridgedDeviceBasicInformationAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14892,8 +15388,9 @@ void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14901,28 +15398,31 @@ void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject javaValue; - if (value.IsNull()) - { - javaValue = nullptr; - } - else + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - std::string javaValueClassName = "java/lang/Integer"; - std::string javaValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorCommissioningAdminVendorIdAttributeCallback( +CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CHIPBridgedDeviceBasicInformationEventListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -14939,7 +15439,7 @@ CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorC } } -CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback() +CHIPBridgedDeviceBasicInformationEventListAttributeCallback::~CHIPBridgedDeviceBasicInformationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -14950,8 +15450,8 @@ CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministrator env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable & value) +void CHIPBridgedDeviceBasicInformationEventListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -14959,8 +15459,9 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -14968,28 +15469,31 @@ void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject javaValue; - if (value.IsNull()) - { - javaValue = nullptr; - } - else + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) { - std::string javaValueClassName = "java/lang/Integer"; - std::string javaValueCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } - env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15006,8 +15510,7 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() +CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::~CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15018,8 +15521,8 @@ CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPBridgedDeviceBasicInformationAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15028,8 +15531,8 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15059,9 +15562,9 @@ void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::Callba env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPSwitchGeneratedCommandListAttributeCallback::CHIPSwitchGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15078,8 +15581,7 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: } } -CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: - ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() +CHIPSwitchGeneratedCommandListAttributeCallback::~CHIPSwitchGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15090,8 +15592,8 @@ CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchGeneratedCommandListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15100,8 +15602,8 @@ void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::Callbac VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15131,9 +15633,9 @@ void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::Callbac env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommissioningEventListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPSwitchAcceptedCommandListAttributeCallback::CHIPSwitchAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15150,7 +15652,7 @@ CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommi } } -CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorCommissioningEventListAttributeCallback() +CHIPSwitchAcceptedCommandListAttributeCallback::~CHIPSwitchAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15161,8 +15663,8 @@ CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorComm env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchAcceptedCommandListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15171,8 +15673,8 @@ void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15202,10 +15704,8 @@ void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorCommissioningAttributeListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPSwitchEventListAttributeCallback::CHIPSwitchEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15221,7 +15721,7 @@ CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorC } } -CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministratorCommissioningAttributeListAttributeCallback() +CHIPSwitchEventListAttributeCallback::~CHIPSwitchEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15232,8 +15732,8 @@ CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministrator env->DeleteGlobalRef(javaCallbackRef); } -void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPSwitchEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15242,8 +15742,8 @@ void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15273,10 +15773,8 @@ void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), - keepAlive(keepAlive) +CHIPSwitchAttributeListAttributeCallback::CHIPSwitchAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15292,7 +15790,7 @@ CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsA } } -CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCsAttributeCallback() +CHIPSwitchAttributeListAttributeCallback::~CHIPSwitchAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15303,10 +15801,8 @@ CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCs env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & - list) +void CHIPSwitchAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15315,8 +15811,8 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15335,47 +15831,10 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_noc; - jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); - env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), - reinterpret_cast(entry_0.noc.data())); - newElement_0_noc = newElement_0_nocByteArray; - jobject newElement_0_icac; - if (entry_0.icac.IsNull()) - { - newElement_0_icac = nullptr; - } - else - { - jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); - env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), - reinterpret_cast(entry_0.icac.Value().data())); - newElement_0_icac = newElement_0_icacByteArray; - } - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass NOCStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); - return; - } - jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); - if (NOCStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); - return; - } - - newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, - newElement_0_fabricIndex); + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -15383,9 +15842,9 @@ void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15402,7 +15861,7 @@ CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFa } } -CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsFabricsAttributeCallback() +CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::~CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15413,10 +15872,8 @@ CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsF env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> & list) +void CHIPAdministratorCommissioningAdminFabricIndexAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15424,9 +15881,8 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15434,79 +15890,28 @@ void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + jobject javaValue; + if (value.IsNull()) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_rootPublicKey; - jbyteArray newElement_0_rootPublicKeyByteArray = env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); - env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), - reinterpret_cast(entry_0.rootPublicKey.data())); - newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; - jobject newElement_0_vendorID; - std::string newElement_0_vendorIDClassName = "java/lang/Integer"; - std::string newElement_0_vendorIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), - static_cast(entry_0.vendorID), newElement_0_vendorID); - jobject newElement_0_fabricID; - std::string newElement_0_fabricIDClassName = "java/lang/Long"; - std::string newElement_0_fabricIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), - newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, - newElement_0_fabricID); - jobject newElement_0_nodeID; - std::string newElement_0_nodeIDClassName = "java/lang/Long"; - std::string newElement_0_nodeIDCtorSignature = "(J)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_nodeIDClassName.c_str(), newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_fabricIndex; - std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; - std::string newElement_0_fabricIndexCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), - newElement_0_fabricIndexCtorSignature.c_str(), - entry_0.fabricIndex, newElement_0_fabricIndex); - - jclass fabricDescriptorStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", - fabricDescriptorStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); - return; - } - jmethodID fabricDescriptorStructStructCtor_1 = - env->GetMethodID(fabricDescriptorStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); - if (fabricDescriptorStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); - return; - } - - newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, - newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, newElement_0_nodeID, - newElement_0_label, newElement_0_fabricIndex); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CHIPAdministratorCommissioningAdminVendorIdAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15523,8 +15928,7 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: } } -CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: - ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::~CHIPAdministratorCommissioningAdminVendorIdAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15535,8 +15939,8 @@ CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::DecodableList & list) +void CHIPAdministratorCommissioningAdminVendorIdAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -15544,9 +15948,8 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac jobject javaCallbackRef; VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15554,31 +15957,28 @@ void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::Callbac ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + jobject javaValue; + if (value.IsNull()) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); - env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), - reinterpret_cast(entry_0.data())); - newElement_0 = newElement_0ByteArray; - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + javaValue = nullptr; + } + else + { + std::string javaValueClassName = "java/lang/Integer"; + std::string javaValueCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), + value.Value(), javaValue); } - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); + env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); } -CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperationalCredentialsGeneratedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: + CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15595,7 +15995,8 @@ CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperational } } -CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationalCredentialsGeneratedCommandListAttributeCallback() +CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15606,7 +16007,7 @@ CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationa env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15616,8 +16017,8 @@ void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15647,9 +16048,9 @@ void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalCredentialsAcceptedCommandListAttributeCallback( - jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: + CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15666,7 +16067,8 @@ CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalC } } -CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperationalCredentialsAcceptedCommandListAttributeCallback() +CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback:: + ~CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15677,7 +16079,7 @@ CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperational env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15687,8 +16089,8 @@ void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15718,9 +16120,9 @@ void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentialsEventListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPAdministratorCommissioningEventListAttributeCallback::CHIPAdministratorCommissioningEventListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15737,7 +16139,7 @@ CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentials } } -CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredentialsEventListAttributeCallback() +CHIPAdministratorCommissioningEventListAttributeCallback::~CHIPAdministratorCommissioningEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15748,7 +16150,7 @@ CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredential env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningEventListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15758,8 +16160,8 @@ void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15789,9 +16191,9 @@ void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredentialsAttributeListAttributeCallback( +CHIPAdministratorCommissioningAttributeListAttributeCallback::CHIPAdministratorCommissioningAttributeListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15808,7 +16210,7 @@ CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredent } } -CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCredentialsAttributeListAttributeCallback() +CHIPAdministratorCommissioningAttributeListAttributeCallback::~CHIPAdministratorCommissioningAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15819,7 +16221,7 @@ CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCreden env->DeleteGlobalRef(javaCallbackRef); } -void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( +void CHIPAdministratorCommissioningAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15829,8 +16231,8 @@ void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15860,9 +16262,9 @@ void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOperationalCredentialsNOCsAttributeCallback::CHIPOperationalCredentialsNOCsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15879,7 +16281,7 @@ CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupK } } -CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() +CHIPOperationalCredentialsNOCsAttributeCallback::~CHIPOperationalCredentialsNOCsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15890,9 +16292,9 @@ CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroup env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsNOCsAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -15902,8 +16304,8 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -15922,18 +16324,23 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, - newElement_0_groupId); - jobject newElement_0_groupKeySetID; - std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; - std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), - newElement_0_groupKeySetIDCtorSignature.c_str(), - entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_noc; + jbyteArray newElement_0_nocByteArray = env->NewByteArray(static_cast(entry_0.noc.size())); + env->SetByteArrayRegion(newElement_0_nocByteArray, 0, static_cast(entry_0.noc.size()), + reinterpret_cast(entry_0.noc.data())); + newElement_0_noc = newElement_0_nocByteArray; + jobject newElement_0_icac; + if (entry_0.icac.IsNull()) + { + newElement_0_icac = nullptr; + } + else + { + jbyteArray newElement_0_icacByteArray = env->NewByteArray(static_cast(entry_0.icac.Value().size())); + env->SetByteArrayRegion(newElement_0_icacByteArray, 0, static_cast(entry_0.icac.Value().size()), + reinterpret_cast(entry_0.icac.Value().data())); + newElement_0_icac = newElement_0_icacByteArray; + } jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -15941,24 +16348,23 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass groupKeyMapStructStructClass_1; + jclass NOCStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", groupKeyMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterNOCStruct", NOCStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterNOCStruct"); return; } - jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID(groupKeyMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); - if (groupKeyMapStructStructCtor_1 == nullptr) + jmethodID NOCStructStructCtor_1 = env->GetMethodID(NOCStructStructClass_1, "", "([B[BLjava/lang/Integer;)V"); + if (NOCStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterNOCStruct constructor"); return; } - newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, - newElement_0_groupKeySetID, newElement_0_fabricIndex); + newElement_0 = env->NewObject(NOCStructStructClass_1, NOCStructStructCtor_1, newElement_0_noc, newElement_0_icac, + newElement_0_fabricIndex); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -15966,9 +16372,9 @@ void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPOperationalCredentialsFabricsAttributeCallback::CHIPOperationalCredentialsFabricsAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -15985,7 +16391,7 @@ CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTa } } -CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() +CHIPOperationalCredentialsFabricsAttributeCallback::~CHIPOperationalCredentialsFabricsAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -15996,10 +16402,10 @@ CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupT env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsFabricsAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList & - list) + const chip::app::DataModel::DecodableList< + chip::app::Clusters::OperationalCredentials::Structs::FabricDescriptorStruct::DecodableType> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16008,8 +16414,8 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16028,38 +16434,30 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( { auto & entry_0 = iter_arrayListObj_0.GetValue(); jobject newElement_0; - jobject newElement_0_groupId; - std::string newElement_0_groupIdClassName = "java/lang/Integer"; - std::string newElement_0_groupIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), - newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, - newElement_0_groupId); - jobject newElement_0_endpoints; - chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); - - auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); - while (iter_newElement_0_endpoints_2.Next()) - { - auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); - jobject newElement_2; - std::string newElement_2ClassName = "java/lang/Integer"; - std::string newElement_2CtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); - chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); - } - jobject newElement_0_groupName; - if (!entry_0.groupName.HasValue()) - { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); - } - else - { - jobject newElement_0_groupNameInsideOptional; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), - newElement_0_groupNameInsideOptional)); - chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); - } + jobject newElement_0_rootPublicKey; + jbyteArray newElement_0_rootPublicKeyByteArray = env->NewByteArray(static_cast(entry_0.rootPublicKey.size())); + env->SetByteArrayRegion(newElement_0_rootPublicKeyByteArray, 0, static_cast(entry_0.rootPublicKey.size()), + reinterpret_cast(entry_0.rootPublicKey.data())); + newElement_0_rootPublicKey = newElement_0_rootPublicKeyByteArray; + jobject newElement_0_vendorID; + std::string newElement_0_vendorIDClassName = "java/lang/Integer"; + std::string newElement_0_vendorIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_vendorIDClassName.c_str(), newElement_0_vendorIDCtorSignature.c_str(), + static_cast(entry_0.vendorID), newElement_0_vendorID); + jobject newElement_0_fabricID; + std::string newElement_0_fabricIDClassName = "java/lang/Long"; + std::string newElement_0_fabricIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIDClassName.c_str(), + newElement_0_fabricIDCtorSignature.c_str(), entry_0.fabricID, + newElement_0_fabricID); + jobject newElement_0_nodeID; + std::string newElement_0_nodeIDClassName = "java/lang/Long"; + std::string newElement_0_nodeIDCtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0_nodeIDClassName.c_str(), newElement_0_nodeIDCtorSignature.c_str(), entry_0.nodeID, newElement_0_nodeID); + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); jobject newElement_0_fabricIndex; std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; std::string newElement_0_fabricIndexCtorSignature = "(I)V"; @@ -16067,25 +16465,27 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( newElement_0_fabricIndexCtorSignature.c_str(), entry_0.fabricIndex, newElement_0_fabricIndex); - jclass groupInfoMapStructStructClass_1; + jclass fabricDescriptorStructStructClass_1; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", groupInfoMapStructStructClass_1); + env, "chip/devicecontroller/ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct", + fabricDescriptorStructStructClass_1); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct"); return; } - jmethodID groupInfoMapStructStructCtor_1 = - env->GetMethodID(groupInfoMapStructStructClass_1, "", - "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); - if (groupInfoMapStructStructCtor_1 == nullptr) + jmethodID fabricDescriptorStructStructCtor_1 = + env->GetMethodID(fabricDescriptorStructStructClass_1, "", + "([BLjava/lang/Integer;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/Integer;)V"); + if (fabricDescriptorStructStructCtor_1 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$OperationalCredentialsClusterFabricDescriptorStruct constructor"); return; } - newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, - newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + newElement_0 = env->NewObject(fabricDescriptorStructStructClass_1, fabricDescriptorStructStructCtor_1, + newElement_0_rootPublicKey, newElement_0_vendorID, newElement_0_fabricID, newElement_0_nodeID, + newElement_0_label, newElement_0_fabricIndex); chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); } @@ -16093,9 +16493,81 @@ void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagementGeneratedCommandListAttributeCallback( +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback:: + ~CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsTrustedRootCertificatesAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jbyteArray newElement_0ByteArray = env->NewByteArray(static_cast(entry_0.size())); + env->SetByteArrayRegion(newElement_0ByteArray, 0, static_cast(entry_0.size()), + reinterpret_cast(entry_0.data())); + newElement_0 = newElement_0ByteArray; + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CHIPOperationalCredentialsGeneratedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16112,7 +16584,7 @@ CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagem } } -CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManagementGeneratedCommandListAttributeCallback() +CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::~CHIPOperationalCredentialsGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16123,7 +16595,7 @@ CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManage env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPOperationalCredentialsGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16133,8 +16605,1545 @@ void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CHIPOperationalCredentialsAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::~CHIPOperationalCredentialsAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsEventListAttributeCallback::CHIPOperationalCredentialsEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsEventListAttributeCallback::~CHIPOperationalCredentialsEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsEventListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPOperationalCredentialsAttributeListAttributeCallback::CHIPOperationalCredentialsAttributeListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPOperationalCredentialsAttributeListAttributeCallback::~CHIPOperationalCredentialsAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPOperationalCredentialsAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CHIPGroupKeyManagementGroupKeyMapAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementGroupKeyMapAttributeCallback::~CHIPGroupKeyManagementGroupKeyMapAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGroupKeyMapAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, + newElement_0_groupId); + jobject newElement_0_groupKeySetID; + std::string newElement_0_groupKeySetIDClassName = "java/lang/Integer"; + std::string newElement_0_groupKeySetIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupKeySetIDClassName.c_str(), + newElement_0_groupKeySetIDCtorSignature.c_str(), + entry_0.groupKeySetID, newElement_0_groupKeySetID); + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupKeyMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct", groupKeyMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct"); + return; + } + jmethodID groupKeyMapStructStructCtor_1 = env->GetMethodID(groupKeyMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;)V"); + if (groupKeyMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupKeyMapStruct constructor"); + return; + } + + newElement_0 = env->NewObject(groupKeyMapStructStructClass_1, groupKeyMapStructStructCtor_1, newElement_0_groupId, + newElement_0_groupKeySetID, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGroupTableAttributeCallback::CHIPGroupKeyManagementGroupTableAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementGroupTableAttributeCallback::~CHIPGroupKeyManagementGroupTableAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGroupTableAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & + list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_groupId; + std::string newElement_0_groupIdClassName = "java/lang/Integer"; + std::string newElement_0_groupIdCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_groupIdClassName.c_str(), + newElement_0_groupIdCtorSignature.c_str(), entry_0.groupId, + newElement_0_groupId); + jobject newElement_0_endpoints; + chip::JniReferences::GetInstance().CreateArrayList(newElement_0_endpoints); + + auto iter_newElement_0_endpoints_2 = entry_0.endpoints.begin(); + while (iter_newElement_0_endpoints_2.Next()) + { + auto & entry_2 = iter_newElement_0_endpoints_2.GetValue(); + jobject newElement_2; + std::string newElement_2ClassName = "java/lang/Integer"; + std::string newElement_2CtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2ClassName.c_str(), newElement_2CtorSignature.c_str(), entry_2, newElement_2); + chip::JniReferences::GetInstance().AddToList(newElement_0_endpoints, newElement_2); + } + jobject newElement_0_groupName; + if (!entry_0.groupName.HasValue()) + { + chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_groupName); + } + else + { + jobject newElement_0_groupNameInsideOptional; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.groupName.Value(), + newElement_0_groupNameInsideOptional)); + chip::JniReferences::GetInstance().CreateOptional(newElement_0_groupNameInsideOptional, newElement_0_groupName); + } + jobject newElement_0_fabricIndex; + std::string newElement_0_fabricIndexClassName = "java/lang/Integer"; + std::string newElement_0_fabricIndexCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_fabricIndexClassName.c_str(), + newElement_0_fabricIndexCtorSignature.c_str(), + entry_0.fabricIndex, newElement_0_fabricIndex); + + jclass groupInfoMapStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct", groupInfoMapStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct"); + return; + } + jmethodID groupInfoMapStructStructCtor_1 = + env->GetMethodID(groupInfoMapStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/util/ArrayList;Ljava/util/Optional;Ljava/lang/Integer;)V"); + if (groupInfoMapStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$GroupKeyManagementClusterGroupInfoMapStruct constructor"); + return; + } + + newElement_0 = env->NewObject(groupInfoMapStructStructClass_1, groupInfoMapStructStructCtor_1, newElement_0_groupId, + newElement_0_endpoints, newElement_0_groupName, newElement_0_fabricIndex); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CHIPGroupKeyManagementGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::~CHIPGroupKeyManagementGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManagementAcceptedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagementAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFixedLabelLabelListAttributeCallback::~CHIPFixedLabelLabelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", + labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); + return; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); + return; + } + + newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelLabelListAttributeCallback::CHIPUserLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUserLabelLabelListAttributeCallback::~CHIPUserLabelLabelListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelLabelListAttributeCallback::CallbackFn( + void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + jobject newElement_0_label; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); + jobject newElement_0_value; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); + + jclass labelStructStructClass_1; + err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", + labelStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); + return; + } + jmethodID labelStructStructCtor_1 = + env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); + if (labelStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); + return; + } + + newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPUserLabelAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPProxyConfigurationGeneratedCommandListAttributeCallback::CHIPProxyConfigurationGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPProxyConfigurationGeneratedCommandListAttributeCallback::~CHIPProxyConfigurationGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPProxyConfigurationGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16164,9 +18173,9 @@ void CHIPGroupKeyManagementGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManagementAcceptedCommandListAttributeCallback( +CHIPProxyConfigurationAcceptedCommandListAttributeCallback::CHIPProxyConfigurationAcceptedCommandListAttributeCallback( jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16183,7 +18192,7 @@ CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CHIPGroupKeyManageme } } -CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagementAcceptedCommandListAttributeCallback() +CHIPProxyConfigurationAcceptedCommandListAttributeCallback::~CHIPProxyConfigurationAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16194,7 +18203,7 @@ CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::~CHIPGroupKeyManagem env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyConfigurationAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16204,8 +18213,8 @@ void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16235,9 +18244,9 @@ void CHIPGroupKeyManagementAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventListAttributeCallback(jobject javaCallback, +CHIPProxyConfigurationEventListAttributeCallback::CHIPProxyConfigurationEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16254,7 +18263,7 @@ CHIPGroupKeyManagementEventListAttributeCallback::CHIPGroupKeyManagementEventLis } } -CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventListAttributeCallback() +CHIPProxyConfigurationEventListAttributeCallback::~CHIPProxyConfigurationEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16265,7 +18274,7 @@ CHIPGroupKeyManagementEventListAttributeCallback::~CHIPGroupKeyManagementEventLi env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context, +void CHIPProxyConfigurationEventListAttributeCallback::CallbackFn(void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16275,8 +18284,8 @@ void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16306,9 +18315,9 @@ void CHIPGroupKeyManagementEventListAttributeCallback::CallbackFn(void * context env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttributeListAttributeCallback(jobject javaCallback, +CHIPProxyConfigurationAttributeListAttributeCallback::CHIPProxyConfigurationAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16325,7 +18334,7 @@ CHIPGroupKeyManagementAttributeListAttributeCallback::CHIPGroupKeyManagementAttr } } -CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAttributeListAttributeCallback() +CHIPProxyConfigurationAttributeListAttributeCallback::~CHIPProxyConfigurationAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16336,7 +18345,7 @@ CHIPGroupKeyManagementAttributeListAttributeCallback::~CHIPGroupKeyManagementAtt env->DeleteGlobalRef(javaCallbackRef); } -void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( +void CHIPProxyConfigurationAttributeListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16346,8 +18355,8 @@ void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16377,97 +18386,9 @@ void CHIPGroupKeyManagementAttributeListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelLabelListAttributeCallback::CHIPFixedLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPFixedLabelLabelListAttributeCallback::~CHIPFixedLabelLabelListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPFixedLabelLabelListAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$FixedLabelClusterLabelStruct", - labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$FixedLabelClusterLabelStruct"); - return; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$FixedLabelClusterLabelStruct constructor"); - return; - } - - newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::CHIPProxyDiscoveryGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16484,7 +18405,7 @@ CHIPFixedLabelGeneratedCommandListAttributeCallback::CHIPFixedLabelGeneratedComm } } -CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCommandListAttributeCallback() +CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::~CHIPProxyDiscoveryGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16495,7 +18416,7 @@ CHIPFixedLabelGeneratedCommandListAttributeCallback::~CHIPFixedLabelGeneratedCom env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPProxyDiscoveryGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16505,8 +18426,8 @@ void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16536,9 +18457,9 @@ void CHIPFixedLabelGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::CHIPProxyDiscoveryAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16555,7 +18476,7 @@ CHIPFixedLabelAcceptedCommandListAttributeCallback::CHIPFixedLabelAcceptedComman } } -CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedCommandListAttributeCallback() +CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::~CHIPProxyDiscoveryAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16566,7 +18487,7 @@ CHIPFixedLabelAcceptedCommandListAttributeCallback::~CHIPFixedLabelAcceptedComma env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyDiscoveryAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16576,8 +18497,8 @@ void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16607,8 +18528,8 @@ void CHIPFixedLabelAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyDiscoveryEventListAttributeCallback::CHIPProxyDiscoveryEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16624,7 +18545,7 @@ CHIPFixedLabelEventListAttributeCallback::CHIPFixedLabelEventListAttributeCallba } } -CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallback() +CHIPProxyDiscoveryEventListAttributeCallback::~CHIPProxyDiscoveryEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16635,8 +18556,8 @@ CHIPFixedLabelEventListAttributeCallback::~CHIPFixedLabelEventListAttributeCallb env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyDiscoveryEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16645,8 +18566,8 @@ void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16676,8 +18597,10 @@ void CHIPFixedLabelEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyDiscoveryAttributeListAttributeCallback::CHIPProxyDiscoveryAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16693,7 +18616,7 @@ CHIPFixedLabelAttributeListAttributeCallback::CHIPFixedLabelAttributeListAttribu } } -CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttributeCallback() +CHIPProxyDiscoveryAttributeListAttributeCallback::~CHIPProxyDiscoveryAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16704,8 +18627,8 @@ CHIPFixedLabelAttributeListAttributeCallback::~CHIPFixedLabelAttributeListAttrib env->DeleteGlobalRef(javaCallbackRef); } -void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyDiscoveryAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -16714,8 +18637,8 @@ void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16745,97 +18668,9 @@ void CHIPFixedLabelAttributeListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelLabelListAttributeCallback::CHIPUserLabelLabelListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - return; - } - - javaCallbackRef = env->NewGlobalRef(javaCallback); - if (javaCallbackRef == nullptr) - { - ChipLogError(Zcl, "Could not create global reference for Java callback"); - } -} - -CHIPUserLabelLabelListAttributeCallback::~CHIPUserLabelLabelListAttributeCallback() -{ - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - if (env == nullptr) - { - ChipLogError(Zcl, "Could not delete global reference for Java callback"); - return; - } - env->DeleteGlobalRef(javaCallbackRef); -} - -void CHIPUserLabelLabelListAttributeCallback::CallbackFn( - void * context, - const chip::app::DataModel::DecodableList & list) -{ - chip::DeviceLayer::StackUnlock unlock; - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject javaCallbackRef; - - VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); - - // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. - javaCallbackRef = cppCallback.get()->javaCallbackRef; - VerifyOrReturn(javaCallbackRef != nullptr, - ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); - - jmethodID javaMethod; - err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); - - jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) - { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_label; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.label, newElement_0_label)); - jobject newElement_0_value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.value, newElement_0_value)); - - jclass labelStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/ChipStructs$UserLabelClusterLabelStruct", - labelStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$UserLabelClusterLabelStruct"); - return; - } - jmethodID labelStructStructCtor_1 = - env->GetMethodID(labelStructStructClass_1, "", "(Ljava/lang/String;Ljava/lang/String;)V"); - if (labelStructStructCtor_1 == nullptr) - { - ChipLogError(Zcl, "Could not find ChipStructs$UserLabelClusterLabelStruct constructor"); - return; - } - - newElement_0 = env->NewObject(labelStructStructClass_1, labelStructStructCtor_1, newElement_0_label, newElement_0_value); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); - } - - env->ExceptionClear(); - env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); -} - -CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyValidGeneratedCommandListAttributeCallback::CHIPProxyValidGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16852,7 +18687,7 @@ CHIPUserLabelGeneratedCommandListAttributeCallback::CHIPUserLabelGeneratedComman } } -CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedCommandListAttributeCallback() +CHIPProxyValidGeneratedCommandListAttributeCallback::~CHIPProxyValidGeneratedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16863,7 +18698,7 @@ CHIPUserLabelGeneratedCommandListAttributeCallback::~CHIPUserLabelGeneratedComma env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( +void CHIPProxyValidGeneratedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16873,8 +18708,8 @@ void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16904,9 +18739,9 @@ void CHIPUserLabelGeneratedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandListAttributeCallback(jobject javaCallback, - bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), +CHIPProxyValidAcceptedCommandListAttributeCallback::CHIPProxyValidAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); @@ -16923,7 +18758,7 @@ CHIPUserLabelAcceptedCommandListAttributeCallback::CHIPUserLabelAcceptedCommandL } } -CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommandListAttributeCallback() +CHIPProxyValidAcceptedCommandListAttributeCallback::~CHIPProxyValidAcceptedCommandListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16934,7 +18769,7 @@ CHIPUserLabelAcceptedCommandListAttributeCallback::~CHIPUserLabelAcceptedCommand env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( +void CHIPProxyValidAcceptedCommandListAttributeCallback::CallbackFn( void * context, const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; @@ -16944,8 +18779,8 @@ void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -16975,8 +18810,8 @@ void CHIPUserLabelAcceptedCommandListAttributeCallback::CallbackFn( env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyValidEventListAttributeCallback::CHIPProxyValidEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -16992,7 +18827,7 @@ CHIPUserLabelEventListAttributeCallback::CHIPUserLabelEventListAttributeCallback } } -CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallback() +CHIPProxyValidEventListAttributeCallback::~CHIPProxyValidEventListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17003,8 +18838,8 @@ CHIPUserLabelEventListAttributeCallback::~CHIPUserLabelEventListAttributeCallbac env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyValidEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -17013,8 +18848,8 @@ void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -17044,8 +18879,8 @@ void CHIPUserLabelEventListAttributeCallback::CallbackFn(void * context, env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } -CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : - chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +CHIPProxyValidAttributeListAttributeCallback::CHIPProxyValidAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17061,7 +18896,7 @@ CHIPUserLabelAttributeListAttributeCallback::CHIPUserLabelAttributeListAttribute } } -CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttributeCallback() +CHIPProxyValidAttributeListAttributeCallback::~CHIPProxyValidAttributeListAttributeCallback() { JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); if (env == nullptr) @@ -17072,8 +18907,8 @@ CHIPUserLabelAttributeListAttributeCallback::~CHIPUserLabelAttributeListAttribut env->DeleteGlobalRef(javaCallbackRef); } -void CHIPUserLabelAttributeListAttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::DecodableList & list) +void CHIPProxyValidAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -17082,8 +18917,8 @@ void CHIPUserLabelAttributeListAttributeCallback::CallbackFn(void * context, VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); - std::unique_ptr cppCallback( - reinterpret_cast(context), maybeDestroy); + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. javaCallbackRef = cppCallback.get()->javaCallbackRef; @@ -39504,3 +41339,285 @@ void CHIPUnitTestingAttributeListAttributeCallback::CallbackFn(void * context, env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } + +CHIPFaultInjectionGeneratedCommandListAttributeCallback::CHIPFaultInjectionGeneratedCommandListAttributeCallback( + jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFaultInjectionGeneratedCommandListAttributeCallback::~CHIPFaultInjectionGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionAcceptedCommandListAttributeCallback::CHIPFaultInjectionAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFaultInjectionAcceptedCommandListAttributeCallback::~CHIPFaultInjectionAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionEventListAttributeCallback::CHIPFaultInjectionEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFaultInjectionEventListAttributeCallback::~CHIPFaultInjectionEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPFaultInjectionAttributeListAttributeCallback::CHIPFaultInjectionAttributeListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPFaultInjectionAttributeListAttributeCallback::~CHIPFaultInjectionAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPFaultInjectionAttributeListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + err = chip::JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/util/List;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0ClassName.c_str(), + newElement_0CtorSignature.c_str(), entry_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index e03fffda2bed94..61de68fd55d4a2 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -2818,6 +2818,148 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + public static class PulseWidthModulationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 28L; + + public PulseWidthModulationCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + public static class DescriptorCluster extends BaseChipCluster { public static final long CLUSTER_ID = 29L; @@ -10171,16 +10313,56 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class BridgedDeviceBasicInformationCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 57L; + public static class TimeSynchronizationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 56L; - public BridgedDeviceBasicInformationCluster(long devicePtr, int endpointId) { + public TimeSynchronizationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); + public interface UTCTimeAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DefaultNTPAttributeCallback { + void onSuccess(@Nullable String value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface TimeZoneAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface DSTOffsetAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface LocalTimeAttributeCallback { + void onSuccess(@Nullable Long value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -10213,161 +10395,125 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readVendorNameAttribute(CharStringAttributeCallback callback) { - readVendorNameAttribute(chipClusterPtr, callback); + public void readUTCTimeAttribute(UTCTimeAttributeCallback callback) { + readUTCTimeAttribute(chipClusterPtr, callback); } - public void subscribeVendorNameAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeUTCTimeAttribute( + UTCTimeAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUTCTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readVendorIDAttribute(IntegerAttributeCallback callback) { - readVendorIDAttribute(chipClusterPtr, callback); + public void readGranularityAttribute(IntegerAttributeCallback callback) { + readGranularityAttribute(chipClusterPtr, callback); } - public void subscribeVendorIDAttribute( + public void subscribeGranularityAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeGranularityAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductNameAttribute(CharStringAttributeCallback callback) { - readProductNameAttribute(chipClusterPtr, callback); + public void readTimeSourceAttribute(IntegerAttributeCallback callback) { + readTimeSourceAttribute(chipClusterPtr, callback); } - public void subscribeProductNameAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeSourceAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeSourceAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readNodeLabelAttribute(CharStringAttributeCallback callback) { - readNodeLabelAttribute(chipClusterPtr, callback); + public void readDefaultNTPAttribute(DefaultNTPAttributeCallback callback) { + readDefaultNTPAttribute(chipClusterPtr, callback); } - public void writeNodeLabelAttribute(DefaultClusterCallback callback, String value) { - writeNodeLabelAttribute(chipClusterPtr, callback, value, null); + public void subscribeDefaultNTPAttribute( + DefaultNTPAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDefaultNTPAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void writeNodeLabelAttribute( - DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { - writeNodeLabelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + public void readTimeZoneAttribute(TimeZoneAttributeCallback callback) { + readTimeZoneAttribute(chipClusterPtr, callback); } - public void subscribeNodeLabelAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneAttribute( + TimeZoneAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { - readHardwareVersionAttribute(chipClusterPtr, callback); + public void readDSTOffsetAttribute(DSTOffsetAttributeCallback callback) { + readDSTOffsetAttribute(chipClusterPtr, callback); } - public void subscribeHardwareVersionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeDSTOffsetAttribute( + DSTOffsetAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDSTOffsetAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { - readHardwareVersionStringAttribute(chipClusterPtr, callback); + public void readLocalTimeAttribute(LocalTimeAttributeCallback callback) { + readLocalTimeAttribute(chipClusterPtr, callback); } - public void subscribeHardwareVersionStringAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLocalTimeAttribute( + LocalTimeAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLocalTimeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSoftwareVersionAttribute(LongAttributeCallback callback) { - readSoftwareVersionAttribute(chipClusterPtr, callback); + public void readTimeZoneDatabaseAttribute(IntegerAttributeCallback callback) { + readTimeZoneDatabaseAttribute(chipClusterPtr, callback); } - public void subscribeSoftwareVersionAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneDatabaseAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneDatabaseAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { - readSoftwareVersionStringAttribute(chipClusterPtr, callback); + public void readNTPServerAvailableAttribute(BooleanAttributeCallback callback) { + readNTPServerAvailableAttribute(chipClusterPtr, callback); } - public void subscribeSoftwareVersionStringAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeNTPServerAvailableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNTPServerAvailableAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { - readManufacturingDateAttribute(chipClusterPtr, callback); + public void readTimeZoneListMaxSizeAttribute(IntegerAttributeCallback callback) { + readTimeZoneListMaxSizeAttribute(chipClusterPtr, callback); } - public void subscribeManufacturingDateAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeTimeZoneListMaxSizeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTimeZoneListMaxSizeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readPartNumberAttribute(CharStringAttributeCallback callback) { - readPartNumberAttribute(chipClusterPtr, callback); + public void readDSTOffsetListMaxSizeAttribute(IntegerAttributeCallback callback) { + readDSTOffsetListMaxSizeAttribute(chipClusterPtr, callback); } - public void subscribePartNumberAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeDSTOffsetListMaxSizeAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeDSTOffsetListMaxSizeAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductURLAttribute(CharStringAttributeCallback callback) { - readProductURLAttribute(chipClusterPtr, callback); + public void readSupportsDNSResolveAttribute(BooleanAttributeCallback callback) { + readSupportsDNSResolveAttribute(chipClusterPtr, callback); } - public void subscribeProductURLAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeSupportsDNSResolveAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSupportsDNSResolveAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readProductLabelAttribute(CharStringAttributeCallback callback) { - readProductLabelAttribute(chipClusterPtr, callback); + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); } - public void subscribeProductLabelAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readSerialNumberAttribute(CharStringAttributeCallback callback) { - readSerialNumberAttribute(chipClusterPtr, callback); - } - - public void subscribeSerialNumberAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readReachableAttribute(BooleanAttributeCallback callback) { - readReachableAttribute(chipClusterPtr, callback); - } - - public void subscribeReachableAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readUniqueIDAttribute(CharStringAttributeCallback callback) { - readUniqueIDAttribute(chipClusterPtr, callback); - } - - public void subscribeUniqueIDAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - subscribeUniqueIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); } public void subscribeAcceptedCommandListAttribute( @@ -10411,135 +10557,81 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readVendorNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readUTCTimeAttribute( + long chipClusterPtr, UTCTimeAttributeCallback callback); - private native void subscribeVendorNameAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeUTCTimeAttribute( + long chipClusterPtr, UTCTimeAttributeCallback callback, int minInterval, int maxInterval); - private native void readVendorIDAttribute( + private native void readGranularityAttribute( long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeVendorIDAttribute( + private native void subscribeGranularityAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductNameAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeProductNameAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readNodeLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void writeNodeLabelAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - String value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeNodeLabelAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readHardwareVersionAttribute( + private native void readTimeSourceAttribute( long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeHardwareVersionAttribute( + private native void subscribeTimeSourceAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readHardwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDefaultNTPAttribute( + long chipClusterPtr, DefaultNTPAttributeCallback callback); - private native void subscribeHardwareVersionStringAttribute( + private native void subscribeDefaultNTPAttribute( long chipClusterPtr, - CharStringAttributeCallback callback, + DefaultNTPAttributeCallback callback, int minInterval, int maxInterval); - private native void readSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback); + private native void readTimeZoneAttribute( + long chipClusterPtr, TimeZoneAttributeCallback callback); - private native void subscribeSoftwareVersionAttribute( - long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribeTimeZoneAttribute( + long chipClusterPtr, TimeZoneAttributeCallback callback, int minInterval, int maxInterval); - private native void readSoftwareVersionStringAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDSTOffsetAttribute( + long chipClusterPtr, DSTOffsetAttributeCallback callback); - private native void subscribeSoftwareVersionStringAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeDSTOffsetAttribute( + long chipClusterPtr, DSTOffsetAttributeCallback callback, int minInterval, int maxInterval); - private native void readManufacturingDateAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readLocalTimeAttribute( + long chipClusterPtr, LocalTimeAttributeCallback callback); - private native void subscribeManufacturingDateAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeLocalTimeAttribute( + long chipClusterPtr, LocalTimeAttributeCallback callback, int minInterval, int maxInterval); - private native void readPartNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readTimeZoneDatabaseAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribePartNumberAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeTimeZoneDatabaseAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductURLAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readNTPServerAvailableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); - private native void subscribeProductURLAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeNTPServerAvailableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); - private native void readProductLabelAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readTimeZoneListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeProductLabelAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeTimeZoneListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readSerialNumberAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); + private native void readDSTOffsetListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); - private native void subscribeSerialNumberAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeDSTOffsetListMaxSizeAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readReachableAttribute( + private native void readSupportsDNSResolveAttribute( long chipClusterPtr, BooleanAttributeCallback callback); - private native void subscribeReachableAttribute( + private native void subscribeSupportsDNSResolveAttribute( long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); - private native void readUniqueIDAttribute( - long chipClusterPtr, CharStringAttributeCallback callback); - - private native void subscribeUniqueIDAttribute( - long chipClusterPtr, - CharStringAttributeCallback callback, - int minInterval, - int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -10586,10 +10678,10 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class SwitchCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 59L; + public static class BridgedDeviceBasicInformationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 57L; - public SwitchCluster(long devicePtr, int endpointId) { + public BridgedDeviceBasicInformationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @@ -10628,103 +10720,1550 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { - readNumberOfPositionsAttribute(chipClusterPtr, callback); + public void readVendorNameAttribute(CharStringAttributeCallback callback) { + readVendorNameAttribute(chipClusterPtr, callback); } - public void subscribeNumberOfPositionsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNumberOfPositionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeVendorNameAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeVendorNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readCurrentPositionAttribute(IntegerAttributeCallback callback) { - readCurrentPositionAttribute(chipClusterPtr, callback); + public void readVendorIDAttribute(IntegerAttributeCallback callback) { + readVendorIDAttribute(chipClusterPtr, callback); } - public void subscribeCurrentPositionAttribute( + public void subscribeVendorIDAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCurrentPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeVendorIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readMultiPressMaxAttribute(IntegerAttributeCallback callback) { - readMultiPressMaxAttribute(chipClusterPtr, callback); + public void readProductNameAttribute(CharStringAttributeCallback callback) { + readProductNameAttribute(chipClusterPtr, callback); } - public void subscribeMultiPressMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMultiPressMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeProductNameAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductNameAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { - readGeneratedCommandListAttribute(chipClusterPtr, callback); + public void readNodeLabelAttribute(CharStringAttributeCallback callback) { + readNodeLabelAttribute(chipClusterPtr, callback); } - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeNodeLabelAttribute(DefaultClusterCallback callback, String value) { + writeNodeLabelAttribute(chipClusterPtr, callback, value, null); } - public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { - readAcceptedCommandListAttribute(chipClusterPtr, callback); + public void writeNodeLabelAttribute( + DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { + writeNodeLabelAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeNodeLabelAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNodeLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readEventListAttribute(EventListAttributeCallback callback) { - readEventListAttribute(chipClusterPtr, callback); + public void readHardwareVersionAttribute(IntegerAttributeCallback callback) { + readHardwareVersionAttribute(chipClusterPtr, callback); } - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeHardwareVersionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHardwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readAttributeListAttribute(AttributeListAttributeCallback callback) { - readAttributeListAttribute(chipClusterPtr, callback); + public void readHardwareVersionStringAttribute(CharStringAttributeCallback callback) { + readHardwareVersionStringAttribute(chipClusterPtr, callback); } - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeHardwareVersionStringAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeHardwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readFeatureMapAttribute(LongAttributeCallback callback) { - readFeatureMapAttribute(chipClusterPtr, callback); + public void readSoftwareVersionAttribute(LongAttributeCallback callback) { + readSoftwareVersionAttribute(chipClusterPtr, callback); } - public void subscribeFeatureMapAttribute( + public void subscribeSoftwareVersionAttribute( LongAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + subscribeSoftwareVersionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { - readClusterRevisionAttribute(chipClusterPtr, callback); + public void readSoftwareVersionStringAttribute(CharStringAttributeCallback callback) { + readSoftwareVersionStringAttribute(chipClusterPtr, callback); } - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeSoftwareVersionStringAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSoftwareVersionStringAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readNumberOfPositionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeNumberOfPositionsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void readManufacturingDateAttribute(CharStringAttributeCallback callback) { + readManufacturingDateAttribute(chipClusterPtr, callback); + } - private native void readCurrentPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void subscribeManufacturingDateAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeManufacturingDateAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void subscribeCurrentPositionAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + public void readPartNumberAttribute(CharStringAttributeCallback callback) { + readPartNumberAttribute(chipClusterPtr, callback); + } - private native void readMultiPressMaxAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + public void subscribePartNumberAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribePartNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } - private native void subscribeMultiPressMaxAttribute( + public void readProductURLAttribute(CharStringAttributeCallback callback) { + readProductURLAttribute(chipClusterPtr, callback); + } + + public void subscribeProductURLAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductURLAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readProductLabelAttribute(CharStringAttributeCallback callback) { + readProductLabelAttribute(chipClusterPtr, callback); + } + + public void subscribeProductLabelAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeProductLabelAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSerialNumberAttribute(CharStringAttributeCallback callback) { + readSerialNumberAttribute(chipClusterPtr, callback); + } + + public void subscribeSerialNumberAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSerialNumberAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readReachableAttribute(BooleanAttributeCallback callback) { + readReachableAttribute(chipClusterPtr, callback); + } + + public void subscribeReachableAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + subscribeReachableAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readUniqueIDAttribute(CharStringAttributeCallback callback) { + readUniqueIDAttribute(chipClusterPtr, callback); + } + + public void subscribeUniqueIDAttribute( + CharStringAttributeCallback callback, int minInterval, int maxInterval) { + subscribeUniqueIDAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readVendorNameAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeVendorNameAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readVendorIDAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeVendorIDAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readProductNameAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductNameAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readNodeLabelAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void writeNodeLabelAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + String value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeNodeLabelAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readHardwareVersionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeHardwareVersionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readHardwareVersionStringAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeHardwareVersionStringAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readSoftwareVersionAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeSoftwareVersionAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSoftwareVersionStringAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeSoftwareVersionStringAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readManufacturingDateAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeManufacturingDateAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readPartNumberAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribePartNumberAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readProductURLAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductURLAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readProductLabelAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeProductLabelAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readSerialNumberAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeSerialNumberAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readReachableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback); + + private native void subscribeReachableAttribute( + long chipClusterPtr, BooleanAttributeCallback callback, int minInterval, int maxInterval); + + private native void readUniqueIDAttribute( + long chipClusterPtr, CharStringAttributeCallback callback); + + private native void subscribeUniqueIDAttribute( + long chipClusterPtr, + CharStringAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class SwitchCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 59L; + + public SwitchCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readNumberOfPositionsAttribute(IntegerAttributeCallback callback) { + readNumberOfPositionsAttribute(chipClusterPtr, callback); + } + + public void subscribeNumberOfPositionsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNumberOfPositionsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentPositionAttribute(IntegerAttributeCallback callback) { + readCurrentPositionAttribute(chipClusterPtr, callback); + } + + public void subscribeCurrentPositionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCurrentPositionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMultiPressMaxAttribute(IntegerAttributeCallback callback) { + readMultiPressMaxAttribute(chipClusterPtr, callback); + } + + public void subscribeMultiPressMaxAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMultiPressMaxAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readNumberOfPositionsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeNumberOfPositionsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readCurrentPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCurrentPositionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMultiPressMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMultiPressMaxAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class AdministratorCommissioningCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 60L; + + public AdministratorCommissioningCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void openCommissioningWindow( + DefaultClusterCallback callback, + Integer commissioningTimeout, + byte[] PAKEPasscodeVerifier, + Integer discriminator, + Long iterations, + byte[] salt, + int timedInvokeTimeoutMs) { + openCommissioningWindow( + chipClusterPtr, + callback, + commissioningTimeout, + PAKEPasscodeVerifier, + discriminator, + iterations, + salt, + timedInvokeTimeoutMs); + } + + public void openBasicCommissioningWindow( + DefaultClusterCallback callback, Integer commissioningTimeout, int timedInvokeTimeoutMs) { + openBasicCommissioningWindow( + chipClusterPtr, callback, commissioningTimeout, timedInvokeTimeoutMs); + } + + public void revokeCommissioning(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + + revokeCommissioning(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + private native void openCommissioningWindow( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer commissioningTimeout, + byte[] PAKEPasscodeVerifier, + Integer discriminator, + Long iterations, + byte[] salt, + @Nullable Integer timedInvokeTimeoutMs); + + private native void openBasicCommissioningWindow( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer commissioningTimeout, + @Nullable Integer timedInvokeTimeoutMs); + + private native void revokeCommissioning( + long chipClusterPtr, + DefaultClusterCallback Callback, + @Nullable Integer timedInvokeTimeoutMs); + + public interface AdminFabricIndexAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AdminVendorIdAttributeCallback { + void onSuccess(@Nullable Integer value); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readWindowStatusAttribute(IntegerAttributeCallback callback) { + readWindowStatusAttribute(chipClusterPtr, callback); + } + + public void subscribeWindowStatusAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeWindowStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAdminFabricIndexAttribute(AdminFabricIndexAttributeCallback callback) { + readAdminFabricIndexAttribute(chipClusterPtr, callback); + } + + public void subscribeAdminFabricIndexAttribute( + AdminFabricIndexAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAdminFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAdminVendorIdAttribute(AdminVendorIdAttributeCallback callback) { + readAdminVendorIdAttribute(chipClusterPtr, callback); + } + + public void subscribeAdminVendorIdAttribute( + AdminVendorIdAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAdminVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readWindowStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeWindowStatusAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAdminFabricIndexAttribute( + long chipClusterPtr, AdminFabricIndexAttributeCallback callback); + + private native void subscribeAdminFabricIndexAttribute( + long chipClusterPtr, + AdminFabricIndexAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAdminVendorIdAttribute( + long chipClusterPtr, AdminVendorIdAttributeCallback callback); + + private native void subscribeAdminVendorIdAttribute( + long chipClusterPtr, + AdminVendorIdAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class OperationalCredentialsCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 62L; + + public OperationalCredentialsCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void attestationRequest(AttestationResponseCallback callback, byte[] attestationNonce) { + attestationRequest(chipClusterPtr, callback, attestationNonce, null); + } + + public void attestationRequest( + AttestationResponseCallback callback, byte[] attestationNonce, int timedInvokeTimeoutMs) { + attestationRequest(chipClusterPtr, callback, attestationNonce, timedInvokeTimeoutMs); + } + + public void certificateChainRequest( + CertificateChainResponseCallback callback, Integer certificateType) { + certificateChainRequest(chipClusterPtr, callback, certificateType, null); + } + + public void certificateChainRequest( + CertificateChainResponseCallback callback, + Integer certificateType, + int timedInvokeTimeoutMs) { + certificateChainRequest(chipClusterPtr, callback, certificateType, timedInvokeTimeoutMs); + } + + public void CSRRequest( + CSRResponseCallback callback, byte[] CSRNonce, Optional isForUpdateNOC) { + CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, null); + } + + public void CSRRequest( + CSRResponseCallback callback, + byte[] CSRNonce, + Optional isForUpdateNOC, + int timedInvokeTimeoutMs) { + CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, timedInvokeTimeoutMs); + } + + public void addNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId) { + addNOC( + chipClusterPtr, + callback, + NOCValue, + ICACValue, + IPKValue, + caseAdminSubject, + adminVendorId, + null); + } + + public void addNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId, + int timedInvokeTimeoutMs) { + addNOC( + chipClusterPtr, + callback, + NOCValue, + ICACValue, + IPKValue, + caseAdminSubject, + adminVendorId, + timedInvokeTimeoutMs); + } + + public void updateNOC( + NOCResponseCallback callback, byte[] NOCValue, Optional ICACValue) { + updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, null); + } + + public void updateNOC( + NOCResponseCallback callback, + byte[] NOCValue, + Optional ICACValue, + int timedInvokeTimeoutMs) { + updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, timedInvokeTimeoutMs); + } + + public void updateFabricLabel(NOCResponseCallback callback, String label) { + updateFabricLabel(chipClusterPtr, callback, label, null); + } + + public void updateFabricLabel( + NOCResponseCallback callback, String label, int timedInvokeTimeoutMs) { + updateFabricLabel(chipClusterPtr, callback, label, timedInvokeTimeoutMs); + } + + public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) { + removeFabric(chipClusterPtr, callback, fabricIndex, null); + } + + public void removeFabric( + NOCResponseCallback callback, Integer fabricIndex, int timedInvokeTimeoutMs) { + removeFabric(chipClusterPtr, callback, fabricIndex, timedInvokeTimeoutMs); + } + + public void addTrustedRootCertificate( + DefaultClusterCallback callback, byte[] rootCACertificate) { + addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, null); + } + + public void addTrustedRootCertificate( + DefaultClusterCallback callback, byte[] rootCACertificate, int timedInvokeTimeoutMs) { + addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, timedInvokeTimeoutMs); + } + + private native void attestationRequest( + long chipClusterPtr, + AttestationResponseCallback Callback, + byte[] attestationNonce, + @Nullable Integer timedInvokeTimeoutMs); + + private native void certificateChainRequest( + long chipClusterPtr, + CertificateChainResponseCallback Callback, + Integer certificateType, + @Nullable Integer timedInvokeTimeoutMs); + + private native void CSRRequest( + long chipClusterPtr, + CSRResponseCallback Callback, + byte[] CSRNonce, + Optional isForUpdateNOC, + @Nullable Integer timedInvokeTimeoutMs); + + private native void addNOC( + long chipClusterPtr, + NOCResponseCallback Callback, + byte[] NOCValue, + Optional ICACValue, + byte[] IPKValue, + Long caseAdminSubject, + Integer adminVendorId, + @Nullable Integer timedInvokeTimeoutMs); + + private native void updateNOC( + long chipClusterPtr, + NOCResponseCallback Callback, + byte[] NOCValue, + Optional ICACValue, + @Nullable Integer timedInvokeTimeoutMs); + + private native void updateFabricLabel( + long chipClusterPtr, + NOCResponseCallback Callback, + String label, + @Nullable Integer timedInvokeTimeoutMs); + + private native void removeFabric( + long chipClusterPtr, + NOCResponseCallback Callback, + Integer fabricIndex, + @Nullable Integer timedInvokeTimeoutMs); + + private native void addTrustedRootCertificate( + long chipClusterPtr, + DefaultClusterCallback Callback, + byte[] rootCACertificate, + @Nullable Integer timedInvokeTimeoutMs); + + public interface AttestationResponseCallback { + void onSuccess(byte[] attestationElements, byte[] attestationSignature); + + void onError(Exception error); + } + + public interface CertificateChainResponseCallback { + void onSuccess(byte[] certificate); + + void onError(Exception error); + } + + public interface CSRResponseCallback { + void onSuccess(byte[] NOCSRElements, byte[] attestationSignature); + + void onError(Exception error); + } + + public interface NOCResponseCallback { + void onSuccess(Integer statusCode, Optional fabricIndex, Optional debugText); + + void onError(Exception error); + } + + public interface NOCsAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface FabricsAttributeCallback { + void onSuccess( + List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface TrustedRootCertificatesAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readNOCsAttribute(NOCsAttributeCallback callback) { + readNOCsAttribute(chipClusterPtr, callback); + } + + public void subscribeNOCsAttribute( + NOCsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeNOCsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFabricsAttribute(FabricsAttributeCallback callback) { + readFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeFabricsAttribute( + FabricsAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { + readSupportedFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeSupportedFabricsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeSupportedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCommissionedFabricsAttribute(IntegerAttributeCallback callback) { + readCommissionedFabricsAttribute(chipClusterPtr, callback); + } + + public void subscribeCommissionedFabricsAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCommissionedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readTrustedRootCertificatesAttribute( + TrustedRootCertificatesAttributeCallback callback) { + readTrustedRootCertificatesAttribute(chipClusterPtr, callback); + } + + public void subscribeTrustedRootCertificatesAttribute( + TrustedRootCertificatesAttributeCallback callback, int minInterval, int maxInterval) { + subscribeTrustedRootCertificatesAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { + readCurrentFabricIndexAttribute(chipClusterPtr, callback); + } + + public void subscribeCurrentFabricIndexAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeCurrentFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readNOCsAttribute(long chipClusterPtr, NOCsAttributeCallback callback); + + private native void subscribeNOCsAttribute( + long chipClusterPtr, NOCsAttributeCallback callback, int minInterval, int maxInterval); + + private native void readFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback); + + private native void subscribeFabricsAttribute( + long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); + + private native void readSupportedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeSupportedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readCommissionedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCommissionedFabricsAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readTrustedRootCertificatesAttribute( + long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); + + private native void subscribeTrustedRootCertificatesAttribute( + long chipClusterPtr, + TrustedRootCertificatesAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readCurrentFabricIndexAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeCurrentFabricIndexAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } + + public static class GroupKeyManagementCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 63L; + + public GroupKeyManagementCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void keySetWrite( + DefaultClusterCallback callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet) { + keySetWrite(chipClusterPtr, callback, groupKeySet, null); + } + + public void keySetWrite( + DefaultClusterCallback callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, + int timedInvokeTimeoutMs) { + keySetWrite(chipClusterPtr, callback, groupKeySet, timedInvokeTimeoutMs); + } + + public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { + keySetRead(chipClusterPtr, callback, groupKeySetID, null); + } + + public void keySetRead( + KeySetReadResponseCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { + keySetRead(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); + } + + public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { + keySetRemove(chipClusterPtr, callback, groupKeySetID, null); + } + + public void keySetRemove( + DefaultClusterCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { + keySetRemove(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); + } + + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, ArrayList groupKeySetIDs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, null); + } + + public void keySetReadAllIndices( + KeySetReadAllIndicesResponseCallback callback, + ArrayList groupKeySetIDs, + int timedInvokeTimeoutMs) { + keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, timedInvokeTimeoutMs); + } + + private native void keySetWrite( + long chipClusterPtr, + DefaultClusterCallback Callback, + ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetRead( + long chipClusterPtr, + KeySetReadResponseCallback Callback, + Integer groupKeySetID, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetRemove( + long chipClusterPtr, + DefaultClusterCallback Callback, + Integer groupKeySetID, + @Nullable Integer timedInvokeTimeoutMs); + + private native void keySetReadAllIndices( + long chipClusterPtr, + KeySetReadAllIndicesResponseCallback Callback, + ArrayList groupKeySetIDs, + @Nullable Integer timedInvokeTimeoutMs); + + public interface KeySetReadResponseCallback { + void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet); + + void onError(Exception error); + } + + public interface KeySetReadAllIndicesResponseCallback { + void onSuccess(ArrayList groupKeySetIDs); + + void onError(Exception error); + } + + public interface GroupKeyMapAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GroupTableAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { + readGroupKeyMapAttribute(chipClusterPtr, callback); + } + + public void writeGroupKeyMapAttribute( + DefaultClusterCallback callback, + ArrayList value) { + writeGroupKeyMapAttribute(chipClusterPtr, callback, value, null); + } + + public void writeGroupKeyMapAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeGroupKeyMapAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + + public void subscribeGroupKeyMapAttribute( + GroupKeyMapAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGroupKeyMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGroupTableAttribute(GroupTableAttributeCallback callback) { + readGroupTableAttribute(chipClusterPtr, callback); + } + + public void subscribeGroupTableAttribute( + GroupTableAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGroupTableAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxGroupsPerFabricAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxGroupsPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { + readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); + } + + public void subscribeMaxGroupKeysPerFabricAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGroupKeyMapAttribute( + long chipClusterPtr, GroupKeyMapAttributeCallback callback); + + private native void writeGroupKeyMapAttribute( + long chipClusterPtr, + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); + + private native void subscribeGroupKeyMapAttribute( + long chipClusterPtr, + GroupKeyMapAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readGroupTableAttribute( + long chipClusterPtr, GroupTableAttributeCallback callback); + + private native void subscribeGroupTableAttribute( + long chipClusterPtr, + GroupTableAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxGroupsPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + + private native void readMaxGroupKeysPerFabricAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeMaxGroupKeysPerFabricAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( @@ -10773,77 +12312,18 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class AdministratorCommissioningCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 60L; + public static class FixedLabelCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 64L; - public AdministratorCommissioningCluster(long devicePtr, int endpointId) { + public FixedLabelCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void openCommissioningWindow( - DefaultClusterCallback callback, - Integer commissioningTimeout, - byte[] PAKEPasscodeVerifier, - Integer discriminator, - Long iterations, - byte[] salt, - int timedInvokeTimeoutMs) { - openCommissioningWindow( - chipClusterPtr, - callback, - commissioningTimeout, - PAKEPasscodeVerifier, - discriminator, - iterations, - salt, - timedInvokeTimeoutMs); - } - - public void openBasicCommissioningWindow( - DefaultClusterCallback callback, Integer commissioningTimeout, int timedInvokeTimeoutMs) { - openBasicCommissioningWindow( - chipClusterPtr, callback, commissioningTimeout, timedInvokeTimeoutMs); - } - - public void revokeCommissioning(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - - revokeCommissioning(chipClusterPtr, callback, timedInvokeTimeoutMs); - } - - private native void openCommissioningWindow( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer commissioningTimeout, - byte[] PAKEPasscodeVerifier, - Integer discriminator, - Long iterations, - byte[] salt, - @Nullable Integer timedInvokeTimeoutMs); - - private native void openBasicCommissioningWindow( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer commissioningTimeout, - @Nullable Integer timedInvokeTimeoutMs); - - private native void revokeCommissioning( - long chipClusterPtr, - DefaultClusterCallback Callback, - @Nullable Integer timedInvokeTimeoutMs); - - public interface AdminFabricIndexAttributeCallback { - void onSuccess(@Nullable Integer value); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface AdminVendorIdAttributeCallback { - void onSuccess(@Nullable Integer value); + public interface LabelListAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); @@ -10877,36 +12357,18 @@ default void onSubscriptionEstablished(long subscriptionId) {} public interface AttributeListAttributeCallback { void onSuccess(List valueList); - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public void readWindowStatusAttribute(IntegerAttributeCallback callback) { - readWindowStatusAttribute(chipClusterPtr, callback); - } - - public void subscribeWindowStatusAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeWindowStatusAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readAdminFabricIndexAttribute(AdminFabricIndexAttributeCallback callback) { - readAdminFabricIndexAttribute(chipClusterPtr, callback); - } - - public void subscribeAdminFabricIndexAttribute( - AdminFabricIndexAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAdminFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} } - public void readAdminVendorIdAttribute(AdminVendorIdAttributeCallback callback) { - readAdminVendorIdAttribute(chipClusterPtr, callback); + public void readLabelListAttribute(LabelListAttributeCallback callback) { + readLabelListAttribute(chipClusterPtr, callback); } - public void subscribeAdminVendorIdAttribute( - AdminVendorIdAttributeCallback callback, int minInterval, int maxInterval) { - subscribeAdminVendorIdAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLabelListAttribute( + LabelListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -10963,29 +12425,11 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readWindowStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeWindowStatusAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readAdminFabricIndexAttribute( - long chipClusterPtr, AdminFabricIndexAttributeCallback callback); - - private native void subscribeAdminFabricIndexAttribute( - long chipClusterPtr, - AdminFabricIndexAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readAdminVendorIdAttribute( - long chipClusterPtr, AdminVendorIdAttributeCallback callback); + private native void readLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback); - private native void subscribeAdminVendorIdAttribute( - long chipClusterPtr, - AdminVendorIdAttributeCallback callback, - int minInterval, - int maxInterval); + private native void subscribeLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11033,225 +12477,18 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class OperationalCredentialsCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 62L; - - public OperationalCredentialsCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId); - } - - @Override - public native long initWithDevice(long devicePtr, int endpointId); - - public void attestationRequest(AttestationResponseCallback callback, byte[] attestationNonce) { - attestationRequest(chipClusterPtr, callback, attestationNonce, null); - } - - public void attestationRequest( - AttestationResponseCallback callback, byte[] attestationNonce, int timedInvokeTimeoutMs) { - attestationRequest(chipClusterPtr, callback, attestationNonce, timedInvokeTimeoutMs); - } - - public void certificateChainRequest( - CertificateChainResponseCallback callback, Integer certificateType) { - certificateChainRequest(chipClusterPtr, callback, certificateType, null); - } - - public void certificateChainRequest( - CertificateChainResponseCallback callback, - Integer certificateType, - int timedInvokeTimeoutMs) { - certificateChainRequest(chipClusterPtr, callback, certificateType, timedInvokeTimeoutMs); - } - - public void CSRRequest( - CSRResponseCallback callback, byte[] CSRNonce, Optional isForUpdateNOC) { - CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, null); - } - - public void CSRRequest( - CSRResponseCallback callback, - byte[] CSRNonce, - Optional isForUpdateNOC, - int timedInvokeTimeoutMs) { - CSRRequest(chipClusterPtr, callback, CSRNonce, isForUpdateNOC, timedInvokeTimeoutMs); - } - - public void addNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId) { - addNOC( - chipClusterPtr, - callback, - NOCValue, - ICACValue, - IPKValue, - caseAdminSubject, - adminVendorId, - null); - } - - public void addNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId, - int timedInvokeTimeoutMs) { - addNOC( - chipClusterPtr, - callback, - NOCValue, - ICACValue, - IPKValue, - caseAdminSubject, - adminVendorId, - timedInvokeTimeoutMs); - } - - public void updateNOC( - NOCResponseCallback callback, byte[] NOCValue, Optional ICACValue) { - updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, null); - } - - public void updateNOC( - NOCResponseCallback callback, - byte[] NOCValue, - Optional ICACValue, - int timedInvokeTimeoutMs) { - updateNOC(chipClusterPtr, callback, NOCValue, ICACValue, timedInvokeTimeoutMs); - } - - public void updateFabricLabel(NOCResponseCallback callback, String label) { - updateFabricLabel(chipClusterPtr, callback, label, null); - } - - public void updateFabricLabel( - NOCResponseCallback callback, String label, int timedInvokeTimeoutMs) { - updateFabricLabel(chipClusterPtr, callback, label, timedInvokeTimeoutMs); - } - - public void removeFabric(NOCResponseCallback callback, Integer fabricIndex) { - removeFabric(chipClusterPtr, callback, fabricIndex, null); - } - - public void removeFabric( - NOCResponseCallback callback, Integer fabricIndex, int timedInvokeTimeoutMs) { - removeFabric(chipClusterPtr, callback, fabricIndex, timedInvokeTimeoutMs); - } - - public void addTrustedRootCertificate( - DefaultClusterCallback callback, byte[] rootCACertificate) { - addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, null); - } - - public void addTrustedRootCertificate( - DefaultClusterCallback callback, byte[] rootCACertificate, int timedInvokeTimeoutMs) { - addTrustedRootCertificate(chipClusterPtr, callback, rootCACertificate, timedInvokeTimeoutMs); - } - - private native void attestationRequest( - long chipClusterPtr, - AttestationResponseCallback Callback, - byte[] attestationNonce, - @Nullable Integer timedInvokeTimeoutMs); - - private native void certificateChainRequest( - long chipClusterPtr, - CertificateChainResponseCallback Callback, - Integer certificateType, - @Nullable Integer timedInvokeTimeoutMs); - - private native void CSRRequest( - long chipClusterPtr, - CSRResponseCallback Callback, - byte[] CSRNonce, - Optional isForUpdateNOC, - @Nullable Integer timedInvokeTimeoutMs); - - private native void addNOC( - long chipClusterPtr, - NOCResponseCallback Callback, - byte[] NOCValue, - Optional ICACValue, - byte[] IPKValue, - Long caseAdminSubject, - Integer adminVendorId, - @Nullable Integer timedInvokeTimeoutMs); - - private native void updateNOC( - long chipClusterPtr, - NOCResponseCallback Callback, - byte[] NOCValue, - Optional ICACValue, - @Nullable Integer timedInvokeTimeoutMs); - - private native void updateFabricLabel( - long chipClusterPtr, - NOCResponseCallback Callback, - String label, - @Nullable Integer timedInvokeTimeoutMs); - - private native void removeFabric( - long chipClusterPtr, - NOCResponseCallback Callback, - Integer fabricIndex, - @Nullable Integer timedInvokeTimeoutMs); - - private native void addTrustedRootCertificate( - long chipClusterPtr, - DefaultClusterCallback Callback, - byte[] rootCACertificate, - @Nullable Integer timedInvokeTimeoutMs); - - public interface AttestationResponseCallback { - void onSuccess(byte[] attestationElements, byte[] attestationSignature); - - void onError(Exception error); - } - - public interface CertificateChainResponseCallback { - void onSuccess(byte[] certificate); - - void onError(Exception error); - } - - public interface CSRResponseCallback { - void onSuccess(byte[] NOCSRElements, byte[] attestationSignature); - - void onError(Exception error); - } - - public interface NOCResponseCallback { - void onSuccess(Integer statusCode, Optional fabricIndex, Optional debugText); - - void onError(Exception error); - } - - public interface NOCsAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface FabricsAttributeCallback { - void onSuccess( - List valueList); - - void onError(Exception ex); + public static class UserLabelCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 65L; - default void onSubscriptionEstablished(long subscriptionId) {} + public UserLabelCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); } - public interface TrustedRootCertificatesAttributeCallback { - void onSuccess(List valueList); + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface LabelListAttributeCallback { + void onSuccess(List valueList); void onError(Exception ex); @@ -11290,59 +12527,25 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readNOCsAttribute(NOCsAttributeCallback callback) { - readNOCsAttribute(chipClusterPtr, callback); - } - - public void subscribeNOCsAttribute( - NOCsAttributeCallback callback, int minInterval, int maxInterval) { - subscribeNOCsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readFabricsAttribute(FabricsAttributeCallback callback) { - readFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeFabricsAttribute( - FabricsAttributeCallback callback, int minInterval, int maxInterval) { - subscribeFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readSupportedFabricsAttribute(IntegerAttributeCallback callback) { - readSupportedFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeSupportedFabricsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeSupportedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readCommissionedFabricsAttribute(IntegerAttributeCallback callback) { - readCommissionedFabricsAttribute(chipClusterPtr, callback); - } - - public void subscribeCommissionedFabricsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCommissionedFabricsAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readTrustedRootCertificatesAttribute( - TrustedRootCertificatesAttributeCallback callback) { - readTrustedRootCertificatesAttribute(chipClusterPtr, callback); + public void readLabelListAttribute(LabelListAttributeCallback callback) { + readLabelListAttribute(chipClusterPtr, callback); } - public void subscribeTrustedRootCertificatesAttribute( - TrustedRootCertificatesAttributeCallback callback, int minInterval, int maxInterval) { - subscribeTrustedRootCertificatesAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void writeLabelListAttribute( + DefaultClusterCallback callback, ArrayList value) { + writeLabelListAttribute(chipClusterPtr, callback, value, null); } - public void readCurrentFabricIndexAttribute(IntegerAttributeCallback callback) { - readCurrentFabricIndexAttribute(chipClusterPtr, callback); + public void writeLabelListAttribute( + DefaultClusterCallback callback, + ArrayList value, + int timedWriteTimeoutMs) { + writeLabelListAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); } - public void subscribeCurrentFabricIndexAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeCurrentFabricIndexAttribute(chipClusterPtr, callback, minInterval, maxInterval); + public void subscribeLabelListAttribute( + LabelListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -11399,43 +12602,17 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readNOCsAttribute(long chipClusterPtr, NOCsAttributeCallback callback); - - private native void subscribeNOCsAttribute( - long chipClusterPtr, NOCsAttributeCallback callback, int minInterval, int maxInterval); - - private native void readFabricsAttribute( - long chipClusterPtr, FabricsAttributeCallback callback); - - private native void subscribeFabricsAttribute( - long chipClusterPtr, FabricsAttributeCallback callback, int minInterval, int maxInterval); - - private native void readSupportedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeSupportedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readCommissionedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeCommissionedFabricsAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readTrustedRootCertificatesAttribute( - long chipClusterPtr, TrustedRootCertificatesAttributeCallback callback); + private native void readLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback); - private native void subscribeTrustedRootCertificatesAttribute( + private native void writeLabelListAttribute( long chipClusterPtr, - TrustedRootCertificatesAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); + DefaultClusterCallback callback, + ArrayList value, + @Nullable Integer timedWriteTimeoutMs); - private native void subscribeCurrentFabricIndexAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + private native void subscribeLabelListAttribute( + long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11483,111 +12660,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class GroupKeyManagementCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 63L; + public static class ProxyConfigurationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 66L; - public GroupKeyManagementCluster(long devicePtr, int endpointId) { + public ProxyConfigurationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public void keySetWrite( - DefaultClusterCallback callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet) { - keySetWrite(chipClusterPtr, callback, groupKeySet, null); - } - - public void keySetWrite( - DefaultClusterCallback callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, - int timedInvokeTimeoutMs) { - keySetWrite(chipClusterPtr, callback, groupKeySet, timedInvokeTimeoutMs); - } - - public void keySetRead(KeySetReadResponseCallback callback, Integer groupKeySetID) { - keySetRead(chipClusterPtr, callback, groupKeySetID, null); - } - - public void keySetRead( - KeySetReadResponseCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { - keySetRead(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); - } - - public void keySetRemove(DefaultClusterCallback callback, Integer groupKeySetID) { - keySetRemove(chipClusterPtr, callback, groupKeySetID, null); - } - - public void keySetRemove( - DefaultClusterCallback callback, Integer groupKeySetID, int timedInvokeTimeoutMs) { - keySetRemove(chipClusterPtr, callback, groupKeySetID, timedInvokeTimeoutMs); - } - - public void keySetReadAllIndices( - KeySetReadAllIndicesResponseCallback callback, ArrayList groupKeySetIDs) { - keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, null); - } - - public void keySetReadAllIndices( - KeySetReadAllIndicesResponseCallback callback, - ArrayList groupKeySetIDs, - int timedInvokeTimeoutMs) { - keySetReadAllIndices(chipClusterPtr, callback, groupKeySetIDs, timedInvokeTimeoutMs); - } - - private native void keySetWrite( - long chipClusterPtr, - DefaultClusterCallback Callback, - ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetRead( - long chipClusterPtr, - KeySetReadResponseCallback Callback, - Integer groupKeySetID, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetRemove( - long chipClusterPtr, - DefaultClusterCallback Callback, - Integer groupKeySetID, - @Nullable Integer timedInvokeTimeoutMs); - - private native void keySetReadAllIndices( - long chipClusterPtr, - KeySetReadAllIndicesResponseCallback Callback, - ArrayList groupKeySetIDs, - @Nullable Integer timedInvokeTimeoutMs); - - public interface KeySetReadResponseCallback { - void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct groupKeySet); - - void onError(Exception error); - } - - public interface KeySetReadAllIndicesResponseCallback { - void onSuccess(ArrayList groupKeySetIDs); - - void onError(Exception error); - } - - public interface GroupKeyMapAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public interface GroupTableAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -11612,61 +12694,12 @@ public interface EventListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public interface AttributeListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - - public void readGroupKeyMapAttribute(GroupKeyMapAttributeCallback callback) { - readGroupKeyMapAttribute(chipClusterPtr, callback); - } - - public void writeGroupKeyMapAttribute( - DefaultClusterCallback callback, - ArrayList value) { - writeGroupKeyMapAttribute(chipClusterPtr, callback, value, null); - } - - public void writeGroupKeyMapAttribute( - DefaultClusterCallback callback, - ArrayList value, - int timedWriteTimeoutMs) { - writeGroupKeyMapAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); - } - - public void subscribeGroupKeyMapAttribute( - GroupKeyMapAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGroupKeyMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readGroupTableAttribute(GroupTableAttributeCallback callback) { - readGroupTableAttribute(chipClusterPtr, callback); - } - - public void subscribeGroupTableAttribute( - GroupTableAttributeCallback callback, int minInterval, int maxInterval) { - subscribeGroupTableAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readMaxGroupsPerFabricAttribute(IntegerAttributeCallback callback) { - readMaxGroupsPerFabricAttribute(chipClusterPtr, callback); - } - - public void subscribeMaxGroupsPerFabricAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMaxGroupsPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - - public void readMaxGroupKeysPerFabricAttribute(IntegerAttributeCallback callback) { - readMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback); - } + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); - public void subscribeMaxGroupKeysPerFabricAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - subscribeMaxGroupKeysPerFabricAttribute(chipClusterPtr, callback, minInterval, maxInterval); + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} } public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { @@ -11723,42 +12756,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readGroupKeyMapAttribute( - long chipClusterPtr, GroupKeyMapAttributeCallback callback); - - private native void writeGroupKeyMapAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - ArrayList value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeGroupKeyMapAttribute( - long chipClusterPtr, - GroupKeyMapAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readGroupTableAttribute( - long chipClusterPtr, GroupTableAttributeCallback callback); - - private native void subscribeGroupTableAttribute( - long chipClusterPtr, - GroupTableAttributeCallback callback, - int minInterval, - int maxInterval); - - private native void readMaxGroupsPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeMaxGroupsPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - - private native void readMaxGroupKeysPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback); - - private native void subscribeMaxGroupKeysPerFabricAttribute( - long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11805,24 +12802,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class FixedLabelCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 64L; + public static class ProxyDiscoveryCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 67L; - public FixedLabelCluster(long devicePtr, int endpointId) { + public ProxyDiscoveryCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public interface LabelListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -11855,15 +12844,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readLabelListAttribute(LabelListAttributeCallback callback) { - readLabelListAttribute(chipClusterPtr, callback); - } - - public void subscribeLabelListAttribute( - LabelListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -11918,12 +12898,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback); - - private native void subscribeLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -11970,24 +12944,16 @@ private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } - public static class UserLabelCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 65L; + public static class ProxyValidCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 68L; - public UserLabelCluster(long devicePtr, int endpointId) { + public ProxyValidCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId); } @Override public native long initWithDevice(long devicePtr, int endpointId); - public interface LabelListAttributeCallback { - void onSuccess(List valueList); - - void onError(Exception ex); - - default void onSubscriptionEstablished(long subscriptionId) {} - } - public interface GeneratedCommandListAttributeCallback { void onSuccess(List valueList); @@ -12020,27 +12986,6 @@ public interface AttributeListAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } - public void readLabelListAttribute(LabelListAttributeCallback callback) { - readLabelListAttribute(chipClusterPtr, callback); - } - - public void writeLabelListAttribute( - DefaultClusterCallback callback, ArrayList value) { - writeLabelListAttribute(chipClusterPtr, callback, value, null); - } - - public void writeLabelListAttribute( - DefaultClusterCallback callback, - ArrayList value, - int timedWriteTimeoutMs) { - writeLabelListAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); - } - - public void subscribeLabelListAttribute( - LabelListAttributeCallback callback, int minInterval, int maxInterval) { - subscribeLabelListAttribute(chipClusterPtr, callback, minInterval, maxInterval); - } - public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { readGeneratedCommandListAttribute(chipClusterPtr, callback); } @@ -12095,18 +13040,6 @@ public void subscribeClusterRevisionAttribute( subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); } - private native void readLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback); - - private native void writeLabelListAttribute( - long chipClusterPtr, - DefaultClusterCallback callback, - ArrayList value, - @Nullable Integer timedWriteTimeoutMs); - - private native void subscribeLabelListAttribute( - long chipClusterPtr, LabelListAttributeCallback callback, int minInterval, int maxInterval); - private native void readGeneratedCommandListAttribute( long chipClusterPtr, GeneratedCommandListAttributeCallback callback); @@ -33795,4 +34728,146 @@ private native void readClusterRevisionAttribute( private native void subscribeClusterRevisionAttribute( long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); } + + public static class FaultInjectionCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 4294048774L; + + public FaultInjectionCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public interface GeneratedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AcceptedCommandListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface EventListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public interface AttributeListAttributeCallback { + void onSuccess(List valueList); + + void onError(Exception ex); + + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readGeneratedCommandListAttribute(GeneratedCommandListAttributeCallback callback) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute(AcceptedCommandListAttributeCallback callback) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute(EventListAttributeCallback callback) { + readEventListAttribute(chipClusterPtr, callback); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute(AttributeListAttributeCallback callback) { + readAttributeListAttribute(chipClusterPtr, callback); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute(LongAttributeCallback callback) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute(IntegerAttributeCallback callback) { + readClusterRevisionAttribute(chipClusterPtr, callback); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + subscribeClusterRevisionAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + private native void readGeneratedCommandListAttribute( + long chipClusterPtr, GeneratedCommandListAttributeCallback callback); + + private native void subscribeGeneratedCommandListAttribute( + long chipClusterPtr, + GeneratedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readAcceptedCommandListAttribute( + long chipClusterPtr, AcceptedCommandListAttributeCallback callback); + + private native void subscribeAcceptedCommandListAttribute( + long chipClusterPtr, + AcceptedCommandListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback); + + private native void subscribeEventListAttribute( + long chipClusterPtr, EventListAttributeCallback callback, int minInterval, int maxInterval); + + private native void readAttributeListAttribute( + long chipClusterPtr, AttributeListAttributeCallback callback); + + private native void subscribeAttributeListAttribute( + long chipClusterPtr, + AttributeListAttributeCallback callback, + int minInterval, + int maxInterval); + + private native void readFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback); + + private native void subscribeFeatureMapAttribute( + long chipClusterPtr, LongAttributeCallback callback, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback); + + private native void subscribeClusterRevisionAttribute( + long chipClusterPtr, IntegerAttributeCallback callback, int minInterval, int maxInterval); + } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java index 9f079111c14841..222ed166cc4333 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipEventStructs.java @@ -653,6 +653,88 @@ public String toString() { } } + public static class TimeSynchronizationClusterDSTTableEmptyEvent { + + public TimeSynchronizationClusterDSTTableEmptyEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTTableEmptyEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterDSTStatusEvent { + public Boolean DSTOffsetActive; + + public TimeSynchronizationClusterDSTStatusEvent(Boolean DSTOffsetActive) { + this.DSTOffsetActive = DSTOffsetActive; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTStatusEvent {\n"); + output.append("\tDSTOffsetActive: "); + output.append(DSTOffsetActive); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeZoneStatusEvent { + public Long offset; + public Optional name; + + public TimeSynchronizationClusterTimeZoneStatusEvent(Long offset, Optional name) { + this.offset = offset; + this.name = name; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeZoneStatusEvent {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeFailureEvent { + + public TimeSynchronizationClusterTimeFailureEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeFailureEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterMissingTrustedTimeSourceEvent { + + public TimeSynchronizationClusterMissingTrustedTimeSourceEvent() {} + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterMissingTrustedTimeSourceEvent {\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedDeviceBasicInformationClusterStartUpEvent { public Long softwareVersion; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java index 2d67c350f0886c..d6b41b24ba33de 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -46,6 +46,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 15L) { return "BinaryInputBasic"; } + if (clusterId == 28L) { + return "PulseWidthModulation"; + } if (clusterId == 29L) { return "Descriptor"; } @@ -106,6 +109,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 55L) { return "EthernetNetworkDiagnostics"; } + if (clusterId == 56L) { + return "TimeSynchronization"; + } if (clusterId == 57L) { return "BridgedDeviceBasicInformation"; } @@ -127,6 +133,15 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 65L) { return "UserLabel"; } + if (clusterId == 66L) { + return "ProxyConfiguration"; + } + if (clusterId == 67L) { + return "ProxyDiscovery"; + } + if (clusterId == 68L) { + return "ProxyValid"; + } if (clusterId == 69L) { return "BooleanState"; } @@ -262,6 +277,9 @@ public static String clusterIdToName(long clusterId) { if (clusterId == 4294048773L) { return "UnitTesting"; } + if (clusterId == 4294048774L) { + return "FaultInjection"; + } return ""; } @@ -534,6 +552,27 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 28L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 29L) { if (attributeId == 0L) { return "DeviceTypeList"; @@ -1515,6 +1554,66 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 56L) { + if (attributeId == 0L) { + return "UTCTime"; + } + if (attributeId == 1L) { + return "Granularity"; + } + if (attributeId == 2L) { + return "TimeSource"; + } + if (attributeId == 3L) { + return "TrustedTimeSource"; + } + if (attributeId == 4L) { + return "DefaultNTP"; + } + if (attributeId == 5L) { + return "TimeZone"; + } + if (attributeId == 6L) { + return "DSTOffset"; + } + if (attributeId == 7L) { + return "LocalTime"; + } + if (attributeId == 8L) { + return "TimeZoneDatabase"; + } + if (attributeId == 9L) { + return "NTPServerAvailable"; + } + if (attributeId == 10L) { + return "TimeZoneListMaxSize"; + } + if (attributeId == 11L) { + return "DSTOffsetListMaxSize"; + } + if (attributeId == 12L) { + return "SupportsDNSResolve"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 57L) { if (attributeId == 1L) { return "VendorName"; @@ -1764,6 +1863,69 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 66L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 67L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 68L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } if (clusterId == 69L) { if (attributeId == 0L) { return "StateValue"; @@ -4386,6 +4548,27 @@ public static String attributeIdToName(long clusterId, long attributeId) { } return ""; } + if (clusterId == 4294048774L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } return ""; } @@ -4415,6 +4598,9 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 15L) { return ""; } + if (clusterId == 28L) { + return ""; + } if (clusterId == 29L) { return ""; } @@ -4547,6 +4733,24 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 55L) { return ""; } + if (clusterId == 56L) { + if (eventId == 0L) { + return "DSTTableEmpty"; + } + if (eventId == 1L) { + return "DSTStatus"; + } + if (eventId == 2L) { + return "TimeZoneStatus"; + } + if (eventId == 3L) { + return "TimeFailure"; + } + if (eventId == 4L) { + return "MissingTrustedTimeSource"; + } + return ""; + } if (clusterId == 57L) { if (eventId == 0L) { return "StartUp"; @@ -4601,6 +4805,15 @@ public static String eventIdToName(long clusterId, long eventId) { if (clusterId == 65L) { return ""; } + if (clusterId == 66L) { + return ""; + } + if (clusterId == 67L) { + return ""; + } + if (clusterId == 68L) { + return ""; + } if (clusterId == 69L) { if (eventId == 0L) { return "StateChange"; @@ -4811,6 +5024,9 @@ public static String eventIdToName(long clusterId, long eventId) { } return ""; } + if (clusterId == 4294048774L) { + return ""; + } return ""; } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 238ab930c6f0cb..552977ba3dd20c 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1029,6 +1029,121 @@ public String toString() { } } + public static class TimeSynchronizationClusterDSTOffsetStruct { + public Long offset; + public Long validStarting; + public @Nullable Long validUntil; + + public TimeSynchronizationClusterDSTOffsetStruct( + Long offset, Long validStarting, @Nullable Long validUntil) { + this.offset = offset; + this.validStarting = validStarting; + this.validUntil = validUntil; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterDSTOffsetStruct {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tvalidStarting: "); + output.append(validStarting); + output.append("\n"); + output.append("\tvalidUntil: "); + output.append(validUntil); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct { + public Long nodeID; + public Integer endpoint; + + public TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct( + Long nodeID, Integer endpoint) { + this.nodeID = nodeID; + this.endpoint = endpoint; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterFabricScopedTrustedTimeSourceStruct {\n"); + output.append("\tnodeID: "); + output.append(nodeID); + output.append("\n"); + output.append("\tendpoint: "); + output.append(endpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTimeZoneStruct { + public Long offset; + public Long validAt; + public Optional name; + + public TimeSynchronizationClusterTimeZoneStruct( + Long offset, Long validAt, Optional name) { + this.offset = offset; + this.validAt = validAt; + this.name = name; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTimeZoneStruct {\n"); + output.append("\toffset: "); + output.append(offset); + output.append("\n"); + output.append("\tvalidAt: "); + output.append(validAt); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + + public static class TimeSynchronizationClusterTrustedTimeSourceStruct { + public Integer fabricIndex; + public Long nodeID; + public Integer endpoint; + + public TimeSynchronizationClusterTrustedTimeSourceStruct( + Integer fabricIndex, Long nodeID, Integer endpoint) { + this.fabricIndex = fabricIndex; + this.nodeID = nodeID; + this.endpoint = endpoint; + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("TimeSynchronizationClusterTrustedTimeSourceStruct {\n"); + output.append("\tfabricIndex: "); + output.append(fabricIndex); + output.append("\n"); + output.append("\tnodeID: "); + output.append(nodeID); + output.append("\n"); + output.append("\tendpoint: "); + output.append(endpoint); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } + } + public static class BridgedDeviceBasicInformationClusterProductAppearanceStruct { public Integer finish; public @Nullable Integer primaryColor; diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index bb0c456fba3fe9..a85e4501ab5996 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -1366,6 +1366,102 @@ public void onError(Exception ex) { } } + public static class DelegatedPulseWidthModulationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPulseWidthModulationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPulseWidthModulationClusterEventListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.EventListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedPulseWidthModulationClusterAttributeListAttributeCallback + implements ChipClusters.PulseWidthModulationCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedDescriptorClusterDeviceTypeListAttributeCallback implements ChipClusters.DescriptorCluster.DeviceTypeListAttributeCallback, DelegatedClusterCallback { @@ -5258,10 +5354,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedBridgedDeviceBasicInformationClusterGeneratedCommandListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster - .GeneratedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterUTCTimeAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.UTCTimeAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5271,10 +5365,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable Long value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -5284,10 +5378,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedBridgedDeviceBasicInformationClusterAcceptedCommandListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster - .AcceptedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterDefaultNTPAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.DefaultNTPAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5297,10 +5389,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(@Nullable String value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "String"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @@ -5310,8 +5402,8 @@ public void onError(Exception ex) { } } - public static class DelegatedBridgedDeviceBasicInformationClusterEventListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster.EventListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterTimeZoneAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.TimeZoneAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5321,9 +5413,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5334,8 +5428,8 @@ public void onError(Exception ex) { } } - public static class DelegatedBridgedDeviceBasicInformationClusterAttributeListAttributeCallback - implements ChipClusters.BridgedDeviceBasicInformationCluster.AttributeListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterDSTOffsetAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.DSTOffsetAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5345,9 +5439,11 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5358,8 +5454,32 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterGeneratedCommandListAttributeCallback - implements ChipClusters.SwitchCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterLocalTimeAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.LocalTimeAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable Long value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Long"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedTimeSynchronizationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5382,8 +5502,8 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterAcceptedCommandListAttributeCallback - implements ChipClusters.SwitchCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5406,8 +5526,9 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterEventListAttributeCallback - implements ChipClusters.SwitchCluster.EventListAttributeCallback, DelegatedClusterCallback { + public static class DelegatedTimeSynchronizationClusterEventListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.EventListAttributeCallback, + DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5429,8 +5550,8 @@ public void onError(Exception ex) { } } - public static class DelegatedSwitchClusterAttributeListAttributeCallback - implements ChipClusters.SwitchCluster.AttributeListAttributeCallback, + public static class DelegatedTimeSynchronizationClusterAttributeListAttributeCallback + implements ChipClusters.TimeSynchronizationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5453,8 +5574,10 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAdminFabricIndexAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AdminFabricIndexAttributeCallback, + public static + class DelegatedBridgedDeviceBasicInformationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster + .GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5464,10 +5587,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5477,8 +5600,10 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAdminVendorIdAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AdminVendorIdAttributeCallback, + public static + class DelegatedBridgedDeviceBasicInformationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster + .AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5488,10 +5613,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(@Nullable Integer value) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); - responseValues.put(commandResponseInfo, value); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5501,10 +5626,8 @@ public void onError(Exception ex) { } } - public static - class DelegatedAdministratorCommissioningClusterGeneratedCommandListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster - .GeneratedCommandListAttributeCallback, + public static class DelegatedBridgedDeviceBasicInformationClusterEventListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5527,9 +5650,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAcceptedCommandListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster - .AcceptedCommandListAttributeCallback, + public static class DelegatedBridgedDeviceBasicInformationClusterAttributeListAttributeCallback + implements ChipClusters.BridgedDeviceBasicInformationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5552,8 +5674,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterEventListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.EventListAttributeCallback, + public static class DelegatedSwitchClusterGeneratedCommandListAttributeCallback + implements ChipClusters.SwitchCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5576,8 +5698,8 @@ public void onError(Exception ex) { } } - public static class DelegatedAdministratorCommissioningClusterAttributeListAttributeCallback - implements ChipClusters.AdministratorCommissioningCluster.AttributeListAttributeCallback, + public static class DelegatedSwitchClusterAcceptedCommandListAttributeCallback + implements ChipClusters.SwitchCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5600,9 +5722,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAttestationResponseCallback - implements ChipClusters.OperationalCredentialsCluster.AttestationResponseCallback, - DelegatedClusterCallback { + public static class DelegatedSwitchClusterEventListAttributeCallback + implements ChipClusters.SwitchCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -5611,25 +5732,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] AttestationElements, byte[] AttestationSignature) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo AttestationElementsResponseValue = - new CommandResponseInfo("AttestationElements", "byte[]"); - responseValues.put(AttestationElementsResponseValue, AttestationElements); - CommandResponseInfo AttestationSignatureResponseValue = - new CommandResponseInfo("AttestationSignature", "byte[]"); - responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterCertificateChainResponseCallback - implements ChipClusters.OperationalCredentialsCluster.CertificateChainResponseCallback, + public static class DelegatedSwitchClusterAttributeListAttributeCallback + implements ChipClusters.SwitchCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5639,22 +5756,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] Certificate) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo CertificateResponseValue = - new CommandResponseInfo("Certificate", "byte[]"); - responseValues.put(CertificateResponseValue, Certificate); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterCSRResponseCallback - implements ChipClusters.OperationalCredentialsCluster.CSRResponseCallback, + public static class DelegatedAdministratorCommissioningClusterAdminFabricIndexAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AdminFabricIndexAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5664,25 +5780,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(byte[] NOCSRElements, byte[] AttestationSignature) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo NOCSRElementsResponseValue = - new CommandResponseInfo("NOCSRElements", "byte[]"); - responseValues.put(NOCSRElementsResponseValue, NOCSRElements); - CommandResponseInfo AttestationSignatureResponseValue = - new CommandResponseInfo("AttestationSignature", "byte[]"); - responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterNOCResponseCallback - implements ChipClusters.OperationalCredentialsCluster.NOCResponseCallback, + public static class DelegatedAdministratorCommissioningClusterAdminVendorIdAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AdminVendorIdAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5692,12 +5804,216 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - Integer StatusCode, Optional FabricIndex, Optional DebugText) { + public void onSuccess(@Nullable Integer value) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo StatusCodeResponseValue = - new CommandResponseInfo("StatusCode", "Integer"); - responseValues.put(StatusCodeResponseValue, StatusCode); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "Integer"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static + class DelegatedAdministratorCommissioningClusterGeneratedCommandListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster + .GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedAdministratorCommissioningClusterAcceptedCommandListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster + .AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedAdministratorCommissioningClusterEventListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.EventListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedAdministratorCommissioningClusterAttributeListAttributeCallback + implements ChipClusters.AdministratorCommissioningCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterAttestationResponseCallback + implements ChipClusters.OperationalCredentialsCluster.AttestationResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] AttestationElements, byte[] AttestationSignature) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo AttestationElementsResponseValue = + new CommandResponseInfo("AttestationElements", "byte[]"); + responseValues.put(AttestationElementsResponseValue, AttestationElements); + CommandResponseInfo AttestationSignatureResponseValue = + new CommandResponseInfo("AttestationSignature", "byte[]"); + responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterCertificateChainResponseCallback + implements ChipClusters.OperationalCredentialsCluster.CertificateChainResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] Certificate) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo CertificateResponseValue = + new CommandResponseInfo("Certificate", "byte[]"); + responseValues.put(CertificateResponseValue, Certificate); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterCSRResponseCallback + implements ChipClusters.OperationalCredentialsCluster.CSRResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(byte[] NOCSRElements, byte[] AttestationSignature) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo NOCSRElementsResponseValue = + new CommandResponseInfo("NOCSRElements", "byte[]"); + responseValues.put(NOCSRElementsResponseValue, NOCSRElements); + CommandResponseInfo AttestationSignatureResponseValue = + new CommandResponseInfo("AttestationSignature", "byte[]"); + responseValues.put(AttestationSignatureResponseValue, AttestationSignature); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterNOCResponseCallback + implements ChipClusters.OperationalCredentialsCluster.NOCResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + Integer StatusCode, Optional FabricIndex, Optional DebugText) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo StatusCodeResponseValue = + new CommandResponseInfo("StatusCode", "Integer"); + responseValues.put(StatusCodeResponseValue, StatusCode); CommandResponseInfo FabricIndexResponseValue = new CommandResponseInfo("FabricIndex", "Optional"); responseValues.put(FabricIndexResponseValue, FabricIndex); @@ -5708,13 +6024,312 @@ public void onSuccess( } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedOperationalCredentialsClusterNOCsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterFabricsAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess( + List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterTrustedRootCertificatesAttributeCallback + implements ChipClusters.OperationalCredentialsCluster + .TrustedRootCertificatesAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterGeneratedCommandListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterAcceptedCommandListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterEventListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.EventListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedOperationalCredentialsClusterAttributeListAttributeCallback + implements ChipClusters.OperationalCredentialsCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedGroupKeyManagementClusterKeySetReadResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct GroupKeySet) { + Map responseValues = new LinkedHashMap<>(); + // GroupKeySet: Struct GroupKeySetStruct + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback + implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(ArrayList GroupKeySetIDs) { + Map responseValues = new LinkedHashMap<>(); + // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * + // Conversion from this type to Java is not properly implemented yet + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedGroupKeyManagementClusterGroupTableAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo( + "valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedGroupKeyManagementClusterGeneratedCommandListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedOperationalCredentialsClusterNOCsAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.NOCsAttributeCallback, + public static class DelegatedGroupKeyManagementClusterAcceptedCommandListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5724,11 +6339,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5739,8 +6352,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterFabricsAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.FabricsAttributeCallback, + public static class DelegatedGroupKeyManagementClusterEventListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5750,12 +6363,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( - List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5766,9 +6376,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterTrustedRootCertificatesAttributeCallback - implements ChipClusters.OperationalCredentialsCluster - .TrustedRootCertificatesAttributeCallback, + public static class DelegatedGroupKeyManagementClusterAttributeListAttributeCallback + implements ChipClusters.GroupKeyManagementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5778,10 +6387,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5792,8 +6400,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterGeneratedCommandListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedFixedLabelClusterLabelListAttributeCallback + implements ChipClusters.FixedLabelCluster.LabelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5803,9 +6411,10 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5816,8 +6425,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAcceptedCommandListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedFixedLabelClusterGeneratedCommandListAttributeCallback + implements ChipClusters.FixedLabelCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5840,8 +6449,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterEventListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.EventListAttributeCallback, + public static class DelegatedFixedLabelClusterAcceptedCommandListAttributeCallback + implements ChipClusters.FixedLabelCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5864,8 +6473,8 @@ public void onError(Exception ex) { } } - public static class DelegatedOperationalCredentialsClusterAttributeListAttributeCallback - implements ChipClusters.OperationalCredentialsCluster.AttributeListAttributeCallback, + public static class DelegatedFixedLabelClusterEventListAttributeCallback + implements ChipClusters.FixedLabelCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5888,8 +6497,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterKeySetReadResponseCallback - implements ChipClusters.GroupKeyManagementCluster.KeySetReadResponseCallback, + public static class DelegatedFixedLabelClusterAttributeListAttributeCallback + implements ChipClusters.FixedLabelCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5899,21 +6508,21 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ChipStructs.GroupKeyManagementClusterGroupKeySetStruct GroupKeySet) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySet: Struct GroupKeySetStruct - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedGroupKeyManagementClusterKeySetReadAllIndicesResponseCallback - implements ChipClusters.GroupKeyManagementCluster.KeySetReadAllIndicesResponseCallback, + public static class DelegatedUserLabelClusterLabelListAttributeCallback + implements ChipClusters.UserLabelCluster.LabelListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5923,21 +6532,22 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(ArrayList GroupKeySetIDs) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - // GroupKeySetIDs: /* TYPE WARNING: array array defaults to */ uint8_t * - // Conversion from this type to Java is not properly implemented yet + CommandResponseInfo commandResponseInfo = + new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @Override - public void onError(Exception error) { - callback.onFailure(error); + public void onError(Exception ex) { + callback.onFailure(ex); } } - public static class DelegatedGroupKeyManagementClusterGroupKeyMapAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupKeyMapAttributeCallback, + public static class DelegatedUserLabelClusterGeneratedCommandListAttributeCallback + implements ChipClusters.UserLabelCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5947,11 +6557,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5962,8 +6570,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGroupTableAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GroupTableAttributeCallback, + public static class DelegatedUserLabelClusterAcceptedCommandListAttributeCallback + implements ChipClusters.UserLabelCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -5973,11 +6581,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo( - "valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -5988,8 +6594,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterGeneratedCommandListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedUserLabelClusterEventListAttributeCallback + implements ChipClusters.UserLabelCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6012,8 +6618,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterAcceptedCommandListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedUserLabelClusterAttributeListAttributeCallback + implements ChipClusters.UserLabelCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6036,8 +6642,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterEventListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.EventListAttributeCallback, + public static class DelegatedProxyConfigurationClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6060,8 +6666,8 @@ public void onError(Exception ex) { } } - public static class DelegatedGroupKeyManagementClusterAttributeListAttributeCallback - implements ChipClusters.GroupKeyManagementCluster.AttributeListAttributeCallback, + public static class DelegatedProxyConfigurationClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6084,8 +6690,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterLabelListAttributeCallback - implements ChipClusters.FixedLabelCluster.LabelListAttributeCallback, + public static class DelegatedProxyConfigurationClusterEventListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6095,10 +6701,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6109,8 +6714,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterGeneratedCommandListAttributeCallback - implements ChipClusters.FixedLabelCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedProxyConfigurationClusterAttributeListAttributeCallback + implements ChipClusters.ProxyConfigurationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6133,8 +6738,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterAcceptedCommandListAttributeCallback - implements ChipClusters.FixedLabelCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6157,8 +6762,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterEventListAttributeCallback - implements ChipClusters.FixedLabelCluster.EventListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6181,8 +6786,8 @@ public void onError(Exception ex) { } } - public static class DelegatedFixedLabelClusterAttributeListAttributeCallback - implements ChipClusters.FixedLabelCluster.AttributeListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterEventListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6205,8 +6810,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterLabelListAttributeCallback - implements ChipClusters.UserLabelCluster.LabelListAttributeCallback, + public static class DelegatedProxyDiscoveryClusterAttributeListAttributeCallback + implements ChipClusters.ProxyDiscoveryCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6216,10 +6821,9 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess(List valueList) { + public void onSuccess(List valueList) { Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = - new CommandResponseInfo("valueList", "List"); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); callback.onSuccess(responseValues); } @@ -6230,8 +6834,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterGeneratedCommandListAttributeCallback - implements ChipClusters.UserLabelCluster.GeneratedCommandListAttributeCallback, + public static class DelegatedProxyValidClusterGeneratedCommandListAttributeCallback + implements ChipClusters.ProxyValidCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6254,8 +6858,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterAcceptedCommandListAttributeCallback - implements ChipClusters.UserLabelCluster.AcceptedCommandListAttributeCallback, + public static class DelegatedProxyValidClusterAcceptedCommandListAttributeCallback + implements ChipClusters.ProxyValidCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6278,8 +6882,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterEventListAttributeCallback - implements ChipClusters.UserLabelCluster.EventListAttributeCallback, + public static class DelegatedProxyValidClusterEventListAttributeCallback + implements ChipClusters.ProxyValidCluster.EventListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -6302,8 +6906,8 @@ public void onError(Exception ex) { } } - public static class DelegatedUserLabelClusterAttributeListAttributeCallback - implements ChipClusters.UserLabelCluster.AttributeListAttributeCallback, + public static class DelegatedProxyValidClusterAttributeListAttributeCallback + implements ChipClusters.ProxyValidCluster.AttributeListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -14527,6 +15131,102 @@ public void onError(Exception ex) { } } + public static class DelegatedFaultInjectionClusterGeneratedCommandListAttributeCallback + implements ChipClusters.FaultInjectionCluster.GeneratedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedFaultInjectionClusterAcceptedCommandListAttributeCallback + implements ChipClusters.FaultInjectionCluster.AcceptedCommandListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedFaultInjectionClusterEventListAttributeCallback + implements ChipClusters.FaultInjectionCluster.EventListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedFaultInjectionClusterAttributeListAttributeCallback + implements ChipClusters.FaultInjectionCluster.AttributeListAttributeCallback, + DelegatedClusterCallback { + private ClusterCommandCallback callback; + + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public Map getClusterMap() { Map clusterMap = initializeClusterMap(); Map> commandMap = getCommandMap(); @@ -14574,6 +15274,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.BinaryInputBasicCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("binaryInputBasic", binaryInputBasicClusterInfo); + ClusterInfo pulseWidthModulationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.PulseWidthModulationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("pulseWidthModulation", pulseWidthModulationClusterInfo); ClusterInfo descriptorClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.DescriptorCluster(ptr, endpointId), @@ -14674,6 +15379,11 @@ public Map initializeClusterMap() { new ChipClusters.EthernetNetworkDiagnosticsCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInfo); + ClusterInfo timeSynchronizationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.TimeSynchronizationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("timeSynchronization", timeSynchronizationClusterInfo); ClusterInfo bridgedDeviceBasicInformationClusterInfo = new ClusterInfo( (ptr, endpointId) -> @@ -14710,6 +15420,21 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.UserLabelCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("userLabel", userLabelClusterInfo); + ClusterInfo proxyConfigurationClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyConfigurationCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyConfiguration", proxyConfigurationClusterInfo); + ClusterInfo proxyDiscoveryClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyDiscoveryCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyDiscovery", proxyDiscoveryClusterInfo); + ClusterInfo proxyValidClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ProxyValidCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("proxyValid", proxyValidClusterInfo); ClusterInfo booleanStateClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.BooleanStateCluster(ptr, endpointId), @@ -14940,6 +15665,11 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.UnitTestingCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("unitTesting", unitTestingClusterInfo); + ClusterInfo faultInjectionClusterInfo = + new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.FaultInjectionCluster(ptr, endpointId), + new HashMap<>()); + clusterMap.put("faultInjection", faultInjectionClusterInfo); return clusterMap; } @@ -14954,6 +15684,7 @@ public void combineCommand( .combineCommands(source.get("onOffSwitchConfiguration")); destination.get("levelControl").combineCommands(source.get("levelControl")); destination.get("binaryInputBasic").combineCommands(source.get("binaryInputBasic")); + destination.get("pulseWidthModulation").combineCommands(source.get("pulseWidthModulation")); destination.get("descriptor").combineCommands(source.get("descriptor")); destination.get("binding").combineCommands(source.get("binding")); destination.get("accessControl").combineCommands(source.get("accessControl")); @@ -14986,6 +15717,7 @@ public void combineCommand( destination .get("ethernetNetworkDiagnostics") .combineCommands(source.get("ethernetNetworkDiagnostics")); + destination.get("timeSynchronization").combineCommands(source.get("timeSynchronization")); destination .get("bridgedDeviceBasicInformation") .combineCommands(source.get("bridgedDeviceBasicInformation")); @@ -14997,6 +15729,9 @@ public void combineCommand( destination.get("groupKeyManagement").combineCommands(source.get("groupKeyManagement")); destination.get("fixedLabel").combineCommands(source.get("fixedLabel")); destination.get("userLabel").combineCommands(source.get("userLabel")); + destination.get("proxyConfiguration").combineCommands(source.get("proxyConfiguration")); + destination.get("proxyDiscovery").combineCommands(source.get("proxyDiscovery")); + destination.get("proxyValid").combineCommands(source.get("proxyValid")); destination.get("booleanState").combineCommands(source.get("booleanState")); destination.get("icdManagement").combineCommands(source.get("icdManagement")); destination.get("modeSelect").combineCommands(source.get("modeSelect")); @@ -15060,6 +15795,7 @@ public void combineCommand( destination.get("accountLogin").combineCommands(source.get("accountLogin")); destination.get("electricalMeasurement").combineCommands(source.get("electricalMeasurement")); destination.get("unitTesting").combineCommands(source.get("unitTesting")); + destination.get("faultInjection").combineCommands(source.get("faultInjection")); } @SuppressWarnings("unchecked") @@ -15771,6 +16507,9 @@ public Map> getCommandMap() { commandMap.put("levelControl", levelControlClusterInteractionInfoMap); Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); + Map pulseWidthModulationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("pulseWidthModulation", pulseWidthModulationClusterInteractionInfoMap); Map descriptorClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("descriptor", descriptorClusterInteractionInfoMap); Map bindingClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -16667,6 +17406,9 @@ public Map> getCommandMap() { "resetCounts", ethernetNetworkDiagnosticsresetCountsInteractionInfo); commandMap.put( "ethernetNetworkDiagnostics", ethernetNetworkDiagnosticsClusterInteractionInfoMap); + Map timeSynchronizationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("timeSynchronization", timeSynchronizationClusterInteractionInfoMap); Map bridgedDeviceBasicInformationClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put( @@ -17047,6 +17789,13 @@ public Map> getCommandMap() { commandMap.put("fixedLabel", fixedLabelClusterInteractionInfoMap); Map userLabelClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("userLabel", userLabelClusterInteractionInfoMap); + Map proxyConfigurationClusterInteractionInfoMap = + new LinkedHashMap<>(); + commandMap.put("proxyConfiguration", proxyConfigurationClusterInteractionInfoMap); + Map proxyDiscoveryClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("proxyDiscovery", proxyDiscoveryClusterInteractionInfoMap); + Map proxyValidClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("proxyValid", proxyValidClusterInteractionInfoMap); Map booleanStateClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("booleanState", booleanStateClusterInteractionInfoMap); Map icdManagementClusterInteractionInfoMap = new LinkedHashMap<>(); @@ -19621,6 +20370,8 @@ public Map> getCommandMap() { unitTestingClusterInteractionInfoMap.put( "testEmitTestEventRequest", unitTestingtestEmitTestEventRequestInteractionInfo); commandMap.put("unitTesting", unitTestingClusterInteractionInfoMap); + Map faultInjectionClusterInteractionInfoMap = new LinkedHashMap<>(); + commandMap.put("faultInjection", faultInjectionClusterInteractionInfoMap); return commandMap; } }