From c6603d293c38aa85049390be51b08e2d0a9ea217 Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Mon, 3 May 2021 10:04:06 -0500 Subject: [PATCH 01/31] Enable SRP for the cc26x2x7 (#6377) * Add configuration to enable the OpenThread SRP client * Add default GN option to add the CHIP platform mDNS code --- .../cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h | 7 +++++++ .../cc13x2x7_26x2x7/main/include/OpenThreadConfig.h | 2 ++ src/platform/cc13x2_26x2/Logging.cpp | 1 - src/platform/cc13x2_26x2/cc13x2_26x2-mbedtls-config.h | 1 + src/platform/device.gni | 3 ++- 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 0e57358d7ad012..c0330d33d649df 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -141,6 +141,13 @@ */ #define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) +/** + * CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + * + * Enable the OpenThread SRP client to allow for CHIP device discovery. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 + /** * CHIP_CONFIG_EVENT_LOGGING_DEFAULT_IMPORTANCE * diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h index 48b12b2dae3ac6..4079b251280ddc 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/OpenThreadConfig.h @@ -51,6 +51,8 @@ #define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 #define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 +#define OPENTHREAD_CONFIG_ECDSA_ENABLE 1 +#define OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE 1 // Use the TI-supplied default platform configuration for remainder #include "openthread-core-cc13x2_26x2-config.h" diff --git a/src/platform/cc13x2_26x2/Logging.cpp b/src/platform/cc13x2_26x2/Logging.cpp index 87807d871cc804..b807fdea65b373 100644 --- a/src/platform/cc13x2_26x2/Logging.cpp +++ b/src/platform/cc13x2_26x2/Logging.cpp @@ -45,7 +45,6 @@ extern "C" void cc13x2_26x2VLog(const char * msg, va_list v) size_t len = (ret + 2U) < sizeof(sDebugUartBuffer) ? (ret + 2) : sizeof(sDebugUartBuffer); sDebugUartBuffer[len - 2] = '\r'; sDebugUartBuffer[len - 1] = '\n'; - sDebugUartBuffer[len] = '\0'; UART_write(sDebugUartHandle, sDebugUartBuffer, len); } diff --git a/src/platform/cc13x2_26x2/cc13x2_26x2-mbedtls-config.h b/src/platform/cc13x2_26x2/cc13x2_26x2-mbedtls-config.h index d4fd3f2f6a8917..8d2c7f64a27319 100644 --- a/src/platform/cc13x2_26x2/cc13x2_26x2-mbedtls-config.h +++ b/src/platform/cc13x2_26x2/cc13x2_26x2-mbedtls-config.h @@ -105,6 +105,7 @@ #define MBEDTLS_BASE64_C #define MBEDTLS_ECDH_C #define MBEDTLS_ECDSA_C +#define MBEDTLS_ECDSA_DETERMINISTIC #define MBEDTLS_OID_C #define MBEDTLS_PEM_PARSE_C #define MBEDTLS_X509_USE_C diff --git a/src/platform/device.gni b/src/platform/device.gni index dd8019f14c703b..d50d6956675ec2 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -52,7 +52,8 @@ declare_args() { # Select DNS-SD implementation if (chip_device_platform == "linux" || chip_device_platform == "esp32") { chip_mdns = "minimal" - } else if (chip_device_platform == "darwin") { + } else if (chip_device_platform == "darwin" || + chip_device_platform == "cc13x2_26x2") { chip_mdns = "platform" } else { chip_mdns = "none" From b9d954e912b5c018517ca0c6ca7c133bdf9f5371 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 3 May 2021 08:31:33 -0700 Subject: [PATCH 02/31] Add Crypto API to verify the CSR and get pubkey (#6405) * Add Crypto API to verify the CSR and get pubkey * fix test build * Detect if CSR parsing is not supported * reduce stack usage in the test * disable CSR processing for embedded targets --- src/crypto/CHIPCryptoPAL.h | 9 ++ src/crypto/CHIPCryptoPALOpenSSL.cpp | 117 +++++++++++++++++++------ src/crypto/CHIPCryptoPALmbedTLS.cpp | 55 ++++++++++++ src/crypto/tests/CHIPCryptoPALTest.cpp | 23 ++++- 4 files changed, 177 insertions(+), 27 deletions(-) diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 37014a5ca66cc7..9174a084a24636 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -341,6 +341,15 @@ CHIP_ERROR AES_CCM_decrypt(const uint8_t * ciphertext, size_t ciphertext_length, const uint8_t * tag, size_t tag_length, const uint8_t * key, size_t key_length, const uint8_t * iv, size_t iv_length, uint8_t * plaintext); +/** + * @brief Verify the Certificate Signing Request (CSR). If successfully verified, it outputs the public key from the CSR. + * @param csr CSR in DER format + * @param csr_length The length of the CSR + * @param pubkey The public key from the verified CSR + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ +CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr, size_t csr_length, P256PublicKey & pubkey); + /** * @brief A function that implements SHA-256 hash * @param data The data to hash diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index ef848baacd0d2a..4ed545b8844fa1 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -890,41 +890,61 @@ void ClearSecretData(uint8_t * buf, uint32_t len) memset(buf, 0, len); } +static CHIP_ERROR P256PublicKeyFromECKey(EC_KEY * ec_key, P256PublicKey & pubkey) +{ + ERR_clear_error(); + CHIP_ERROR error = CHIP_NO_ERROR; + + int nid = NID_undef; + ECName curve = MapECName(pubkey.Type()); + EC_GROUP * group = nullptr; + size_t pubkey_size = 0; + + const EC_POINT * pubkey_ecp = EC_KEY_get0_public_key(ec_key); + VerifyOrExit(pubkey_ecp != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + + nid = _nidForCurve(curve); + VerifyOrExit(nid != NID_undef, error = CHIP_ERROR_INVALID_ARGUMENT); + + group = EC_GROUP_new_by_curve_name(nid); + VerifyOrExit(group != nullptr, error = CHIP_ERROR_INTERNAL); + + pubkey_size = + EC_POINT_point2oct(group, pubkey_ecp, POINT_CONVERSION_UNCOMPRESSED, Uint8::to_uchar(pubkey), pubkey.Length(), nullptr); + pubkey_ecp = nullptr; + + VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INVALID_ARGUMENT); + +exit: + if (group != nullptr) + { + EC_GROUP_free(group); + group = nullptr; + } + + _logSSLError(); + return error; +} + CHIP_ERROR P256Keypair::Initialize() { ERR_clear_error(); CHIP_ERROR error = CHIP_NO_ERROR; int result = 0; - int nid = NID_undef; EC_KEY * ec_key = nullptr; - EC_GROUP * group = nullptr; ECName curve = MapECName(mPublicKey.Type()); - VerifyOrExit(curve == MapECName(mPublicKey.Type()), error = CHIP_ERROR_INVALID_ARGUMENT); - - nid = _nidForCurve(curve); + int nid = _nidForCurve(curve); VerifyOrExit(nid != NID_undef, error = CHIP_ERROR_INVALID_ARGUMENT); ec_key = EC_KEY_new_by_curve_name(nid); VerifyOrExit(ec_key != nullptr, error = CHIP_ERROR_INTERNAL); - group = EC_GROUP_new_by_curve_name(nid); - VerifyOrExit(group != nullptr, error = CHIP_ERROR_INTERNAL); - result = EC_KEY_generate_key(ec_key); VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); - { - size_t pubkey_size = 0; - const EC_POINT * pubkey_ecp = EC_KEY_get0_public_key(ec_key); - VerifyOrExit(pubkey_ecp != nullptr, error = CHIP_ERROR_INTERNAL); - - pubkey_size = EC_POINT_point2oct(group, pubkey_ecp, POINT_CONVERSION_UNCOMPRESSED, Uint8::to_uchar(mPublicKey), - mPublicKey.Length(), nullptr); - pubkey_ecp = nullptr; - - VerifyOrExit(pubkey_size == mPublicKey.Length(), error = CHIP_ERROR_INTERNAL); - } + error = P256PublicKeyFromECKey(ec_key, mPublicKey); + SuccessOrExit(error); from_EC_KEY(ec_key, &mKeypair); mInitialized = true; @@ -937,12 +957,6 @@ CHIP_ERROR P256Keypair::Initialize() ec_key = nullptr; } - if (group != nullptr) - { - EC_GROUP_free(group); - group = nullptr; - } - _logSSLError(); return error; } @@ -1078,6 +1092,9 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & EC_KEY * ec_key = to_EC_KEY(&mKeypair); + X509_NAME * subject = X509_NAME_new(); + VerifyOrExit(subject != nullptr, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(mInitialized, error = CHIP_ERROR_INCORRECT_STATE); result = X509_REQ_set_version(x509_req, 0); @@ -1095,6 +1112,15 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & result = X509_REQ_set_pubkey(x509_req, evp_pkey); VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); + // TODO: mbedTLS CSR parser fails if the subject name is not set (or if empty). + // CHIP Spec doesn't specify the subject name that can be used. + // Figure out the correct value and update this code. + result = X509_NAME_add_entry_by_txt(subject, "O", MBSTRING_ASC, Uint8::from_const_char("CSR"), -1, -1, 0); + VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); + + result = X509_REQ_set_subject_name(x509_req, subject); + VerifyOrExit(result == 1, error = CHIP_ERROR_INTERNAL); + result = X509_REQ_sign(x509_req, evp_pkey, EVP_sha256()); VerifyOrExit(result > 0, error = CHIP_ERROR_INTERNAL); @@ -1109,12 +1135,53 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & evp_pkey = nullptr; } + X509_NAME_free(subject); + subject = nullptr; + X509_REQ_free(x509_req); _logSSLError(); return error; } +CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr, size_t csr_length, P256PublicKey & pubkey) +{ + ERR_clear_error(); + CHIP_ERROR error = CHIP_NO_ERROR; + int result = 0; + + EVP_PKEY * evp_pkey = nullptr; + EC_KEY * ec_key = nullptr; + + const unsigned char * csr_buf = Uint8::to_const_uchar(csr); + X509_REQ * x509_req = d2i_X509_REQ(nullptr, &csr_buf, (int) csr_length); + VerifyOrExit(x509_req != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + + VerifyOrExit(X509_REQ_get_version(x509_req) == 0, error = CHIP_ERROR_INVALID_ARGUMENT); + + evp_pkey = X509_REQ_get0_pubkey(x509_req); + VerifyOrExit(evp_pkey != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + + result = X509_REQ_verify(x509_req, evp_pkey); + VerifyOrExit(result == 1, error = CHIP_ERROR_INVALID_ARGUMENT); + + ec_key = EVP_PKEY_get1_EC_KEY(evp_pkey); + VerifyOrExit(ec_key != nullptr, error = CHIP_ERROR_INVALID_ARGUMENT); + + error = P256PublicKeyFromECKey(ec_key, pubkey); + SuccessOrExit(error); + +exit: + + if (x509_req != nullptr) + { + X509_REQ_free(x509_req); + } + + _logSSLError(); + return error; +} + #define init_point(_point_) \ do \ { \ diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index f9a61be0646ce7..6ba6f146644f97 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -734,6 +734,12 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & mbedtls_x509write_csr_set_md_alg(&csr, MBEDTLS_MD_SHA256); + // TODO: mbedTLS CSR parser fails if the subject name is not set (or if empty). + // CHIP Spec doesn't specify the subject name that can be used. + // Figure out the correct value and update this code. + result = mbedtls_x509write_csr_set_subject_name(&csr, "O=CSR"); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + result = mbedtls_x509write_csr_der(&csr, out_csr, csr_length, CryptoRNG, nullptr); VerifyOrExit(result > 0, error = CHIP_ERROR_INTERNAL); @@ -759,6 +765,55 @@ CHIP_ERROR P256Keypair::NewCertificateSigningRequest(uint8_t * out_csr, size_t & return error; } +CHIP_ERROR VerifyCertificateSigningRequest(const uint8_t * csr_buf, size_t csr_length, P256PublicKey & pubkey) +{ +#if !CHIP_TARGET_STYLE_EMBEDDED + // TODO: For some embedded targets, mbedTLS library doesn't have mbedtls_x509_csr_parse_der, and mbedtls_x509_csr_parse_free. + // Taking a step back, embedded targets likely will not process CSR requests. Adding this action item to reevaluate + // this if there's a need for this processing for embedded targets. + CHIP_ERROR error = CHIP_NO_ERROR; + size_t pubkey_size = 0; + + mbedtls_ecp_keypair * keypair = nullptr; + + P256ECDSASignature signature; + + mbedtls_x509_csr csr; + mbedtls_x509_csr_init(&csr); + + int result = mbedtls_x509_csr_parse_der(&csr, csr_buf, csr_length); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + + // Verify the signature algorithm and public key type + VerifyOrExit(csr.sig_md == MBEDTLS_MD_SHA256, error = CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE); + VerifyOrExit(csr.sig_pk == MBEDTLS_PK_ECDSA, error = CHIP_ERROR_WRONG_KEY_TYPE); + + keypair = mbedtls_pk_ec(csr.pk); + + // Copy the public key from the CSR + result = mbedtls_ecp_point_write_binary(&keypair->grp, &keypair->Q, MBEDTLS_ECP_PF_UNCOMPRESSED, &pubkey_size, + Uint8::to_uchar(pubkey), pubkey.Length()); + VerifyOrExit(result == 0, error = CHIP_ERROR_INTERNAL); + VerifyOrExit(pubkey_size == pubkey.Length(), error = CHIP_ERROR_INTERNAL); + + // Verify the signature using the public key + VerifyOrExit(kMax_ECDSA_Signature_Length >= csr.sig.len, error = CHIP_ERROR_INTERNAL); + memmove(Uint8::to_uchar(signature), csr.sig.p, csr.sig.len); + signature.SetLength(csr.sig.len); + + error = pubkey.ECDSA_validate_msg_signature(csr.cri.p, csr.cri.len, signature); + SuccessOrExit(error); + +exit: + mbedtls_x509_csr_free(&csr); + _log_mbedTLS_error(result); + return error; +#else + ChipLogError(Crypto, "MBEDTLS_X509_CSR_PARSE_C is not enabled. CSR cannot be parsed"); + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + typedef struct Spake2p_Context { mbedtls_ecp_group curve; diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index 42d2953b80d83a..03657ea4f300c8 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -973,13 +973,32 @@ static void TestP256_Keygen(nlTestSuite * inSuite, void * inContext) static void TestCSR_Gen(nlTestSuite * inSuite, void * inContext) { - uint8_t csr[kMAX_CSR_Length]; + static uint8_t csr[kMAX_CSR_Length]; size_t length = sizeof(csr); - P256Keypair keypair; + static P256Keypair keypair; NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, keypair.NewCertificateSigningRequest(csr, length) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, length > 0); + + static P256PublicKey pubkey; + CHIP_ERROR err = VerifyCertificateSigningRequest(csr, length, pubkey); + if (err != CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE) + { + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, pubkey.Length() == kP256_PublicKey_Length); + NL_TEST_ASSERT(inSuite, memcmp(pubkey, keypair.Pubkey(), pubkey.Length()) == 0); + + // Let's corrupt the CSR buffer and make sure it fails to verify + csr[length - 2] = (uint8_t)(csr[length - 2] + 1); + csr[length - 1] = (uint8_t)(csr[length - 1] + 1); + + NL_TEST_ASSERT(inSuite, VerifyCertificateSigningRequest(csr, length, pubkey) != CHIP_NO_ERROR); + } + else + { + ChipLogError(Crypto, "The current platform does not support CSR parsing."); + } } static void TestKeypair_Serialize(nlTestSuite * inSuite, void * inContext) From 05e58fdac026730886a4ae68d275f62b0ef596eb Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 3 May 2021 18:07:17 +0200 Subject: [PATCH 03/31] [Darwin] Reduce the tests timeout from 10 seconds to 3 (#6415) --- .../CHIP/templates/clusters-tests.zapt | 16 +- .../Framework/CHIPTests/CHIPClustersTests.m | 361 +++++++++--------- 2 files changed, 195 insertions(+), 182 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 42b6fdc58f42c8..42db26a77b4fb7 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -27,7 +27,8 @@ // system dependencies #import -const uint16_t kTimeoutInMs = 10; +const uint16_t kPairingTimeoutInSeconds = 10; +const uint16_t kTimeoutInSeconds = 3; const uint64_t kDeviceId = 1; const uint16_t kDiscriminator = 3840; const uint32_t kSetupPINCode = 20202021; @@ -75,6 +76,11 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) @implementation CHIPClustersTests +- (void)setUp { + [super setUp]; + [self setContinueAfterFailure:NO]; +} + - (void)testInitStack { XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"]; @@ -100,7 +106,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) error:&error]; XCTAssertEqual(error.code, 0); - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; } - (void)testShutdownStack @@ -134,7 +140,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } {{/unless}} {{/chip_server_cluster_commands}} @@ -157,7 +163,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } {{#if (isWritableAttribute)}} @@ -177,7 +183,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } {{/if}} {{/chip_server_cluster_attributes}} diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 719f232e97239b..721eef6a7eb253 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -27,7 +27,8 @@ // system dependencies #import -const uint16_t kTimeoutInMs = 10; +const uint16_t kPairingTimeoutInSeconds = 10; +const uint16_t kTimeoutInSeconds = 3; const uint64_t kDeviceId = 1; const uint16_t kDiscriminator = 3840; const uint32_t kSetupPINCode = 20202021; @@ -75,6 +76,12 @@ @interface CHIPClustersTests : XCTestCase @implementation CHIPClustersTests +- (void)setUp +{ + [super setUp]; + [self setContinueAfterFailure:NO]; +} + - (void)testInitStack { XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"]; @@ -100,7 +107,7 @@ - (void)testInitStack error:&error]; XCTAssertEqual(error.code, 0); - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kPairingTimeoutInSeconds handler:nil]; } - (void)testShutdownStack @@ -131,7 +138,7 @@ - (void)testSendClusterBarrierControlBarrierControlStopCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicMfgSpecificPingCommand { @@ -148,7 +155,7 @@ - (void)testSendClusterBasicMfgSpecificPingCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockClearAllPinsCommand { @@ -165,7 +172,7 @@ - (void)testSendClusterDoorLockClearAllPinsCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockClearAllRfidsCommand { @@ -182,7 +189,7 @@ - (void)testSendClusterDoorLockClearAllRfidsCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGeneralCommissioningCommissioningCompleteCommand { @@ -199,7 +206,7 @@ - (void)testSendClusterGeneralCommissioningCommissioningCompleteCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupsRemoveAllGroupsCommand { @@ -216,7 +223,7 @@ - (void)testSendClusterGroupsRemoveAllGroupsCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterIdentifyIdentifyQueryCommand { @@ -233,7 +240,7 @@ - (void)testSendClusterIdentifyIdentifyQueryCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterLevelControlStopWithOnOffCommand { @@ -250,7 +257,7 @@ - (void)testSendClusterLevelControlStopWithOnOffCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterLowPowerSleepCommand { @@ -267,7 +274,7 @@ - (void)testSendClusterLowPowerSleepCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOnOffOffCommand { @@ -284,7 +291,7 @@ - (void)testSendClusterOnOffOffCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOnOffOnCommand { @@ -301,7 +308,7 @@ - (void)testSendClusterOnOffOnCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOnOffToggleCommand { @@ -318,7 +325,7 @@ - (void)testSendClusterOnOffToggleCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOperationalCredentialsGetFabricIdCommand { @@ -335,7 +342,7 @@ - (void)testSendClusterOperationalCredentialsGetFabricIdCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatClearWeeklyScheduleCommand { @@ -352,7 +359,7 @@ - (void)testSendClusterThermostatClearWeeklyScheduleCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatGetRelayStatusLogCommand { @@ -369,7 +376,7 @@ - (void)testSendClusterThermostatGetRelayStatusLogCommand [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeVendorName @@ -387,7 +394,7 @@ - (void)testSendClusterApplicationBasicReadAttributeVendorName [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeVendorId @@ -405,7 +412,7 @@ - (void)testSendClusterApplicationBasicReadAttributeVendorId [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeApplicationName @@ -423,7 +430,7 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationName [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeProductId @@ -441,7 +448,7 @@ - (void)testSendClusterApplicationBasicReadAttributeProductId [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeApplicationId @@ -459,7 +466,7 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationId [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeCatalogVendorId @@ -477,7 +484,7 @@ - (void)testSendClusterApplicationBasicReadAttributeCatalogVendorId [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeApplicationSatus @@ -495,7 +502,7 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationSatus [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterApplicationBasicReadAttributeClusterRevision @@ -513,7 +520,7 @@ - (void)testSendClusterApplicationBasicReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBarrierControlReadAttributeBarrierMovingState @@ -531,7 +538,7 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierMovingState [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatus @@ -549,7 +556,7 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatus [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBarrierControlReadAttributeBarrierCapabilities @@ -567,7 +574,7 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierCapabilities [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBarrierControlReadAttributeBarrierPosition @@ -585,7 +592,7 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierPosition [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBarrierControlReadAttributeClusterRevision @@ -603,7 +610,7 @@ - (void)testSendClusterBarrierControlReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeInteractionModelVersion @@ -621,7 +628,7 @@ - (void)testSendClusterBasicReadAttributeInteractionModelVersion [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeVendorName @@ -639,7 +646,7 @@ - (void)testSendClusterBasicReadAttributeVendorName [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeVendorID @@ -657,7 +664,7 @@ - (void)testSendClusterBasicReadAttributeVendorID [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeProductName @@ -675,7 +682,7 @@ - (void)testSendClusterBasicReadAttributeProductName [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeProductID @@ -693,7 +700,7 @@ - (void)testSendClusterBasicReadAttributeProductID [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeUserLabel @@ -711,7 +718,7 @@ - (void)testSendClusterBasicReadAttributeUserLabel [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicWriteAttributeUserLabel @@ -731,7 +738,7 @@ - (void)testSendClusterBasicWriteAttributeUserLabel [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeLocation { @@ -748,7 +755,7 @@ - (void)testSendClusterBasicReadAttributeLocation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicWriteAttributeLocation @@ -768,7 +775,7 @@ - (void)testSendClusterBasicWriteAttributeLocation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeHardwareVersion { @@ -785,7 +792,7 @@ - (void)testSendClusterBasicReadAttributeHardwareVersion [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeHardwareVersionString @@ -803,7 +810,7 @@ - (void)testSendClusterBasicReadAttributeHardwareVersionString [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeSoftwareVersion @@ -821,7 +828,7 @@ - (void)testSendClusterBasicReadAttributeSoftwareVersion [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeSoftwareVersionString @@ -839,7 +846,7 @@ - (void)testSendClusterBasicReadAttributeSoftwareVersionString [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeManufacturingDate @@ -857,7 +864,7 @@ - (void)testSendClusterBasicReadAttributeManufacturingDate [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributePartNumber @@ -875,7 +882,7 @@ - (void)testSendClusterBasicReadAttributePartNumber [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeProductURL @@ -893,7 +900,7 @@ - (void)testSendClusterBasicReadAttributeProductURL [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeProductLabel @@ -911,7 +918,7 @@ - (void)testSendClusterBasicReadAttributeProductLabel [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeSerialNumber @@ -929,7 +936,7 @@ - (void)testSendClusterBasicReadAttributeSerialNumber [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeLocalConfigDisabled @@ -947,7 +954,7 @@ - (void)testSendClusterBasicReadAttributeLocalConfigDisabled [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicWriteAttributeLocalConfigDisabled @@ -967,7 +974,7 @@ - (void)testSendClusterBasicWriteAttributeLocalConfigDisabled [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBasicReadAttributeClusterRevision { @@ -984,7 +991,7 @@ - (void)testSendClusterBasicReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterBindingReadAttributeClusterRevision @@ -1002,7 +1009,7 @@ - (void)testSendClusterBindingReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCurrentHue @@ -1020,7 +1027,7 @@ - (void)testSendClusterColorControlReadAttributeCurrentHue [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCurrentSaturation @@ -1038,7 +1045,7 @@ - (void)testSendClusterColorControlReadAttributeCurrentSaturation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeRemainingTime @@ -1056,7 +1063,7 @@ - (void)testSendClusterColorControlReadAttributeRemainingTime [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCurrentX @@ -1074,7 +1081,7 @@ - (void)testSendClusterColorControlReadAttributeCurrentX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCurrentY @@ -1092,7 +1099,7 @@ - (void)testSendClusterColorControlReadAttributeCurrentY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeDriftCompensation @@ -1110,7 +1117,7 @@ - (void)testSendClusterColorControlReadAttributeDriftCompensation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCompensationText @@ -1128,7 +1135,7 @@ - (void)testSendClusterColorControlReadAttributeCompensationText [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorTemperature @@ -1146,7 +1153,7 @@ - (void)testSendClusterColorControlReadAttributeColorTemperature [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorMode @@ -1164,7 +1171,7 @@ - (void)testSendClusterColorControlReadAttributeColorMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorControlOptions @@ -1182,7 +1189,7 @@ - (void)testSendClusterColorControlReadAttributeColorControlOptions [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorControlOptions @@ -1202,7 +1209,7 @@ - (void)testSendClusterColorControlWriteAttributeColorControlOptions [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeNumberOfPrimaries { @@ -1219,7 +1226,7 @@ - (void)testSendClusterColorControlReadAttributeNumberOfPrimaries [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary1X @@ -1237,7 +1244,7 @@ - (void)testSendClusterColorControlReadAttributePrimary1X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary1Y @@ -1255,7 +1262,7 @@ - (void)testSendClusterColorControlReadAttributePrimary1Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary1Intensity @@ -1273,7 +1280,7 @@ - (void)testSendClusterColorControlReadAttributePrimary1Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary2X @@ -1291,7 +1298,7 @@ - (void)testSendClusterColorControlReadAttributePrimary2X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary2Y @@ -1309,7 +1316,7 @@ - (void)testSendClusterColorControlReadAttributePrimary2Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary2Intensity @@ -1327,7 +1334,7 @@ - (void)testSendClusterColorControlReadAttributePrimary2Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary3X @@ -1345,7 +1352,7 @@ - (void)testSendClusterColorControlReadAttributePrimary3X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary3Y @@ -1363,7 +1370,7 @@ - (void)testSendClusterColorControlReadAttributePrimary3Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary3Intensity @@ -1381,7 +1388,7 @@ - (void)testSendClusterColorControlReadAttributePrimary3Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary4X @@ -1399,7 +1406,7 @@ - (void)testSendClusterColorControlReadAttributePrimary4X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary4Y @@ -1417,7 +1424,7 @@ - (void)testSendClusterColorControlReadAttributePrimary4Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary4Intensity @@ -1435,7 +1442,7 @@ - (void)testSendClusterColorControlReadAttributePrimary4Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary5X @@ -1453,7 +1460,7 @@ - (void)testSendClusterColorControlReadAttributePrimary5X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary5Y @@ -1471,7 +1478,7 @@ - (void)testSendClusterColorControlReadAttributePrimary5Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary5Intensity @@ -1489,7 +1496,7 @@ - (void)testSendClusterColorControlReadAttributePrimary5Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary6X @@ -1507,7 +1514,7 @@ - (void)testSendClusterColorControlReadAttributePrimary6X [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary6Y @@ -1525,7 +1532,7 @@ - (void)testSendClusterColorControlReadAttributePrimary6Y [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributePrimary6Intensity @@ -1543,7 +1550,7 @@ - (void)testSendClusterColorControlReadAttributePrimary6Intensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeWhitePointX @@ -1561,7 +1568,7 @@ - (void)testSendClusterColorControlReadAttributeWhitePointX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeWhitePointX @@ -1581,7 +1588,7 @@ - (void)testSendClusterColorControlWriteAttributeWhitePointX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeWhitePointY { @@ -1598,7 +1605,7 @@ - (void)testSendClusterColorControlReadAttributeWhitePointY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeWhitePointY @@ -1618,7 +1625,7 @@ - (void)testSendClusterColorControlWriteAttributeWhitePointY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointRX { @@ -1635,7 +1642,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointRX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointRX @@ -1655,7 +1662,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointRY { @@ -1672,7 +1679,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointRY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointRY @@ -1692,7 +1699,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointRIntensity { @@ -1709,7 +1716,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointRIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointRIntensity @@ -1729,7 +1736,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointGX { @@ -1746,7 +1753,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointGX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointGX @@ -1766,7 +1773,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointGY { @@ -1783,7 +1790,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointGY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointGY @@ -1803,7 +1810,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointGIntensity { @@ -1820,7 +1827,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointGIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointGIntensity @@ -1840,7 +1847,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointBX { @@ -1857,7 +1864,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointBX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointBX @@ -1877,7 +1884,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBX [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointBY { @@ -1894,7 +1901,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointBY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointBY @@ -1914,7 +1921,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBY [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorPointBIntensity { @@ -1931,7 +1938,7 @@ - (void)testSendClusterColorControlReadAttributeColorPointBIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeColorPointBIntensity @@ -1951,7 +1958,7 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBIntensity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeEnhancedCurrentHue { @@ -1968,7 +1975,7 @@ - (void)testSendClusterColorControlReadAttributeEnhancedCurrentHue [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeEnhancedColorMode @@ -1986,7 +1993,7 @@ - (void)testSendClusterColorControlReadAttributeEnhancedColorMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorLoopActive @@ -2004,7 +2011,7 @@ - (void)testSendClusterColorControlReadAttributeColorLoopActive [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorLoopDirection @@ -2022,7 +2029,7 @@ - (void)testSendClusterColorControlReadAttributeColorLoopDirection [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorLoopTime @@ -2040,7 +2047,7 @@ - (void)testSendClusterColorControlReadAttributeColorLoopTime [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorCapabilities @@ -2058,7 +2065,7 @@ - (void)testSendClusterColorControlReadAttributeColorCapabilities [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMin @@ -2076,7 +2083,7 @@ - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMin [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMax @@ -2094,7 +2101,7 @@ - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMax [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMireds @@ -2112,7 +2119,7 @@ - (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMireds [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMireds @@ -2130,7 +2137,7 @@ - (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMireds [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMireds @@ -2150,7 +2157,7 @@ - (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMireds [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterColorControlReadAttributeClusterRevision { @@ -2167,7 +2174,7 @@ - (void)testSendClusterColorControlReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDescriptorReadAttributeDeviceList @@ -2185,7 +2192,7 @@ - (void)testSendClusterDescriptorReadAttributeDeviceList [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDescriptorReadAttributeServerList @@ -2203,7 +2210,7 @@ - (void)testSendClusterDescriptorReadAttributeServerList [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDescriptorReadAttributeClientList @@ -2221,7 +2228,7 @@ - (void)testSendClusterDescriptorReadAttributeClientList [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDescriptorReadAttributePartsList @@ -2239,7 +2246,7 @@ - (void)testSendClusterDescriptorReadAttributePartsList [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDescriptorReadAttributeClusterRevision @@ -2257,7 +2264,7 @@ - (void)testSendClusterDescriptorReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockReadAttributeLockState @@ -2275,7 +2282,7 @@ - (void)testSendClusterDoorLockReadAttributeLockState [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockReadAttributeLockType @@ -2293,7 +2300,7 @@ - (void)testSendClusterDoorLockReadAttributeLockType [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockReadAttributeActuatorEnabled @@ -2311,7 +2318,7 @@ - (void)testSendClusterDoorLockReadAttributeActuatorEnabled [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterDoorLockReadAttributeClusterRevision @@ -2329,7 +2336,7 @@ - (void)testSendClusterDoorLockReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGeneralCommissioningReadAttributeFabricId @@ -2347,7 +2354,7 @@ - (void)testSendClusterGeneralCommissioningReadAttributeFabricId [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumb @@ -2365,7 +2372,7 @@ - (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumb [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumb @@ -2385,7 +2392,7 @@ - (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumb [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGeneralCommissioningReadAttributeClusterRevision { @@ -2402,7 +2409,7 @@ - (void)testSendClusterGeneralCommissioningReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupKeyManagementReadAttributeGroups @@ -2420,7 +2427,7 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroups [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupKeyManagementReadAttributeGroupKeys @@ -2438,7 +2445,7 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupKeys [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupKeyManagementReadAttributeClusterRevision @@ -2456,7 +2463,7 @@ - (void)testSendClusterGroupKeyManagementReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupsReadAttributeNameSupport @@ -2474,7 +2481,7 @@ - (void)testSendClusterGroupsReadAttributeNameSupport [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterGroupsReadAttributeClusterRevision @@ -2492,7 +2499,7 @@ - (void)testSendClusterGroupsReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterIdentifyReadAttributeIdentifyTime @@ -2510,7 +2517,7 @@ - (void)testSendClusterIdentifyReadAttributeIdentifyTime [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterIdentifyWriteAttributeIdentifyTime @@ -2530,7 +2537,7 @@ - (void)testSendClusterIdentifyWriteAttributeIdentifyTime [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterIdentifyReadAttributeClusterRevision { @@ -2547,7 +2554,7 @@ - (void)testSendClusterIdentifyReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterLevelControlReadAttributeCurrentLevel @@ -2565,7 +2572,7 @@ - (void)testSendClusterLevelControlReadAttributeCurrentLevel [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterLevelControlReadAttributeClusterRevision @@ -2583,7 +2590,7 @@ - (void)testSendClusterLevelControlReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterLowPowerReadAttributeClusterRevision @@ -2601,7 +2608,7 @@ - (void)testSendClusterLowPowerReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterNetworkCommissioningReadAttributeClusterRevision @@ -2619,7 +2626,7 @@ - (void)testSendClusterNetworkCommissioningReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOnOffReadAttributeOnOff @@ -2637,7 +2644,7 @@ - (void)testSendClusterOnOffReadAttributeOnOff [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOnOffReadAttributeClusterRevision @@ -2655,7 +2662,7 @@ - (void)testSendClusterOnOffReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOperationalCredentialsReadAttributeFabricsList @@ -2673,7 +2680,7 @@ - (void)testSendClusterOperationalCredentialsReadAttributeFabricsList [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterOperationalCredentialsReadAttributeClusterRevision @@ -2691,7 +2698,7 @@ - (void)testSendClusterOperationalCredentialsReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressure @@ -2711,7 +2718,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressure [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeed @@ -2731,7 +2738,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeed [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlow @@ -2751,7 +2758,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlow [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperationMode @@ -2772,7 +2779,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperatio [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlMode @@ -2793,7 +2800,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlM [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacity @@ -2813,7 +2820,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacity [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationMode @@ -2833,7 +2840,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationMode @@ -2855,7 +2862,7 @@ - (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevision { @@ -2874,7 +2881,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeSceneCount @@ -2892,7 +2899,7 @@ - (void)testSendClusterScenesReadAttributeSceneCount [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeCurrentScene @@ -2910,7 +2917,7 @@ - (void)testSendClusterScenesReadAttributeCurrentScene [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeCurrentGroup @@ -2928,7 +2935,7 @@ - (void)testSendClusterScenesReadAttributeCurrentGroup [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeSceneValid @@ -2946,7 +2953,7 @@ - (void)testSendClusterScenesReadAttributeSceneValid [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeNameSupport @@ -2964,7 +2971,7 @@ - (void)testSendClusterScenesReadAttributeNameSupport [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterScenesReadAttributeClusterRevision @@ -2982,7 +2989,7 @@ - (void)testSendClusterScenesReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterSwitchReadAttributeNumberOfPositions @@ -3000,7 +3007,7 @@ - (void)testSendClusterSwitchReadAttributeNumberOfPositions [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterSwitchReadAttributeCurrentPosition @@ -3018,7 +3025,7 @@ - (void)testSendClusterSwitchReadAttributeCurrentPosition [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterSwitchReadAttributeClusterRevision @@ -3036,7 +3043,7 @@ - (void)testSendClusterSwitchReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValue @@ -3054,7 +3061,7 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValue [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValue @@ -3072,7 +3079,7 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValue [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValue @@ -3090,7 +3097,7 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValue [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevision @@ -3108,7 +3115,7 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeLocalTemperature @@ -3126,7 +3133,7 @@ - (void)testSendClusterThermostatReadAttributeLocalTemperature [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeOccupiedCoolingSetpoint @@ -3144,7 +3151,7 @@ - (void)testSendClusterThermostatReadAttributeOccupiedCoolingSetpoint [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatWriteAttributeOccupiedCoolingSetpoint @@ -3164,7 +3171,7 @@ - (void)testSendClusterThermostatWriteAttributeOccupiedCoolingSetpoint [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeOccupiedHeatingSetpoint { @@ -3181,7 +3188,7 @@ - (void)testSendClusterThermostatReadAttributeOccupiedHeatingSetpoint [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatWriteAttributeOccupiedHeatingSetpoint @@ -3201,7 +3208,7 @@ - (void)testSendClusterThermostatWriteAttributeOccupiedHeatingSetpoint [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeControlSequenceOfOperation { @@ -3218,7 +3225,7 @@ - (void)testSendClusterThermostatReadAttributeControlSequenceOfOperation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatWriteAttributeControlSequenceOfOperation @@ -3238,7 +3245,7 @@ - (void)testSendClusterThermostatWriteAttributeControlSequenceOfOperation [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeSystemMode { @@ -3255,7 +3262,7 @@ - (void)testSendClusterThermostatReadAttributeSystemMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatWriteAttributeSystemMode @@ -3275,7 +3282,7 @@ - (void)testSendClusterThermostatWriteAttributeSystemMode [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } - (void)testSendClusterThermostatReadAttributeClusterRevision { @@ -3292,7 +3299,7 @@ - (void)testSendClusterThermostatReadAttributeClusterRevision [expectation fulfill]; }]; - [self waitForExpectationsWithTimeout:kTimeoutInMs handler:nil]; + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } @end From 93186c4bcad1e3dd5e4356e1e15fdd91c8767a47 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 3 May 2021 18:07:36 +0200 Subject: [PATCH 04/31] [Darwin] Schedule Mdns callbacks on the main framework dispatch queue (#6414) --- src/platform/Darwin/MdnsImpl.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/platform/Darwin/MdnsImpl.cpp b/src/platform/Darwin/MdnsImpl.cpp index 8c3c255fddf809..d7aad43b6d3800 100644 --- a/src/platform/Darwin/MdnsImpl.cpp +++ b/src/platform/Darwin/MdnsImpl.cpp @@ -297,6 +297,9 @@ CHIP_ERROR Register(uint32_t interfaceId, const char * type, const char * name, VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err), CHIP_ERROR_INTERNAL); + err = DNSServiceSetDispatchQueue(sdRef, chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue()); + VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); + return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } @@ -364,6 +367,9 @@ CHIP_ERROR Browse(void * context, MdnsBrowseCallback callback, uint32_t interfac err = DNSServiceBrowse(&sdRef, 0 /* flags */, interfaceId, type, kLocalDomain, OnBrowse, sdCtx); VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err), CHIP_ERROR_INTERNAL); + err = DNSServiceSetDispatchQueue(sdRef, chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue()); + VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); + return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } @@ -415,6 +421,9 @@ CHIP_ERROR GetAddrInfo(void * context, MdnsResolveCallback callback, uint32_t in err = DNSServiceGetAddrInfo(&sdRef, 0 /* flags */, interfaceId, kDNSServiceProtocol_IPv4, hostname, OnGetAddrInfo, sdCtx); VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); + err = DNSServiceSetDispatchQueue(sdRef, chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue()); + VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); + return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } @@ -439,6 +448,9 @@ CHIP_ERROR Resolve(void * context, MdnsResolveCallback callback, uint32_t interf err = DNSServiceResolve(&sdRef, 0 /* flags */, interfaceId, name, type, kLocalDomain, OnResolve, sdCtx); VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err), CHIP_ERROR_INTERNAL); + err = DNSServiceSetDispatchQueue(sdRef, chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue()); + VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); + return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } From c2327a5a15cdfe75e251e9d799fe111c45d477da Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 3 May 2021 20:11:46 +0200 Subject: [PATCH 05/31] Zap remove ember af maximum aps payload length (#6428) * Remove emberAfMaximumApsPayloadLength method #### Problem Ember has a limit on the actual message payload. Currently this limit is `82` and it starts to be too small for reading `List` attributes. Futhermore, there is a method named `emberAfMaximumApsPayloadLength` use to calculate the size of the payload depending on some routing parameters as far as I can tell. It is unclear to me that CHIP will ever use those. #### Summary of changes * Remove `emberAfMaximumApsPayloadLength` and some dependencies * Upgrade the maximum payload size from `82` to `1024` * Update gen/ folders --- .../all-clusters-common/gen/callback-stub.cpp | 12 ----- .../all-clusters-common/gen/callback.h | 9 ---- .../bridge-common/gen/callback-stub.cpp | 12 ----- .../bridge-app/bridge-common/gen/callback.h | 9 ---- examples/chip-tool/gen/callback-stub.cpp | 12 ----- examples/chip-tool/gen/callback.h | 9 ---- .../lighting-common/gen/callback-stub.cpp | 12 ----- .../lighting-common/gen/callback.h | 9 ---- .../lock-common/gen/callback-stub.cpp | 12 ----- examples/lock-app/lock-common/gen/callback.h | 9 ---- .../esp32/main/gen/callback-stub.cpp | 12 ----- .../esp32/main/gen/callback.h | 9 ---- .../tv-app/tv-common/gen/callback-stub.cpp | 12 ----- examples/tv-app/tv-common/gen/callback.h | 9 ---- .../window-app/common/gen/callback-stub.cpp | 12 ----- examples/window-app/common/gen/callback.h | 9 ---- src/app/reporting/reporting.cpp | 6 +-- src/app/util/af-main-common.cpp | 9 +--- src/app/util/af.h | 18 -------- src/app/util/config.h | 19 +------- src/app/util/process-global-message.cpp | 8 ++-- src/app/util/util.cpp | 46 ------------------- .../templates/app/callback-stub-src.zapt | 12 ----- .../zap-templates/templates/app/callback.zapt | 9 ---- src/controller/python/gen/callback-stub.cpp | 12 ----- src/controller/python/gen/callback.h | 9 ---- .../Framework/CHIP/gen/callback-stub.cpp | 12 ----- src/darwin/Framework/CHIP/gen/callback.h | 9 ---- 28 files changed, 10 insertions(+), 327 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index 9ff68faa259e0d..3edeb0a239c183 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -742,18 +742,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index c077628eedbde4..1baf35248f386a 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -3173,15 +3173,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/bridge-app/bridge-common/gen/callback-stub.cpp b/examples/bridge-app/bridge-common/gen/callback-stub.cpp index 9d73a0da48a03d..fbfb4a965efa56 100644 --- a/examples/bridge-app/bridge-common/gen/callback-stub.cpp +++ b/examples/bridge-app/bridge-common/gen/callback-stub.cpp @@ -590,18 +590,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/bridge-app/bridge-common/gen/callback.h b/examples/bridge-app/bridge-common/gen/callback.h index 2caab42c052fc4..ae79c2614e9d67 100644 --- a/examples/bridge-app/bridge-common/gen/callback.h +++ b/examples/bridge-app/bridge-common/gen/callback.h @@ -1093,15 +1093,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/chip-tool/gen/callback-stub.cpp b/examples/chip-tool/gen/callback-stub.cpp index e09564d69d338a..3f1208e57cdb23 100644 --- a/examples/chip-tool/gen/callback-stub.cpp +++ b/examples/chip-tool/gen/callback-stub.cpp @@ -798,18 +798,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/chip-tool/gen/callback.h b/examples/chip-tool/gen/callback.h index 7fedf9b6c00cf8..d7cf625829ce43 100644 --- a/examples/chip-tool/gen/callback.h +++ b/examples/chip-tool/gen/callback.h @@ -3495,15 +3495,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/lighting-app/lighting-common/gen/callback-stub.cpp b/examples/lighting-app/lighting-common/gen/callback-stub.cpp index 9d73a0da48a03d..fbfb4a965efa56 100644 --- a/examples/lighting-app/lighting-common/gen/callback-stub.cpp +++ b/examples/lighting-app/lighting-common/gen/callback-stub.cpp @@ -590,18 +590,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/lighting-app/lighting-common/gen/callback.h b/examples/lighting-app/lighting-common/gen/callback.h index 2caab42c052fc4..ae79c2614e9d67 100644 --- a/examples/lighting-app/lighting-common/gen/callback.h +++ b/examples/lighting-app/lighting-common/gen/callback.h @@ -1093,15 +1093,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/lock-app/lock-common/gen/callback-stub.cpp b/examples/lock-app/lock-common/gen/callback-stub.cpp index 9926d64c4803e0..2377bbfdff0cc2 100644 --- a/examples/lock-app/lock-common/gen/callback-stub.cpp +++ b/examples/lock-app/lock-common/gen/callback-stub.cpp @@ -582,18 +582,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/lock-app/lock-common/gen/callback.h b/examples/lock-app/lock-common/gen/callback.h index b5f0ef4b12615f..8d5f1c26b408c2 100644 --- a/examples/lock-app/lock-common/gen/callback.h +++ b/examples/lock-app/lock-common/gen/callback.h @@ -940,15 +940,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp index 2db3c82b7d171a..516f3eb3cbfbd8 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp +++ b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp @@ -582,18 +582,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback.h b/examples/temperature-measurement-app/esp32/main/gen/callback.h index 1b7bac82964d8d..82466588b77916 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback.h +++ b/examples/temperature-measurement-app/esp32/main/gen/callback.h @@ -925,15 +925,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index 4eab1460742a5e..5d89bd17988000 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -758,18 +758,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index 4c9ddbf5967064..cce8e153396db9 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -3152,15 +3152,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/window-app/common/gen/callback-stub.cpp b/examples/window-app/common/gen/callback-stub.cpp index 7f25192e1f5c0a..ca0fc68187729b 100644 --- a/examples/window-app/common/gen/callback-stub.cpp +++ b/examples/window-app/common/gen/callback-stub.cpp @@ -558,18 +558,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/examples/window-app/common/gen/callback.h b/examples/window-app/common/gen/callback.h index e39f4005199135..0619b2326e979e 100644 --- a/examples/window-app/common/gen/callback.h +++ b/examples/window-app/common/gen/callback.h @@ -620,15 +620,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/app/reporting/reporting.cpp b/src/app/reporting/reporting.cpp index bfb78bfd206ea1..c74db569dfe886 100644 --- a/src/app/reporting/reporting.cpp +++ b/src/app/reporting/reporting.cpp @@ -204,7 +204,8 @@ void emberAfPluginReportingTickEventHandler(void) // reportSize needs to be able to fit a sum of dataSize and some other stuff // without overflowing. uint32_t reportSize; - uint8_t index, currentPayloadMaxLength = 0, smallestPayloadMaxLength = 0; + uint8_t index; + uint16_t currentPayloadMaxLength = 0, smallestPayloadMaxLength = 0; for (i = 0; i < REPORT_TABLE_SIZE; i++) { @@ -292,8 +293,7 @@ void emberAfPluginReportingTickEventHandler(void) if (status == (EmberAfStatus) EMBER_SUCCESS && bindingEntry.local == entry.endpoint && bindingEntry.clusterId == entry.clusterId) { - currentPayloadMaxLength = - emberAfMaximumApsPayloadLength(bindingEntry.type, bindingEntry.networkIndex, apsFrame); + currentPayloadMaxLength = EMBER_AF_RESPONSE_BUFFER_LEN; if (currentPayloadMaxLength < smallestPayloadMaxLength) { smallestPayloadMaxLength = currentPayloadMaxLength; diff --git a/src/app/util/af-main-common.cpp b/src/app/util/af-main-common.cpp index 1555dbe5e96433..06a72d91703fba 100644 --- a/src/app/util/af-main-common.cpp +++ b/src/app/util/af-main-common.cpp @@ -283,16 +283,9 @@ static EmberStatus send(EmberOutgoingMessageType type, uint64_t indexOrDestinati emAfApplyDisableDefaultResponse(&message[0]); emAfApplyRetryOverride(&apsFrame->options); - if (messageLength <= emberAfMaximumApsPayloadLength(type, indexOrDestination, apsFrame)) + if (messageLength <= EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH) { status = emAfSend(type, indexOrDestination, apsFrame, (uint8_t) messageLength, message, &messageTag, alias, sequence); -#ifdef EMBER_AF_PLUGIN_FRAGMENTATION - } - else if (!broadcast) - { - status = emAfFragmentationSendUnicast(type, indexOrDestination, apsFrame, message, messageLength, &messageTag); - emberAfDebugPrintln("%pstart:len=%d.", "Fragmentation:", messageLength); -#endif } else { diff --git a/src/app/util/af.h b/src/app/util/af.h index e5e2155b24f536..312916b3bde02a 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -1474,24 +1474,6 @@ EmberStatus emberAfSendImmediateDefaultResponse(EmberAfStatus status); */ EmberStatus emberAfSendImmediateDefaultResponseWithCallback(EmberAfStatus status, EmberAfMessageSentFunction callback); -/** - * @brief Returns the maximum size of the payload that the Application - * Support sub-layer will accept for the given message type, destination, and - * APS frame. - * - * The size depends on multiple factors, including the security level in use - * and additional information added to the message to support the various - * options. - * - * @param type The outgoing message type. - * @param indexOrDestination Depending on the message type, this is either the - * EmberNodeId of the destination, an index into the address table, an index - * into the binding table, the multicast identifier, or a broadcast address. - * @param apsFrame The APS frame for the message. - * @return The maximum APS payload length for the given message. - */ -uint8_t emberAfMaximumApsPayloadLength(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame); - /** * @brief Access to client API APS frame. */ diff --git a/src/app/util/config.h b/src/app/util/config.h index 4abd41d3045771..b48d151d401a72 100644 --- a/src/app/util/config.h +++ b/src/app/util/config.h @@ -125,15 +125,6 @@ #define ZA_MAX_HOPS 12 #endif -#ifndef EMBER_AF_SOURCE_ROUTING_RESERVED_PAYLOAD_LENGTH -#define EMBER_AF_SOURCE_ROUTING_RESERVED_PAYLOAD_LENGTH 0 -#endif - -// The maximum APS payload, not including any APS options. This value is also -// available from emberMaximumApsPayloadLength() or ezspMaximumPayloadLength(). -// See http://portal.ember.com/faq/payload for more information. -#define EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH 82 - EMBER_AF_SOURCE_ROUTING_RESERVED_PAYLOAD_LENGTH - // Max PHY size = 128 // -1 byte for PHY length // -2 bytes for MAC CRC @@ -157,14 +148,8 @@ // affects the payloads generated from the CLI and the payloads generated // as responses. // Maximum payload length. -// If fragmenation is enabled, and fragmentation length is bigger than default, then use that -#if defined(EMBER_AF_PLUGIN_FRAGMENTATION) && (EMBER_AF_PLUGIN_FRAGMENTATION_BUFFER_SIZE > EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH) -#define EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH EMBER_AF_PLUGIN_FRAGMENTATION_BUFFER_SIZE -#define EMBER_AF_INCOMING_BUFFER_LENGTH EMBER_AF_PLUGIN_FRAGMENTATION_BUFFER_SIZE -#else -#define EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH -#define EMBER_AF_INCOMING_BUFFER_LENGTH EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH -#endif +#define EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH 1024 +#define EMBER_AF_INCOMING_BUFFER_LENGTH 1024 // ******************************************************************* // Application configuration of Flash diff --git a/src/app/util/process-global-message.cpp b/src/app/util/process-global-message.cpp index 72c6488eee08de..013b8ba5adfc53 100644 --- a/src/app/util/process-global-message.cpp +++ b/src/app/util/process-global-message.cpp @@ -73,13 +73,13 @@ bool emAfSyncingTime = false; #endif #define DISC_ATTR_RSP_MAX_ATTRIBUTES \ - (((EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ - - 1) /* discovery is complete boolean */ \ + (((EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ + - 1) /* discovery is complete boolean */ \ / 3) /* size of one discover attributes response entry */ \ % UINT8_MAX) /* make count fit in an 8 bit integer */ #define DISC_ATTR_EXT_RSP_MAX_ATTRIBUTES \ - (((EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ - - 1) /* discovery is complete boolean */ \ + (((EMBER_AF_MAXIMUM_SEND_PAYLOAD_LENGTH - EMBER_AF_ZCL_MANUFACTURER_SPECIFIC_OVERHEAD /* max ZCL header size */ \ + - 1) /* discovery is complete boolean */ \ / 4) /* size of one discover attributes extended response entry */ \ % UINT8_MAX) /* make count fit in an 8 bit integer */ diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 2ba6e603fd1692..a32f29dc50163e 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -851,52 +851,6 @@ EmberStatus emberAfSendDefaultResponse(const EmberAfClusterCommand * cmd, EmberA return emberAfSendDefaultResponseWithCallback(cmd, status, NULL); } -uint8_t emberAfMaximumApsPayloadLength(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame) -{ - NodeId destination = EMBER_UNKNOWN_NODE_ID; - uint8_t max = EMBER_AF_MAXIMUM_APS_PAYLOAD_LENGTH; - - if ((apsFrame->options & EMBER_APS_OPTION_SOURCE_EUI64) != 0U) - { - max = static_cast(max - EUI64_SIZE); - } - if ((apsFrame->options & EMBER_APS_OPTION_DESTINATION_EUI64) != 0U) - { - max = static_cast(max - EUI64_SIZE); - } - if ((apsFrame->options & EMBER_APS_OPTION_FRAGMENT) != 0U) - { - max = static_cast(max - EMBER_AF_APS_FRAGMENTATION_OVERHEAD); - } - - switch (type) - { - case EMBER_OUTGOING_DIRECT: - destination = indexOrDestination; - break; - case EMBER_OUTGOING_VIA_ADDRESS_TABLE: - // destination = emberGetAddressTableRemoteNodeId(indexOrDestination); - break; - case EMBER_OUTGOING_VIA_BINDING: - // destination = emberGetBindingRemoteNodeId(indexOrDestination); - break; - case EMBER_OUTGOING_MULTICAST: - // APS multicast messages include the two-byte group id and exclude the - // one-byte destination endpoint, for a net loss of an extra byte. - max--; - break; - case EMBER_OUTGOING_BROADCAST: - break; - default: - // MISRA requires default case. - break; - } - - max = static_cast(max - emberAfGetSourceRouteOverheadCallback(destination)); - - return max; -} - void emberAfCopyInt16u(uint8_t * data, uint16_t index, uint16_t x) { data[index] = (uint8_t)(((x)) & 0xFF); diff --git a/src/app/zap-templates/templates/app/callback-stub-src.zapt b/src/app/zap-templates/templates/app/callback-stub-src.zapt index 14929a953e4559..2f87c9a405276e 100644 --- a/src/app/zap-templates/templates/app/callback-stub-src.zapt +++ b/src/app/zap-templates/templates/app/callback-stub-src.zapt @@ -564,18 +564,6 @@ bool __attribute__((weak)) emberAfGetEndpointInfoCallback( return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index 033127264c7d0b..83bbd43a4b4353 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -578,15 +578,6 @@ uint32_t emberAfGetCurrentTimeCallback(); */ bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/controller/python/gen/callback-stub.cpp b/src/controller/python/gen/callback-stub.cpp index 4fb4f5f9ee42ae..9ebbcf0a7d606f 100644 --- a/src/controller/python/gen/callback-stub.cpp +++ b/src/controller/python/gen/callback-stub.cpp @@ -806,18 +806,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/controller/python/gen/callback.h b/src/controller/python/gen/callback.h index 30c7632b5e639e..17c89be4d98fc7 100644 --- a/src/controller/python/gen/callback.h +++ b/src/controller/python/gen/callback.h @@ -3548,15 +3548,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/darwin/Framework/CHIP/gen/callback-stub.cpp b/src/darwin/Framework/CHIP/gen/callback-stub.cpp index 33666ecc7a520a..692e2845326d6d 100644 --- a/src/darwin/Framework/CHIP/gen/callback-stub.cpp +++ b/src/darwin/Framework/CHIP/gen/callback-stub.cpp @@ -718,18 +718,6 @@ emberAfGetEndpointInfoCallback(EndpointId endpoint, uint8_t * returnNetworkIndex return false; } -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t __attribute__((weak)) emberAfGetSourceRouteOverheadCallback(chip::NodeId destination) -{ - return 0; -} - /** @brief Registration Abort * * This callback is called when the device should abort the registration diff --git a/src/darwin/Framework/CHIP/gen/callback.h b/src/darwin/Framework/CHIP/gen/callback.h index 6045ed41af6075..427396801eb7a0 100644 --- a/src/darwin/Framework/CHIP/gen/callback.h +++ b/src/darwin/Framework/CHIP/gen/callback.h @@ -2552,15 +2552,6 @@ uint32_t emberAfGetCurrentTimeCallback(); bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex, EmberAfEndpointInfoStruct * returnEndpointInfo); -/** @brief Get Source Route Overhead - * - * This function is called by the framework to determine the overhead required - * in the network frame for source routing to a particular destination. - * - * @param destination The node id of the destination Ver.: always - */ -uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination); - /** @brief Registration Abort * * This callback is called when the device should abort the registration From 4fbb13b39c3f08d9df24803ec992863162271a79 Mon Sep 17 00:00:00 2001 From: Sweety Date: Tue, 4 May 2021 00:32:17 +0530 Subject: [PATCH 06/31] ESP32: Optimize the temperature-measurement-app for CMake (#6397) --- config/esp32/components/chip/CMakeLists.txt | 9 +++++++++ .../temperature-measurement-app/esp32/CMakeLists.txt | 6 ++++++ examples/temperature-measurement-app/esp32/README.md | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 96095816b999fb..46424f21a01a5d 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -45,10 +45,19 @@ macro(chip_gn_arg_append arg val) string(APPEND chip_gn_args "${arg} = ${val}\n") endmacro() +macro(chip_gn_arg_bool arg boolean) + if (${boolean}) + string(APPEND chip_gn_args "${arg} = true\n") + else() + string(APPEND chip_gn_args "${arg} = false\n") + endif() +endmacro() + chip_gn_arg_append("esp32_ar" "\"${CMAKE_AR}\"") chip_gn_arg_append("esp32_cc" "\"${CMAKE_C_COMPILER}\"") chip_gn_arg_append("esp32_cxx" "\"${CMAKE_CXX_COMPILER}\"") chip_gn_arg_append("esp32_cpu" "\"esp32\"") +chip_gn_arg_bool("is_debug" is_debug) if(CONFIG_ENABLE_PW_RPC) chip_gn_arg_append("chip_build_pw_rpc_lib" "true") diff --git a/examples/temperature-measurement-app/esp32/CMakeLists.txt b/examples/temperature-measurement-app/esp32/CMakeLists.txt index e1a94d2e4c3969..c72b7a3935dd4c 100644 --- a/examples/temperature-measurement-app/esp32/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/CMakeLists.txt @@ -17,6 +17,12 @@ # The following lines of boilerplate have to be in your project's # CMakeLists in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) + +set(is_debug true CACHE BOOL "Optimization variable") +if(NOT is_debug) + set(SDKCONFIG_DEFAULTS "sdkconfig.optimize.defaults") +endif() + include($ENV{IDF_PATH}/tools/cmake/project.cmake) # The list of extra component dirs must be in sync with that in temperature-measurement-app/esp32/Makefile diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index 02b385a398c5b6..206033d6a40987 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -135,5 +135,5 @@ Optimization related to WiFi, BLuetooth, Asserts etc are the part of this example by default. To enable this option set is_debug=false from command-line. ``` -idf make build flash monitor 'is_debug=false' +idf.py -Dis_debug=false build flash monitor ``` From 5180abfc0b43495a6faaa3889a4f04f7a6de7cb9 Mon Sep 17 00:00:00 2001 From: Timothy Maes Date: Mon, 3 May 2021 21:37:44 +0200 Subject: [PATCH 07/31] * Fix 64-bit prints mDNS code for nano libprintf (#6420) --- src/app/server/Mdns.cpp | 12 ++++++++---- src/lib/mdns/Discovery_ImplPlatform.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/app/server/Mdns.cpp b/src/app/server/Mdns.cpp index 91735ad314036a..c9b64fd5fa06e1 100644 --- a/src/app/server/Mdns.cpp +++ b/src/app/server/Mdns.cpp @@ -49,8 +49,9 @@ NodeId GetCurrentNodeId() auto pairing = GetGlobalAdminPairingTable().cbegin(); if (pairing != GetGlobalAdminPairingTable().cend()) { - ChipLogProgress(Discovery, "Found admin paring for admin %" PRIX16 ", node %" PRIX64, pairing->GetAdminId(), - pairing->GetNodeId()); + ChipLogProgress(Discovery, "Found admin paring for admin %" PRIX16 ", node 0x%08" PRIx32 "%08" PRIx32, + pairing->GetAdminId(), static_cast(pairing->GetNodeId() >> 32), + static_cast(pairing->GetNodeId())); return pairing->GetNodeId(); } @@ -105,8 +106,11 @@ CHIP_ERROR AdvertiseOperational() auto & mdnsAdvertiser = chip::Mdns::ServiceAdvertiser::Instance(); - ChipLogProgress(Discovery, "Advertise operational node %" PRIX64 "-%" PRIX64, advertiseParameters.GetPeerId().GetFabricId(), - advertiseParameters.GetPeerId().GetNodeId()); + ChipLogProgress(Discovery, "Advertise operational node 0x%08" PRIx32 "%08" PRIx32 "-0x%08" PRIx32 "%08" PRIx32, + static_cast(advertiseParameters.GetPeerId().GetFabricId() >> 32), + static_cast(advertiseParameters.GetPeerId().GetFabricId()), + static_cast(advertiseParameters.GetPeerId().GetNodeId() >> 32), + static_cast(advertiseParameters.GetPeerId().GetNodeId())); return mdnsAdvertiser.Advertise(advertiseParameters); } diff --git a/src/lib/mdns/Discovery_ImplPlatform.cpp b/src/lib/mdns/Discovery_ImplPlatform.cpp index ae0258268d2f40..75328ef6c8ecf7 100644 --- a/src/lib/mdns/Discovery_ImplPlatform.cpp +++ b/src/lib/mdns/Discovery_ImplPlatform.cpp @@ -160,7 +160,8 @@ CHIP_ERROR DiscoveryImplPlatform::Advertise(const CommissionAdvertisingParameter ReturnErrorOnFailure(SetupHostname(params.GetMac())); - snprintf(service.mName, sizeof(service.mName), "%016" PRIX64, mCommissionInstanceName); + snprintf(service.mName, sizeof(service.mName), "%08" PRIX32 "%08" PRIX32, static_cast(mCommissionInstanceName >> 32), + static_cast(mCommissionInstanceName)); if (params.GetCommissionAdvertiseMode() == CommssionAdvertiseMode::kCommissioning) { strncpy(service.mType, "_chipc", sizeof(service.mType)); @@ -374,7 +375,8 @@ void DiscoveryImplPlatform::HandleNodeIdResolve(void * context, MdnsService * re nodeData.mAddress = result->mAddress.ValueOr({}); nodeData.mPort = result->mPort; - ChipLogProgress(Discovery, "Node ID resolved for %" PRIX64, nodeData.mPeerId.GetNodeId()); + ChipLogProgress(Discovery, "Node ID resolved for 0x08%" PRIX32 "08%" PRIX32, + static_cast(nodeData.mPeerId.GetNodeId() >> 32), static_cast(nodeData.mPeerId.GetNodeId())); mgr->mResolverDelegate->OnNodeIdResolved(nodeData); } From 91a2b6d660c2bb4794b4fc15eee70bbe571c4570 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 3 May 2021 12:46:31 -0700 Subject: [PATCH 08/31] Fix restyle URL for downloading script (#6427) --- scripts/helpers/restyle-diff.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/helpers/restyle-diff.sh b/scripts/helpers/restyle-diff.sh index cfa7271be1e790..4701b0a7e7710a 100755 --- a/scripts/helpers/restyle-diff.sh +++ b/scripts/helpers/restyle-diff.sh @@ -33,7 +33,7 @@ set -e CHIP_ROOT=$(cd "$here/../.." && pwd) restyle-paths() { - url=https://github.com/restyled-io/restyler/raw/master/bin/restyle-path + url=https://github.com/restyled-io/restyler/raw/main/bin/restyle-path sh <(curl --location --proto "=https" --tlsv1.2 "$url" -sSf) "$@" } From 06a9a3e5a5c00e6e4611803d023d501633c89e83 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 3 May 2021 21:47:08 +0200 Subject: [PATCH 09/31] Make sure string data is available when passed to the registered completion handler (#6411) * Make sure string data are available when passed to the registered completion handler * Update gen/ folders --- examples/chip-tool/gen/CHIPClustersObjc.mm | 7 +++---- .../zap-templates/templates/app/CHIPClustersObjc-src.zapt | 5 +++-- src/controller/python/gen/CHIPClustersObjc.mm | 7 +++---- src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm | 7 +++---- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm index e6f2c8eae4cfa8..dc439dadcc29c8 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.mm +++ b/examples/chip-tool/gen/CHIPClustersObjc.mm @@ -104,16 +104,15 @@ static void CallbackFn(void * context, uint8_t status) static void CallbackFn(void * context, chip::ByteSpan value) { + NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; + CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ if (callback->mOctetString) { - NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; callback->mHandler(nil, @ { @"value" : data }); } else { - NSString * str = [[NSString alloc] initWithBytes:value.data() - length:value.size() - encoding:NSUTF8StringEncoding]; + NSString * str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; callback->mHandler(nil, @ { @"value" : str }); } diff --git a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt index 82bb71680a5718..52de41c0548053 100644 --- a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt @@ -88,17 +88,18 @@ public: static void CallbackFn(void * context, chip::ByteSpan value) { + NSData * data = [NSData dataWithBytes: value.data() length: value.size()]; + CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ if (callback->mOctetString) { - NSData *data = [NSData dataWithBytes: value.data() length: value.size()]; callback->mHandler(nil, @{ @"value": data }); } else { - NSString * str = [[NSString alloc] initWithBytes:value.data() length:value.size() encoding:NSUTF8StringEncoding]; + NSString * str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; callback->mHandler(nil, @{ @"value": str }); } diff --git a/src/controller/python/gen/CHIPClustersObjc.mm b/src/controller/python/gen/CHIPClustersObjc.mm index 4eb235e195872e..b9125119350285 100644 --- a/src/controller/python/gen/CHIPClustersObjc.mm +++ b/src/controller/python/gen/CHIPClustersObjc.mm @@ -104,16 +104,15 @@ static void CallbackFn(void * context, uint8_t status) static void CallbackFn(void * context, chip::ByteSpan value) { + NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; + CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ if (callback->mOctetString) { - NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; callback->mHandler(nil, @ { @"value" : data }); } else { - NSString * str = [[NSString alloc] initWithBytes:value.data() - length:value.size() - encoding:NSUTF8StringEncoding]; + NSString * str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; callback->mHandler(nil, @ { @"value" : str }); } diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 1c21cbcf9485d8..29e4339c74cd60 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -104,16 +104,15 @@ static void CallbackFn(void * context, uint8_t status) static void CallbackFn(void * context, chip::ByteSpan value) { + NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; + CHIPStringAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ if (callback->mOctetString) { - NSData * data = [NSData dataWithBytes:value.data() length:value.size()]; callback->mHandler(nil, @ { @"value" : data }); } else { - NSString * str = [[NSString alloc] initWithBytes:value.data() - length:value.size() - encoding:NSUTF8StringEncoding]; + NSString * str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; callback->mHandler(nil, @ { @"value" : str }); } From 237cfd0513ed16be521e59fa89fe4192d0291ffd Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 3 May 2021 14:32:48 -0700 Subject: [PATCH 10/31] Add APIs to generate minimal CHIP x509 encoded certificates (#6370) * Add APIs to generate minimal CHIP x509 encoded certificates * fix build errors * address review comments * address some review comments * some more cleanup * Fix test stack usage * remove PutRaw() and add a TODO * add anonymous namespace * Check that serial number is not negative --- src/credentials/BUILD.gn | 1 + src/credentials/CHIPCert.h | 82 ++++ src/credentials/GenerateChipX509Cert.cpp | 466 +++++++++++++++++++++++ src/credentials/tests/TestChipCert.cpp | 265 +++++++++++++ src/crypto/CHIPCryptoPAL.h | 26 +- src/crypto/CHIPCryptoPALOpenSSL.cpp | 10 + src/crypto/CHIPCryptoPALmbedTLS.cpp | 14 + 7 files changed, 858 insertions(+), 6 deletions(-) create mode 100644 src/credentials/GenerateChipX509Cert.cpp diff --git a/src/credentials/BUILD.gn b/src/credentials/BUILD.gn index 80e4e06d818c1c..b0d03ee1c3b44b 100644 --- a/src/credentials/BUILD.gn +++ b/src/credentials/BUILD.gn @@ -25,6 +25,7 @@ static_library("credentials") { "CHIPCertToX509.cpp", "CHIPOperationalCredentials.cpp", "CHIPOperationalCredentials.h", + "GenerateChipX509Cert.cpp", ] cflags = [ "-Wconversion" ] diff --git a/src/credentials/CHIPCert.h b/src/credentials/CHIPCert.h index 497b796d2ea33c..c8295fd289d0cb 100644 --- a/src/credentials/CHIPCert.h +++ b/src/credentials/CHIPCert.h @@ -641,6 +641,88 @@ CHIP_ERROR ConvertX509CertToChipCert(const uint8_t * x509Cert, uint32_t x509Cert CHIP_ERROR ConvertChipCertToX509Cert(const uint8_t * chipCert, uint32_t chipCertLen, uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen); +/** + * @brief Generate a standard X.509 DER encoded certificate using provided CHIP certificate and signing key + * + * @param chipCert Buffer containing CHIP certificate. + * @param chipCertLen The length of the CHIP certificate. + * @param keypair The certificate signing key + * @param x509CertBuf Buffer to store signed certificate in X.509 DER format. + * @param x509CertBufSize The size of the buffer to store converted certificate. + * @param x509CertLen The length of the converted certificate. + * + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ +CHIP_ERROR GenerateSignedX509CertFromChipCert(const uint8_t * chipCert, uint32_t chipCertLen, Crypto::P256Keypair & keypair, + uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen); + +// TODO: Add support for Authentication Tag Attribute +struct X509CertRequestParams +{ + int64_t SerialNumber; + uint64_t Issuer; + uint32_t ValidityStart; + uint32_t ValidityEnd; + bool HasFabricID; + uint64_t FabricID; + bool HasNodeID; + uint64_t NodeID; +}; + +enum CertificateIssuerLevel +{ + kIssuerIsRootCA, + kIssuerIsIntermediateCA, +}; + +/** + * @brief Generate a new X.509 DER encoded Root CA certificate + * + * @param requestParams Certificate request parameters. + * @param issuerKeypair The certificate signing key + * @param x509CertBuf Buffer to store signed certificate in X.509 DER format. + * @param x509CertBufSize The size of the buffer to store converted certificate. + * @param x509CertLen The length of the converted certificate. + * + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ +CHIP_ERROR NewRootX509Cert(const X509CertRequestParams & requestParams, Crypto::P256Keypair & issuerKeypair, uint8_t * x509CertBuf, + uint32_t x509CertBufSize, uint32_t & x509CertLen); + +/** + * @brief Generate a new X.509 DER encoded Intermediate CA certificate + * + * @param requestParams Certificate request parameters. + * @param subject The requested subject ID + * @param subjectPubkey The public key of subject + * @param issuerKeypair The certificate signing key + * @param x509CertBuf Buffer to store signed certificate in X.509 DER format. + * @param x509CertBufSize The size of the buffer to store converted certificate. + * @param x509CertLen The length of the converted certificate. + * + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ +CHIP_ERROR NewICAX509Cert(const X509CertRequestParams & requestParams, uint64_t subject, + const Crypto::P256PublicKey & subjectPubkey, Crypto::P256Keypair & issuerKeypair, uint8_t * x509CertBuf, + uint32_t x509CertBufSize, uint32_t & x509CertLen); + +/** + * @brief Generate a new X.509 DER encoded Node operational certificate + * + * @param requestParams Certificate request parameters. + * @param issuerLevel Indicates if the issuer is a root CA or an intermediate CA + * @param subjectPubkey The public key of subject + * @param issuerKeypair The certificate signing key + * @param x509CertBuf Buffer to store signed certificate in X.509 DER format. + * @param x509CertBufSize The size of the buffer to store converted certificate. + * @param x509CertLen The length of the converted certificate. + * + * @return Returns a CHIP_ERROR on error, CHIP_NO_ERROR otherwise + **/ +CHIP_ERROR NewNodeOperationalX509Cert(const X509CertRequestParams & requestParams, CertificateIssuerLevel issuerLevel, + const Crypto::P256PublicKey & subjectPubkey, Crypto::P256Keypair & issuerKeypair, + uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen); + /** * @brief * Convert a certificate date/time (in the form of an ASN.1 universal time structure) into a CHIP Epoch UTC time. diff --git a/src/credentials/GenerateChipX509Cert.cpp b/src/credentials/GenerateChipX509Cert.cpp new file mode 100644 index 00000000000000..152cd3c8f679e7 --- /dev/null +++ b/src/credentials/GenerateChipX509Cert.cpp @@ -0,0 +1,466 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +/** + * @file + * This file implements methods for generating CHIP X.509 certificate. + * + */ + +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace Credentials { + +using namespace chip::ASN1; +using namespace chip::Protocols; + +namespace { + +struct ChipDNParams +{ + OID AttrOID; + uint64_t Value; +}; + +enum IsCACert +{ + kCACert, + kNotCACert, +}; + +constexpr uint8_t kSHA1_Hash_Langth = 20; + +CHIP_ERROR EncodeSubjectPublicKeyInfo(const Crypto::P256PublicKey & pubkey, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + ASN1_START_SEQUENCE + { + ASN1_ENCODE_OBJECT_ID(kOID_PubKeyAlgo_ECPublicKey); + ASN1_ENCODE_OBJECT_ID(kOID_EllipticCurve_prime256v1); + } + ASN1_END_SEQUENCE; + + ReturnErrorOnFailure(writer.PutBitString(0, pubkey, static_cast(pubkey.Length()))); + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeAuthorityKeyIdentifierExtension(const Crypto::P256PublicKey & pubkey, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + OID extensionOID = GetOID(kOIDCategory_Extension, static_cast(kTag_AuthorityKeyIdentifier)); + + ASN1_ENCODE_OBJECT_ID(extensionOID); + + ASN1_START_OCTET_STRING_ENCAPSULATED + { + ASN1_START_SEQUENCE + { + uint8_t keyid[kSHA1_Hash_Langth]; + ReturnErrorOnFailure(Crypto::Hash_SHA1(pubkey, pubkey.Length(), keyid)); + + ReturnErrorOnFailure( + writer.PutOctetString(kASN1TagClass_ContextSpecific, 0, keyid, static_cast(sizeof(keyid)))); + } + ASN1_END_SEQUENCE; + } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeSubjectKeyIdentifierExtension(const Crypto::P256PublicKey & pubkey, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + OID extensionOID = GetOID(kOIDCategory_Extension, static_cast(kTag_SubjectKeyIdentifier)); + + ASN1_ENCODE_OBJECT_ID(extensionOID); + + ASN1_START_OCTET_STRING_ENCAPSULATED + { + uint8_t keyid[kSHA1_Hash_Langth]; + ReturnErrorOnFailure(Crypto::Hash_SHA1(pubkey, pubkey.Length(), keyid)); + + ReturnErrorOnFailure(writer.PutOctetString(keyid, static_cast(sizeof(keyid)))); + } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeKeyUsageExtension(uint16_t keyUsageBits, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + OID extensionOID = GetOID(kOIDCategory_Extension, static_cast(kTag_KeyUsage)); + + ASN1_ENCODE_OBJECT_ID(extensionOID); + + // KeyUsage extension MUST be marked as critical. + ASN1_ENCODE_BOOLEAN(true); + ASN1_START_OCTET_STRING_ENCAPSULATED { ASN1_ENCODE_BIT_STRING(keyUsageBits); } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeIsCAExtension(IsCACert isCA, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + OID extensionOID = GetOID(kOIDCategory_Extension, static_cast(kTag_BasicConstraints)); + + ASN1_ENCODE_OBJECT_ID(extensionOID); + + // BasicConstraints extension MUST be marked as critical. + ASN1_ENCODE_BOOLEAN(true); + + ASN1_START_OCTET_STRING_ENCAPSULATED + { + ASN1_START_SEQUENCE + { + // cA BOOLEAN + if (isCA == kCACert) + { + // Encode the boolean only if isCA is true + ASN1_ENCODE_BOOLEAN(true); + } + } + ASN1_END_SEQUENCE; + } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeCASpecificExtensions(ASN1Writer & writer) +{ + ReturnErrorOnFailure(EncodeIsCAExtension(kCACert, writer)); + + uint16_t keyUsageBits = static_cast(KeyUsageFlags::kKeyCertSign) | static_cast(KeyUsageFlags::kCRLSign); + + ReturnErrorOnFailure(EncodeKeyUsageExtension(keyUsageBits, writer)); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR EncodeNOCSpecificExtensions(ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + uint16_t keyUsageBits = + static_cast(KeyUsageFlags::kDigitalSignature) | static_cast(KeyUsageFlags::kKeyEncipherment); + + ReturnErrorOnFailure(EncodeIsCAExtension(kNotCACert, writer)); + ReturnErrorOnFailure(EncodeKeyUsageExtension(keyUsageBits, writer)); + + ASN1_START_SEQUENCE + { + OID extensionOID = GetOID(kOIDCategory_Extension, static_cast(kTag_ExtendedKeyUsage)); + + ASN1_ENCODE_OBJECT_ID(extensionOID); + + // ExtKeyUsage extension MUST be marked as critical. + ASN1_ENCODE_BOOLEAN(true); + ASN1_START_OCTET_STRING_ENCAPSULATED + { + ASN1_START_SEQUENCE + { + ASN1_ENCODE_OBJECT_ID(kOID_KeyPurpose_ClientAuth); + ASN1_ENCODE_OBJECT_ID(kOID_KeyPurpose_ServerAuth); + } + ASN1_END_SEQUENCE; + } + ASN1_END_ENCAPSULATED; + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeExtensions(bool isCA, const Crypto::P256PublicKey & SKI, const Crypto::P256PublicKey & AKI, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_CONSTRUCTED(kASN1TagClass_ContextSpecific, 3) + { + ASN1_START_SEQUENCE + { + if (isCA) + { + ReturnErrorOnFailure(EncodeCASpecificExtensions(writer)); + } + else + { + ReturnErrorOnFailure(EncodeNOCSpecificExtensions(writer)); + } + + ReturnErrorOnFailure(EncodeSubjectKeyIdentifierExtension(SKI, writer)); + + ReturnErrorOnFailure(EncodeAuthorityKeyIdentifierExtension(AKI, writer)); + } + ASN1_END_SEQUENCE; + } + ASN1_END_CONSTRUCTED; + +exit: + return err; +} + +CHIP_ERROR EncodeChipDNs(ChipDNParams * params, uint8_t numParams, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_SEQUENCE + { + for (uint8_t i = 0; i < numParams; i++) + { + ASN1_START_SET + { + uint8_t chipAttrStr[kChip64bitAttrUTF8Length + 1]; + snprintf(reinterpret_cast(chipAttrStr), sizeof(chipAttrStr), "%016" PRIX64, params[i].Value); + + ASN1_START_SEQUENCE + { + ASN1_ENCODE_OBJECT_ID(params[i].AttrOID); + ReturnErrorOnFailure(writer.PutString(kASN1UniversalTag_UTF8String, Uint8::to_const_char(chipAttrStr), 16)); + } + ASN1_END_SEQUENCE; + } + ASN1_END_SET; + } + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeValidity(uint32_t validityStart, uint32_t validityEnd, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ASN1UniversalTime asn1Time; + + ASN1_START_SEQUENCE + { + ReturnErrorOnFailure(ChipEpochToASN1Time(validityStart, asn1Time)); + ASN1_ENCODE_TIME(asn1Time); + + ReturnErrorOnFailure(ChipEpochToASN1Time(validityEnd, asn1Time)); + ASN1_ENCODE_TIME(asn1Time); + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR EncodeChipECDSASignature(Crypto::P256ECDSASignature & signature, ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ASN1_START_BIT_STRING_ENCAPSULATED { writer.PutConstructedType(signature, (uint16_t) signature.Length()); } + ASN1_END_ENCAPSULATED; + +exit: + return err; +} + +} // namespace + +CHIP_ERROR EncodeTBSCert(const X509CertRequestParams & requestParams, CertificateIssuerLevel issuerLevel, uint64_t subject, + const Crypto::P256PublicKey & subjectPubkey, const Crypto::P256PublicKey & issuerPubkey, + ASN1Writer & writer) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipDNParams dnParams[2]; + uint8_t numDNs = 1; + bool isCA = true; + + VerifyOrReturnError(requestParams.SerialNumber > 0, CHIP_ERROR_INVALID_ARGUMENT); + + ASN1_START_SEQUENCE + { + // version [0] EXPLICIT Version DEFAULT v1 + ASN1_START_CONSTRUCTED(kASN1TagClass_ContextSpecific, 0) + { + // Version ::= INTEGER { v1(0), v2(1), v3(2) } + ASN1_ENCODE_INTEGER(2); + } + ASN1_END_CONSTRUCTED; + + ReturnErrorOnFailure(writer.PutInteger(requestParams.SerialNumber)); + + ASN1_START_SEQUENCE { ASN1_ENCODE_OBJECT_ID(kOID_SigAlgo_ECDSAWithSHA256); } + ASN1_END_SEQUENCE; + + // Issuer OID depends on if cert is being signed by the root CA + if (issuerLevel == kIssuerIsRootCA) + { + dnParams[0].AttrOID = chip::ASN1::kOID_AttributeType_ChipRootId; + } + else + { + dnParams[0].AttrOID = chip::ASN1::kOID_AttributeType_ChipICAId; + } + dnParams[0].Value = requestParams.Issuer; + + if (requestParams.HasFabricID) + { + dnParams[1].AttrOID = chip::ASN1::kOID_AttributeType_ChipFabricId; + dnParams[1].Value = requestParams.FabricID; + numDNs = 2; + } + ReturnErrorOnFailure(EncodeChipDNs(dnParams, numDNs, writer)); + + // validity Validity, + ReturnErrorOnFailure(EncodeValidity(requestParams.ValidityStart, requestParams.ValidityEnd, writer)); + + // subject Name + if (requestParams.HasNodeID) + { + dnParams[0].AttrOID = chip::ASN1::kOID_AttributeType_ChipNodeId; + + isCA = false; + } + else if (subjectPubkey != issuerPubkey) + { + dnParams[0].AttrOID = chip::ASN1::kOID_AttributeType_ChipICAId; + } + dnParams[0].Value = subject; + + ReturnErrorOnFailure(EncodeChipDNs(dnParams, numDNs, writer)); + + ReturnErrorOnFailure(EncodeSubjectPublicKeyInfo(subjectPubkey, writer)); + + // certificate extensions + ReturnErrorOnFailure(EncodeExtensions(isCA, subjectPubkey, issuerPubkey, writer)); + } + ASN1_END_SEQUENCE; + +exit: + return err; +} + +CHIP_ERROR NewChipX509Cert(const X509CertRequestParams & requestParams, CertificateIssuerLevel issuerLevel, uint64_t subject, + const Crypto::P256PublicKey & subjectPubkey, Crypto::P256Keypair & issuerKeypair, uint8_t * x509CertBuf, + uint32_t x509CertBufSize, uint32_t & x509CertLen) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ASN1Writer writer; + writer.Init(x509CertBuf, x509CertBufSize); + + ReturnErrorOnFailure(EncodeTBSCert(requestParams, issuerLevel, subject, subjectPubkey, issuerKeypair.Pubkey(), writer)); + writer.Finalize(); + + Crypto::P256ECDSASignature signature; + ReturnErrorOnFailure(issuerKeypair.ECDSA_sign_msg(x509CertBuf, writer.GetLengthWritten(), signature)); + + writer.Init(x509CertBuf, x509CertBufSize); + + ASN1_START_SEQUENCE + { + ReturnErrorOnFailure(EncodeTBSCert(requestParams, issuerLevel, subject, subjectPubkey, issuerKeypair.Pubkey(), writer)); + + ASN1_START_SEQUENCE { ASN1_ENCODE_OBJECT_ID(kOID_SigAlgo_ECDSAWithSHA256); } + ASN1_END_SEQUENCE; + + ReturnErrorOnFailure(EncodeChipECDSASignature(signature, writer)); + } + ASN1_END_SEQUENCE; + + writer.Finalize(); + x509CertLen = writer.GetLengthWritten(); + +exit: + return err; +} + +DLL_EXPORT CHIP_ERROR NewRootX509Cert(const X509CertRequestParams & requestParams, Crypto::P256Keypair & issuerKeypair, + uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen) +{ + ReturnErrorCodeIf(requestParams.HasNodeID, CHIP_ERROR_INVALID_ARGUMENT); + return NewChipX509Cert(requestParams, kIssuerIsRootCA, requestParams.Issuer, issuerKeypair.Pubkey(), issuerKeypair, x509CertBuf, + x509CertBufSize, x509CertLen); +} + +DLL_EXPORT CHIP_ERROR NewICAX509Cert(const X509CertRequestParams & requestParams, uint64_t subject, + const Crypto::P256PublicKey & subjectPubkey, Crypto::P256Keypair & issuerKeypair, + uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen) +{ + ReturnErrorCodeIf(requestParams.HasNodeID, CHIP_ERROR_INVALID_ARGUMENT); + return NewChipX509Cert(requestParams, kIssuerIsRootCA, subject, subjectPubkey, issuerKeypair, x509CertBuf, x509CertBufSize, + x509CertLen); +} + +DLL_EXPORT CHIP_ERROR NewNodeOperationalX509Cert(const X509CertRequestParams & requestParams, CertificateIssuerLevel issuerLevel, + const Crypto::P256PublicKey & subjectPubkey, Crypto::P256Keypair & issuerKeypair, + uint8_t * x509CertBuf, uint32_t x509CertBufSize, uint32_t & x509CertLen) +{ + VerifyOrReturnError(requestParams.HasNodeID, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(requestParams.HasFabricID, CHIP_ERROR_INVALID_ARGUMENT); + return NewChipX509Cert(requestParams, issuerLevel, requestParams.NodeID, subjectPubkey, issuerKeypair, x509CertBuf, + x509CertBufSize, x509CertLen); +} + +} // namespace Credentials +} // namespace chip diff --git a/src/credentials/tests/TestChipCert.cpp b/src/credentials/tests/TestChipCert.cpp index 2adc764d209c71..4d561ad6704e86 100644 --- a/src/credentials/tests/TestChipCert.cpp +++ b/src/credentials/tests/TestChipCert.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -40,6 +41,7 @@ using namespace chip::ASN1; using namespace chip::TLV; using namespace chip::Credentials; using namespace chip::TestCerts; +using namespace chip::Crypto; enum { @@ -635,6 +637,263 @@ static void TestChipCert_CertType(nlTestSuite * inSuite, void * inContext) } } +static void TestChipCert_GenerateRootCert(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + uint8_t signed_cert[kTestCertBufSize]; + uint32_t signed_len = 0; + + ChipCertificateData certData; + + X509CertRequestParams root_params = { 1234, 0xabcdabcd, 9876, 98790000, false, 0, false, 0 }; + + NL_TEST_ASSERT(inSuite, NewRootX509Cert(root_params, keypair, signed_cert, sizeof(signed_cert), signed_len) == CHIP_NO_ERROR); + + uint8_t outCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(signed_cert, signed_len, outCertBuf, sizeof(outCertBuf), outCertLen) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCertBuf, outCertLen, certData) == CHIP_NO_ERROR); + + // Test that root cert cannot be provided a node ID + root_params.HasNodeID = true; + NL_TEST_ASSERT(inSuite, + NewRootX509Cert(root_params, keypair, signed_cert, sizeof(signed_cert), signed_len) == + CHIP_ERROR_INVALID_ARGUMENT); + + // Test that serial number cannot be negative + root_params.HasNodeID = false; + root_params.SerialNumber = -1; + NL_TEST_ASSERT(inSuite, + NewRootX509Cert(root_params, keypair, signed_cert, sizeof(signed_cert), signed_len) == + CHIP_ERROR_INVALID_ARGUMENT); +} + +static void TestChipCert_GenerateRootFabCert(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + uint8_t signed_cert[kTestCertBufSize]; + uint32_t signed_len = 0; + + ChipCertificateData certData; + + uint8_t outCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + X509CertRequestParams root_params_fabric = { 1234, 0xabcdabcd, 9876, 98790000, true, 0xabcd, false, 0 }; + + NL_TEST_ASSERT(inSuite, + NewRootX509Cert(root_params_fabric, keypair, signed_cert, sizeof(signed_cert), signed_len) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(signed_cert, signed_len, outCertBuf, sizeof(outCertBuf), outCertLen) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCertBuf, outCertLen, certData) == CHIP_NO_ERROR); +} + +static void TestChipCert_GenerateICACert(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + uint8_t signed_cert[kTestCertBufSize]; + uint32_t signed_len = 0; + + uint8_t outCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + ChipCertificateData certData; + + X509CertRequestParams ica_params = { 1234, 0xabcdabcd, 9876, 98790000, false, 0, false, 0 }; + P256Keypair ica_keypair; + NL_TEST_ASSERT(inSuite, ica_keypair.Initialize() == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + NewICAX509Cert(ica_params, 4321, ica_keypair.Pubkey(), keypair, signed_cert, sizeof(signed_cert), signed_len) == + CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(signed_cert, signed_len, outCertBuf, sizeof(outCertBuf), outCertLen) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCertBuf, outCertLen, certData) == CHIP_NO_ERROR); + + // Test that ICA cert cannot be provided a node ID + ica_params.HasNodeID = true; + NL_TEST_ASSERT(inSuite, + NewICAX509Cert(ica_params, 4321, ica_keypair.Pubkey(), keypair, signed_cert, sizeof(signed_cert), signed_len) == + CHIP_ERROR_INVALID_ARGUMENT); + + // Test that serial number cannot be negative + ica_params.HasNodeID = false; + ica_params.SerialNumber = -1; + NL_TEST_ASSERT(inSuite, + NewICAX509Cert(ica_params, 4321, ica_keypair.Pubkey(), keypair, signed_cert, sizeof(signed_cert), signed_len) == + CHIP_ERROR_INVALID_ARGUMENT); +} + +static void TestChipCert_GenerateNOCRoot(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + uint8_t signed_cert[kTestCertBufSize]; + uint32_t signed_len = 0; + + uint8_t outCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + ChipCertificateData certData; + + X509CertRequestParams noc_params = { 1234, 0xabcdabcd, 9876, 98790000, true, 0x8888, true, 0x1234 }; + P256Keypair noc_keypair; + NL_TEST_ASSERT(inSuite, noc_keypair.Initialize() == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsRootCA, noc_keypair.Pubkey(), keypair, signed_cert, + sizeof(signed_cert), signed_len) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(signed_cert, signed_len, outCertBuf, sizeof(outCertBuf), outCertLen) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCertBuf, outCertLen, certData) == CHIP_NO_ERROR); + + // Test that NOC cert must be provided a node ID + noc_params.HasNodeID = false; + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsRootCA, noc_keypair.Pubkey(), keypair, signed_cert, + sizeof(signed_cert), signed_len) == CHIP_ERROR_INVALID_ARGUMENT); + + // Test that NOC cert must be provided a fabric ID + noc_params.HasNodeID = true; + noc_params.HasFabricID = false; + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsRootCA, noc_keypair.Pubkey(), keypair, signed_cert, + sizeof(signed_cert), signed_len) == CHIP_ERROR_INVALID_ARGUMENT); + + // Test that serial number cannot be negative + noc_params.HasNodeID = true; + noc_params.HasFabricID = true; + noc_params.SerialNumber = -1; + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsRootCA, noc_keypair.Pubkey(), keypair, signed_cert, + sizeof(signed_cert), signed_len) == CHIP_ERROR_INVALID_ARGUMENT); +} + +static void TestChipCert_GenerateNOCICA(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + uint8_t signed_cert[kTestCertBufSize]; + uint32_t signed_len = 0; + + uint8_t outCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + ChipCertificateData certData; + + X509CertRequestParams noc_params = { 1234, 0xabcdabcd, 9876, 98790000, true, 0x8888, true, 0x1234 }; + P256Keypair noc_keypair; + NL_TEST_ASSERT(inSuite, noc_keypair.Initialize() == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsIntermediateCA, noc_keypair.Pubkey(), keypair, signed_cert, + sizeof(signed_cert), signed_len) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(signed_cert, signed_len, outCertBuf, sizeof(outCertBuf), outCertLen) == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, DecodeChipCert(outCertBuf, outCertLen, certData) == CHIP_NO_ERROR); +} + +static void TestChipCert_VerifyGeneratedCerts(nlTestSuite * inSuite, void * inContext) +{ + // Generate a new keypair for cert signing + P256Keypair keypair; + NL_TEST_ASSERT(inSuite, keypair.Initialize() == CHIP_NO_ERROR); + + static uint8_t root_cert[kTestCertBufSize]; + uint32_t root_len = 0; + + X509CertRequestParams root_params = { 1234, 0xabcdabcd, 9876, 98790000, true, 0x8888, false, 0 }; + NL_TEST_ASSERT(inSuite, NewRootX509Cert(root_params, keypair, root_cert, sizeof(root_cert), root_len) == CHIP_NO_ERROR); + + static uint8_t ica_cert[kTestCertBufSize]; + uint32_t ica_len = 0; + + X509CertRequestParams ica_params = { 1234, 0xabcdabcd, 9876, 98790000, true, 0x8888, false, 0 }; + P256Keypair ica_keypair; + NL_TEST_ASSERT(inSuite, ica_keypair.Initialize() == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + NewICAX509Cert(ica_params, 0xaabbccdd, ica_keypair.Pubkey(), keypair, ica_cert, sizeof(ica_cert), ica_len) == + CHIP_NO_ERROR); + + static uint8_t noc_cert[kTestCertBufSize]; + uint32_t noc_len = 0; + + X509CertRequestParams noc_params = { 1234, 0xaabbccdd, 9876, 98790000, true, 0x8888, true, 0x1234 }; + P256Keypair noc_keypair; + NL_TEST_ASSERT(inSuite, noc_keypair.Initialize() == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + NewNodeOperationalX509Cert(noc_params, kIssuerIsIntermediateCA, noc_keypair.Pubkey(), ica_keypair, noc_cert, + sizeof(noc_cert), noc_len) == CHIP_NO_ERROR); + + ChipCertificateSet certSet; + NL_TEST_ASSERT(inSuite, certSet.Init(3, kTestCertBufSize * 3) == CHIP_NO_ERROR); + + static uint8_t rootCertBuf[kTestCertBufSize]; + static uint8_t icaCertBuf[kTestCertBufSize]; + static uint8_t nocCertBuf[kTestCertBufSize]; + uint32_t outCertLen; + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(root_cert, root_len, rootCertBuf, sizeof(rootCertBuf), outCertLen) == CHIP_NO_ERROR); + NL_TEST_ASSERT( + inSuite, + certSet.LoadCert(rootCertBuf, outCertLen, + BitFlags(CertDecodeFlags::kIsTrustAnchor).Set(CertDecodeFlags::kGenerateTBSHash)) == + CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(ica_cert, ica_len, icaCertBuf, sizeof(icaCertBuf), outCertLen) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, + certSet.LoadCert(icaCertBuf, outCertLen, BitFlags(CertDecodeFlags::kGenerateTBSHash)) == + CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, + ConvertX509CertToChipCert(noc_cert, noc_len, nocCertBuf, sizeof(nocCertBuf), outCertLen) == CHIP_NO_ERROR); + NL_TEST_ASSERT(inSuite, + certSet.LoadCert(nocCertBuf, outCertLen, BitFlags(CertDecodeFlags::kGenerateTBSHash)) == + CHIP_NO_ERROR); + + ValidationContext validContext; + + validContext.Reset(); + NL_TEST_ASSERT(inSuite, SetEffectiveTime(validContext, 2022, 1, 1) == CHIP_NO_ERROR); + validContext.mRequiredKeyUsages.Set(KeyUsageFlags::kDigitalSignature); + validContext.mRequiredKeyPurposes.Set(KeyPurposeFlags::kServerAuth); + + // Locate the subject DN and key id that will be used as input the FindValidCert() method. + const ChipDN & subjectDN = certSet.GetCertSet()[2].mSubjectDN; + const CertificateKeyId & subjectKeyId = certSet.GetCertSet()[2].mSubjectKeyId; + + ChipCertificateData * resultCert = nullptr; + NL_TEST_ASSERT(inSuite, certSet.FindValidCert(subjectDN, subjectKeyId, validContext, resultCert) == CHIP_NO_ERROR); +} + /** * Set up the test suite. */ @@ -670,6 +929,12 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test CHIP Certificate Validation time", TestChipCert_CertValidTime), NL_TEST_DEF("Test CHIP Certificate Usage", TestChipCert_CertUsage), NL_TEST_DEF("Test CHIP Certificate Type", TestChipCert_CertType), + NL_TEST_DEF("Test CHIP Generate Root Certificate", TestChipCert_GenerateRootCert), + NL_TEST_DEF("Test CHIP Generate Root Certificate with Fabric", TestChipCert_GenerateRootFabCert), + NL_TEST_DEF("Test CHIP Generate ICA Certificate", TestChipCert_GenerateICACert), + NL_TEST_DEF("Test CHIP Generate NOC using Root", TestChipCert_GenerateNOCRoot), + NL_TEST_DEF("Test CHIP Generate NOC using ICA", TestChipCert_GenerateNOCICA), + NL_TEST_DEF("Test CHIP Verify Generated Cert Chain", TestChipCert_VerifyGeneratedCerts), NL_TEST_SENTINEL() }; // clang-format on diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 9174a084a24636..f144e52984aaef 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -224,7 +224,7 @@ class ECPKeypair **/ virtual CHIP_ERROR ECDH_derive_secret(const PK & remote_public_key, Secret & out_secret) const = 0; - virtual const PK & Pubkey() = 0; + virtual const PK & Pubkey() const = 0; }; struct alignas(size_t) P256KeypairContext @@ -240,22 +240,26 @@ class P256Keypair : public ECPKeypair #include #include +#include #include #include @@ -189,6 +190,19 @@ CHIP_ERROR Hash_SHA256(const uint8_t * data, const size_t data_length, uint8_t * return error; } +CHIP_ERROR Hash_SHA1(const uint8_t * data, const size_t data_length, uint8_t * out_buffer) +{ + int result = 0; + + // zero data length hash is supported. + VerifyOrReturnError(out_buffer != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + + result = mbedtls_sha1_ret(Uint8::to_const_uchar(data), data_length, Uint8::to_uchar(out_buffer)); + VerifyOrReturnError(result == 0, CHIP_ERROR_INTERNAL); + + return CHIP_NO_ERROR; +} + Hash_SHA256_stream::Hash_SHA256_stream(void) {} Hash_SHA256_stream::~Hash_SHA256_stream(void) {} From 011540c23a7d6837a131ccef7051b88ebe902a26 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 4 May 2021 02:19:56 +0200 Subject: [PATCH 11/31] Zap use byte span in struct (#6432) * [ZAP] Replace 'uint8_t *' by 'chip::ByteSpan' for OCTET_STRING * Update gen/ folders --- .../all-clusters-common/gen/af-structs.h | 21 ++++++++++--------- .../bridge-app/bridge-common/gen/af-structs.h | 21 ++++++++++--------- .../chip-tool/gen/CHIPClientCallbacks.cpp | 4 ++-- examples/chip-tool/gen/CHIPClustersObjc.mm | 11 +++++----- examples/chip-tool/gen/af-structs.h | 21 ++++++++++--------- .../lighting-common/gen/af-structs.h | 21 ++++++++++--------- .../lock-app/lock-common/gen/af-structs.h | 21 ++++++++++--------- .../esp32/main/gen/af-structs.h | 21 ++++++++++--------- examples/tv-app/tv-common/gen/af-structs.h | 21 ++++++++++--------- examples/window-app/common/gen/af-structs.h | 21 ++++++++++--------- .../app/CHIPClientCallbacks-src.zapt | 8 +++++++ .../templates/app/CHIPClustersObjc-src.zapt | 10 ++++++++- .../templates/app/af-structs.zapt | 1 + src/app/zap-templates/templates/app/helper.js | 2 ++ .../python/gen/CHIPClientCallbacks.cpp | 4 ++-- src/controller/python/gen/CHIPClustersObjc.mm | 11 +++++----- src/controller/python/gen/af-structs.h | 21 ++++++++++--------- .../CHIP/gen/CHIPClientCallbacks.cpp | 4 ++-- .../Framework/CHIP/gen/CHIPClustersObjc.mm | 11 +++++----- src/darwin/Framework/CHIP/gen/af-structs.h | 21 ++++++++++--------- 20 files changed, 151 insertions(+), 125 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h +++ b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/bridge-app/bridge-common/gen/af-structs.h b/examples/bridge-app/bridge-common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/bridge-app/bridge-common/gen/af-structs.h +++ b/examples/bridge-app/bridge-common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.cpp b/examples/chip-tool/gen/CHIPClientCallbacks.cpp index 029553fb5cbc71..70a488cb90df99 100644 --- a/examples/chip-tool/gen/CHIPClientCallbacks.cpp +++ b/examples/chip-tool/gen/CHIPClientCallbacks.cpp @@ -458,7 +458,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].GroupKeyIndex = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].GroupKeyRoot = emberAfGetString(message, 0, messageLen); + data[i].GroupKeyRoot = chip::ByteSpan(message, 16); message += 16; CHECK_MESSAGE_LENGTH(16); data[i].GroupKeyEpochStartTime = emberAfGetInt64u(message, 0, messageLen); @@ -490,7 +490,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = emberAfGetString(message, 0, messageLen); + data[i].Label = chip::ByteSpan(message, 32); message += 32; CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm index dc439dadcc29c8..ed80a36ca9e775 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.mm +++ b/examples/chip-tool/gen/CHIPClustersObjc.mm @@ -2695,10 +2695,9 @@ static void CallbackFn(void * context, uint16_t count, _GroupKey * entries) values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", [NSNumber numberWithUnsignedShort:entries[i].GroupKeyIndex], @"GroupKeyIndex", - [NSData dataWithBytes:entries[i].GroupKeyRoot + 1u length:emberAfStringLength(entries[i].GroupKeyRoot)], - @"GroupKeyRoot", [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], - @"GroupKeyEpochStartTime", [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], - @"GroupKeySecurityPolicy", nil]; + [NSData dataWithBytes:entries[i].GroupKeyRoot.data() length:entries[i].GroupKeyRoot.size()], @"GroupKeyRoot", + [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], @"GroupKeyEpochStartTime", + [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], @"GroupKeySecurityPolicy", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -2737,8 +2736,8 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label + 1u length:emberAfStringLength(entries[i].Label)], - @"Label", [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; diff --git a/examples/chip-tool/gen/af-structs.h b/examples/chip-tool/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/chip-tool/gen/af-structs.h +++ b/examples/chip-tool/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/lighting-app/lighting-common/gen/af-structs.h b/examples/lighting-app/lighting-common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/lighting-app/lighting-common/gen/af-structs.h +++ b/examples/lighting-app/lighting-common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/lock-app/lock-common/gen/af-structs.h b/examples/lock-app/lock-common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/lock-app/lock-common/gen/af-structs.h +++ b/examples/lock-app/lock-common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h +++ b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/tv-app/tv-common/gen/af-structs.h b/examples/tv-app/tv-common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/tv-app/tv-common/gen/af-structs.h +++ b/examples/tv-app/tv-common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/examples/window-app/common/gen/af-structs.h b/examples/window-app/common/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/examples/window-app/common/gen/af-structs.h +++ b/examples/window-app/common/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt index 614b3288175e69..cb7d53d3e83829 100644 --- a/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClientCallbacks-src.zapt @@ -348,12 +348,20 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag { {{#if isStruct}} {{#chip_attribute_list_entryTypes}} + {{#if (isOctetString type)}} + data[i].{{name}} = chip::ByteSpan(message, {{size}}); + {{else}} data[i].{{name}} = emberAfGet{{asReadType type}}(message, 0, messageLen); + {{/if}} message += {{size}}; CHECK_MESSAGE_LENGTH({{size}}); {{/chip_attribute_list_entryTypes}} {{else}} + {{#if (isOctetString type)}} + data[i] = chip::ByteSpan(message, {{size}}); + {{else}} data[i] = emberAfGet{{asReadType type}}(message, 0, messageLen); + {{/if}} message += {{size}}; CHECK_MESSAGE_LENGTH({{size}}); {{/if}} diff --git a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt index 52de41c0548053..8bc8e0aed4a014 100644 --- a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt @@ -424,7 +424,7 @@ public: {{#chip_attribute_list_entryTypes}} {{#if (isString type)}} {{#if (isOctetString type)}} - [NSData dataWithBytes:entries[i].{{name}}+{{asReadTypeLength type}} length:emberAf{{asReadType type}}Length(entries[i].{{name}})], + [NSData dataWithBytes:entries[i].{{name}}.data() length:entries[i].{{name}}.size()], {{else}} [[NSString alloc] initWithBytes:entries[i].{{name}}+{{asReadTypeLength type}} length:emberAf{{asReadType type}}Length(entries[i].{{name}}) encoding:NSUTF8StringEncoding], {{/if}} @@ -435,8 +435,16 @@ public: {{/chip_attribute_list_entryTypes}} nil]; {{else}} + {{#if (isString type)}} + {{#if (isOctetString type)}} + values[i] = [NSData dataWithBytes:entries[i].data() length:entries[i].size()]; + {{else}} + values[i] = [[NSString alloc] initWithBytes:entries[i]+{{asReadTypeLength type}} length:emberAf{{asReadType type}}Length(entries[i]) encoding:NSUTF8StringEncoding]; + {{/if}} + {{else}} values[i] = [NSNumber numberWith{{asObjectiveCNumberType label type}}:entries[i]]; {{/if}} + {{/if}} } id array = [NSArray arrayWithObjects:values count:count]; diff --git a/src/app/zap-templates/templates/app/af-structs.zapt b/src/app/zap-templates/templates/app/af-structs.zapt index 04216491948374..b5d32dc5b20f81 100644 --- a/src/app/zap-templates/templates/app/af-structs.zapt +++ b/src/app/zap-templates/templates/app/af-structs.zapt @@ -5,6 +5,7 @@ #include #include +#include #include "enums.h" {{#zcl_structs}} diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 6d5d90c6902ca6..7a9a6e4bf67066 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -181,6 +181,8 @@ function asChipUnderlyingType(label, type) return 'chip::GroupId'; } else if (zclHelper.isStrEqual(label, "commandId")) { return 'chip::CommandId'; + } else if (type == 'OCTET_STRING') { + return 'chip::ByteSpan'; } else { const options = { 'hash' : {} }; return zclHelper.asUnderlyingZclType.call(this, type, options); diff --git a/src/controller/python/gen/CHIPClientCallbacks.cpp b/src/controller/python/gen/CHIPClientCallbacks.cpp index 029553fb5cbc71..70a488cb90df99 100644 --- a/src/controller/python/gen/CHIPClientCallbacks.cpp +++ b/src/controller/python/gen/CHIPClientCallbacks.cpp @@ -458,7 +458,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].GroupKeyIndex = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].GroupKeyRoot = emberAfGetString(message, 0, messageLen); + data[i].GroupKeyRoot = chip::ByteSpan(message, 16); message += 16; CHECK_MESSAGE_LENGTH(16); data[i].GroupKeyEpochStartTime = emberAfGetInt64u(message, 0, messageLen); @@ -490,7 +490,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = emberAfGetString(message, 0, messageLen); + data[i].Label = chip::ByteSpan(message, 32); message += 32; CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); diff --git a/src/controller/python/gen/CHIPClustersObjc.mm b/src/controller/python/gen/CHIPClustersObjc.mm index b9125119350285..b3cb96342b06a7 100644 --- a/src/controller/python/gen/CHIPClustersObjc.mm +++ b/src/controller/python/gen/CHIPClustersObjc.mm @@ -2621,10 +2621,9 @@ static void CallbackFn(void * context, uint16_t count, _GroupKey * entries) values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", [NSNumber numberWithUnsignedShort:entries[i].GroupKeyIndex], @"GroupKeyIndex", - [NSData dataWithBytes:entries[i].GroupKeyRoot + 1u length:emberAfStringLength(entries[i].GroupKeyRoot)], - @"GroupKeyRoot", [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], - @"GroupKeyEpochStartTime", [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], - @"GroupKeySecurityPolicy", nil]; + [NSData dataWithBytes:entries[i].GroupKeyRoot.data() length:entries[i].GroupKeyRoot.size()], @"GroupKeyRoot", + [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], @"GroupKeyEpochStartTime", + [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], @"GroupKeySecurityPolicy", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -2663,8 +2662,8 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label + 1u length:emberAfStringLength(entries[i].Label)], - @"Label", [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; diff --git a/src/controller/python/gen/af-structs.h b/src/controller/python/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/src/controller/python/gen/af-structs.h +++ b/src/controller/python/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp index 005ec626c44adf..3e531c9fa498fc 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp +++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp @@ -458,7 +458,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].GroupKeyIndex = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].GroupKeyRoot = emberAfGetString(message, 0, messageLen); + data[i].GroupKeyRoot = chip::ByteSpan(message, 16); message += 16; CHECK_MESSAGE_LENGTH(16); data[i].GroupKeyEpochStartTime = emberAfGetInt64u(message, 0, messageLen); @@ -490,7 +490,7 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = emberAfGetString(message, 0, messageLen); + data[i].Label = chip::ByteSpan(message, 32); message += 32; CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 29e4339c74cd60..7506e21b230198 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -2044,10 +2044,9 @@ static void CallbackFn(void * context, uint16_t count, _GroupKey * entries) values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", [NSNumber numberWithUnsignedShort:entries[i].GroupKeyIndex], @"GroupKeyIndex", - [NSData dataWithBytes:entries[i].GroupKeyRoot + 1u length:emberAfStringLength(entries[i].GroupKeyRoot)], - @"GroupKeyRoot", [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], - @"GroupKeyEpochStartTime", [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], - @"GroupKeySecurityPolicy", nil]; + [NSData dataWithBytes:entries[i].GroupKeyRoot.data() length:entries[i].GroupKeyRoot.size()], @"GroupKeyRoot", + [NSNumber numberWithUnsignedLongLong:entries[i].GroupKeyEpochStartTime], @"GroupKeyEpochStartTime", + [NSNumber numberWithUnsignedChar:entries[i].GroupKeySecurityPolicy], @"GroupKeySecurityPolicy", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -2086,8 +2085,8 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label + 1u length:emberAfStringLength(entries[i].Label)], - @"Label", [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; diff --git a/src/darwin/Framework/CHIP/gen/af-structs.h b/src/darwin/Framework/CHIP/gen/af-structs.h index 16a5ef656d51ef..dcb11498a758e3 100644 --- a/src/darwin/Framework/CHIP/gen/af-structs.h +++ b/src/darwin/Framework/CHIP/gen/af-structs.h @@ -23,6 +23,7 @@ #include "enums.h" #include #include +#include // Struct for ApplicationLauncherApp typedef struct _ApplicationLauncherApp @@ -201,7 +202,7 @@ typedef struct _EventLogPayload uint8_t logId; uint16_t eventId; uint32_t eventTime; - uint8_t * eventData; + chip::ByteSpan eventData; } EmberAfEventLogPayload; // Struct for ExtendedDiscoverAttributesInfoRecord @@ -217,7 +218,7 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - uint8_t * Label; + chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; @@ -237,8 +238,8 @@ typedef struct _GpTranslationTableUpdateTranslation uint16_t profile; uint16_t cluster; uint8_t zigbeeCommandId; - uint8_t * zigbeeCommandPayload; - uint8_t * additionalInfoBlock; + chip::ByteSpan zigbeeCommandPayload; + chip::ByteSpan additionalInfoBlock; } EmberAfGpTranslationTableUpdateTranslation; // Struct for GroupInformationRecord @@ -253,7 +254,7 @@ typedef struct _GroupKey { uint16_t VendorId; uint16_t GroupKeyIndex; - uint8_t * GroupKeyRoot; + chip::ByteSpan GroupKeyRoot; uint64_t GroupKeyEpochStartTime; uint8_t GroupKeySecurityPolicy; } EmberAfGroupKey; @@ -487,20 +488,20 @@ typedef struct _SpecialDay // Struct for ThreadInterfaceScanResult typedef struct _ThreadInterfaceScanResult { - uint8_t * DiscoveryResponse; + chip::ByteSpan DiscoveryResponse; } EmberAfThreadInterfaceScanResult; // Struct for TierLabelsPayload typedef struct _TierLabelsPayload { uint8_t tierId; - uint8_t * tierLabel; + chip::ByteSpan tierLabel; } EmberAfTierLabelsPayload; // Struct for TopUpPayload typedef struct _TopUpPayload { - uint8_t * topUpCode; + chip::ByteSpan topUpCode; int32_t topUpAmount; uint32_t topUpTime; } EmberAfTopUpPayload; @@ -539,8 +540,8 @@ typedef struct _TvChannelLineupInfo typedef struct _WiFiInterfaceScanResult { uint8_t Security; - uint8_t * SSID; - uint8_t * BSSID; + chip::ByteSpan SSID; + chip::ByteSpan BSSID; uint8_t Channel; uint32_t FrequencyBand; } EmberAfWiFiInterfaceScanResult; From 68d442e96d36c25dd855fcebebd1f193d6cef1c1 Mon Sep 17 00:00:00 2001 From: Song Guo Date: Tue, 4 May 2021 08:49:05 +0800 Subject: [PATCH 12/31] [cirque] Fix thread network setup code (#6156) --- .../linux-cirque/helper/CHIPTestBase.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/test_driver/linux-cirque/helper/CHIPTestBase.py b/src/test_driver/linux-cirque/helper/CHIPTestBase.py index 912b0eeccba043..23544cd36088d7 100644 --- a/src/test_driver/linux-cirque/helper/CHIPTestBase.py +++ b/src/test_driver/linux-cirque/helper/CHIPTestBase.py @@ -129,9 +129,16 @@ def sequenceMatch(self, string, patterns): return True def connect_to_thread_network(self): - self.logger.info("Running commands to form Thread network") + ''' + The dataset in this function is used to replace the default dataset generated by openthread. + When the test writer is calling this function to setup a thread network, it means they just + want a working IPv6 network or a working thread network and don't care about the detail of + this network. + ''' + self.logger.info("Running commands to form default Thread network") for device in self.non_ap_devices: self.wait_for_device_output(device['id'], "Border router agent started.", 5) + otInitCommands = [ "ot-ctl thread stop", "ot-ctl ifconfig down", @@ -147,13 +154,13 @@ def connect_to_thread_network(self): self.logger.info("Waiting for Thread network to be formed...") threadNetworkFormed = False for i in range(30): - roles = set() + roles = list() for device in self.non_ap_devices: # We can only check the status of ot-agent by query its state. reply = self.execute_device_cmd(device['id'], 'ot-ctl state') - roles.add(reply['output'].split()[0]) - if ('leader' in roles) and ('router' in roles or 'child' in roles): - threadNetworkFormed = True + roles.append(reply['output'].split()[0]) + threadNetworkFormed = (roles.count('leader') == 1) and (roles.count('leader') + roles.count('router') + roles.count('child') == len(self.non_ap_devices)) + if threadNetworkFormed: break time.sleep(1) self.assertTrue(threadNetworkFormed) From 17be4afe670126e94282bcf14a57aa3984e36cf4 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Mon, 3 May 2021 21:46:33 -0700 Subject: [PATCH 13/31] Implement general commissioning cluster callbacks (#6361) * Implement general commisioning callbacks * Address review comments * Return CHIP_ERROR_NOT_IMPLEMENTED for unimplemented functions * Use static memeber function instead of friend member function --- .../general-commissioning-server.cpp | 19 ++-- src/include/platform/ConfigurationManager.h | 36 +++++++ .../platform/internal/DeviceControlServer.h | 60 ++++++++++++ .../internal/DeviceDescriptionServer.h | 94 ------------------- .../GenericConfigurationManagerImpl.cpp | 36 +++++++ .../GenericConfigurationManagerImpl.h | 6 ++ src/platform/BUILD.gn | 3 +- src/platform/Darwin/PosixConfig.cpp | 3 + src/platform/Darwin/PosixConfig.h | 3 + src/platform/DeviceControlServer.cpp | 80 ++++++++++++++++ src/platform/EFR32/EFR32Config.h | 9 +- src/platform/ESP32/ESP32Config.cpp | 3 + src/platform/ESP32/ESP32Config.h | 3 + src/platform/K32W/K32WConfig.h | 42 +++++---- src/platform/Linux/PosixConfig.cpp | 3 + src/platform/Linux/PosixConfig.h | 3 + src/platform/Zephyr/ZephyrConfig.cpp | 9 +- src/platform/Zephyr/ZephyrConfig.h | 3 + .../cc13x2_26x2/CC13X2_26X2Config.cpp | 4 + src/platform/cc13x2_26x2/CC13X2_26X2Config.h | 3 + src/platform/qpg6100/qpg6100Config.h | 7 +- src/platform/tests/TestConfigurationMgr.cpp | 49 ++++++++++ 22 files changed, 351 insertions(+), 127 deletions(-) create mode 100644 src/include/platform/internal/DeviceControlServer.h delete mode 100644 src/include/platform/internal/DeviceDescriptionServer.h create mode 100644 src/platform/DeviceControlServer.cpp diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp index 0f8edcf5760eab..9b70101f512640 100644 --- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp +++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp @@ -24,28 +24,35 @@ #include #include #include +#include +#include using namespace chip; bool emberAfGeneralCommissioningClusterArmFailSafeCallback(chip::app::Command * commandObj, uint16_t expiryLengthSeconds, uint64_t breadcrumb, uint32_t timeoutMs) { - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); + CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().ArmFailSafe(expiryLengthSeconds); + emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + return true; } bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(chip::app::Command * commandObj) { - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); + CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().CommissioningComplete(); + emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + return true; } bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::app::Command * commandObj, uint8_t location, uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs) { - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); + CHIP_ERROR err = DeviceLayer::Internal::DeviceControlServer::DeviceControlSvr().SetRegulatoryConfig( + location, reinterpret_cast(countryCode), breadcrumb); + + emberAfSendImmediateDefaultResponse(err == CHIP_NO_ERROR ? EMBER_ZCL_STATUS_SUCCESS : EMBER_ZCL_STATUS_FAILURE); + return true; } diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index b72529e605ffd6..3aceb5c8f2d3b0 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -93,6 +93,9 @@ class ConfigurationManager // Lifetime counter is monotonic counter that is incremented only in the case of a factory reset CHIP_ERROR GetLifetimeCounter(uint16_t & lifetimeCounter); #endif + CHIP_ERROR GetRegulatoryLocation(uint32_t & location); + CHIP_ERROR GetCountryCode(char * buf, size_t bufSize, size_t & codeLen); + CHIP_ERROR GetBreadcrumb(uint64_t & breadcrumb); CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen); CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf); CHIP_ERROR StorePrimary802154MACAddress(const uint8_t * buf); @@ -116,6 +119,9 @@ class ConfigurationManager CHIP_ERROR ClearServiceProvisioningData(); CHIP_ERROR StoreServiceConfig(const uint8_t * serviceConfig, size_t serviceConfigLen); CHIP_ERROR StorePairedAccountId(const char * accountId, size_t accountIdLen); + CHIP_ERROR StoreRegulatoryLocation(uint32_t location); + CHIP_ERROR StoreCountryCode(const char * code, size_t codeLen); + CHIP_ERROR StoreBreadcrumb(uint64_t breadcrumb); CHIP_ERROR GetQRCodeString(char * buf, size_t bufSize); @@ -371,6 +377,21 @@ inline CHIP_ERROR ConfigurationManager::GetLifetimeCounter(uint16_t & lifetimeCo } #endif +inline CHIP_ERROR ConfigurationManager::GetRegulatoryLocation(uint32_t & location) +{ + return static_cast(this)->_GetRegulatoryLocation(location); +} + +inline CHIP_ERROR ConfigurationManager::GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) +{ + return static_cast(this)->_GetCountryCode(buf, bufSize, codeLen); +} + +inline CHIP_ERROR ConfigurationManager::GetBreadcrumb(uint64_t & breadcrumb) +{ + return static_cast(this)->_GetBreadcrumb(breadcrumb); +} + inline CHIP_ERROR ConfigurationManager::StoreSerialNumber(const char * serialNum, size_t serialNumLen) { return static_cast(this)->_StoreSerialNumber(serialNum, serialNumLen); @@ -463,6 +484,21 @@ inline CHIP_ERROR ConfigurationManager::StoreServiceProvisioningData(uint64_t se accountIdLen); } +inline CHIP_ERROR ConfigurationManager::StoreRegulatoryLocation(uint32_t location) +{ + return static_cast(this)->_StoreRegulatoryLocation(location); +} + +inline CHIP_ERROR ConfigurationManager::StoreCountryCode(const char * code, size_t codeLen) +{ + return static_cast(this)->_StoreCountryCode(code, codeLen); +} + +inline CHIP_ERROR ConfigurationManager::StoreBreadcrumb(uint64_t breadcrumb) +{ + return static_cast(this)->_StoreBreadcrumb(breadcrumb); +} + inline CHIP_ERROR ConfigurationManager::ClearServiceProvisioningData() { return static_cast(this)->_ClearServiceProvisioningData(); diff --git a/src/include/platform/internal/DeviceControlServer.h b/src/include/platform/internal/DeviceControlServer.h new file mode 100644 index 00000000000000..6e62eb345275eb --- /dev/null +++ b/src/include/platform/internal/DeviceControlServer.h @@ -0,0 +1,60 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/** + * @file + * Defines the Device Layer DeviceControlServer object. + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +class DeviceControlServer final +{ +public: + // ===== Members for internal use by other Device Layer components. + + CHIP_ERROR ArmFailSafe(uint16_t expiryLengthSeconds); + CHIP_ERROR DisarmFailSafe(); + CHIP_ERROR CommissioningComplete(); + CHIP_ERROR SetRegulatoryConfig(uint8_t location, const char * countryCode, uint64_t breadcrumb); + + static DeviceControlServer & DeviceControlSvr(); + +private: + // ===== Members for internal use by the following friends. + static DeviceControlServer sInstance; + + // ===== Private members reserved for use by this class only. + + DeviceControlServer() = default; + ~DeviceControlServer() = default; + + // No copy, move or assignment. + DeviceControlServer(const DeviceControlServer &) = delete; + DeviceControlServer(const DeviceControlServer &&) = delete; + DeviceControlServer & operator=(const DeviceControlServer &) = delete; +}; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/include/platform/internal/DeviceDescriptionServer.h b/src/include/platform/internal/DeviceDescriptionServer.h deleted file mode 100644 index aa2ea8b023940d..00000000000000 --- a/src/include/platform/internal/DeviceDescriptionServer.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2018 Nest Labs, Inc. - * - * 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. - */ - -/** - * @file - * Defines the Device Layer DeviceDescriptionServer object. - */ - -#pragma once - -#include -#include - -namespace chip { -namespace DeviceLayer { -namespace Internal { - -/** - * Implements the chip Device Description profile for a chip device. - */ -class DeviceDescriptionServer final : public ::chip::Profiles::DeviceDescription::DeviceDescriptionServer -{ - typedef ::chip::Profiles::DeviceDescription::DeviceDescriptionServer ServerBaseClass; - -public: - // ===== Members for internal use by other Device Layer components. - - CHIP_ERROR Init(); - - bool IsUserSelectedModeActive(void); - void SetUserSelectedMode(bool val); - uint16_t GetUserSelectedModeTimeout(void); - void SetUserSelectedModeTimeout(uint16_t val); - - void OnPlatformEvent(const ChipDeviceEvent * event); - -private: - // ===== Members for internal use by the following friends. - - friend DeviceDescriptionServer & DeviceDescriptionSvr(void); - - static DeviceDescriptionServer sInstance; - - // ===== Private members reserved for use by this class only. - - enum - { - kUserSelectedModeTimeShift = 10 - }; - - uint32_t mUserSelectedModeEndTime; // Monotonic system time scaled to units of 1024ms. - uint16_t mUserSelectedModeTimeoutSec; - - static void HandleIdentifyRequest(void * appState, uint64_t nodeId, const IPAddress & nodeAddr, - const ::chip::Profiles::DeviceDescription::IdentifyRequestMessage & reqMsg, bool & sendResp, - ::chip::Profiles::DeviceDescription::IdentifyResponseMessage & respMsg); - -protected: - // Construction/destruction limited to subclasses. - DeviceDescriptionServer() = default; - ~DeviceDescriptionServer() = default; - - // No copy, move or assignment. - DeviceDescriptionServer(const DeviceDescriptionServer &) = delete; - DeviceDescriptionServer(const DeviceDescriptionServer &&) = delete; - DeviceDescriptionServer & operator=(const DeviceDescriptionServer &) = delete; -}; - -/** - * Returns a reference to the DeviceDescriptionServer singleton object. - */ -inline DeviceDescriptionServer & DeviceDescriptionSvr(void) -{ - return DeviceDescriptionServer::sInstance; -} - -} // namespace Internal -} // namespace DeviceLayer -} // namespace chip diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp index 9da803cf92fdf5..7d862abe76f800 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp @@ -657,6 +657,42 @@ CHIP_ERROR GenericConfigurationManagerImpl::_StoreFabricId(uint64_t f return err; } +template +CHIP_ERROR GenericConfigurationManagerImpl::_GetRegulatoryLocation(uint32_t & location) +{ + return Impl()->ReadConfigValue(ImplClass::kConfigKey_RegulatoryLocation, location); +} + +template +CHIP_ERROR GenericConfigurationManagerImpl::_StoreRegulatoryLocation(uint32_t location) +{ + return Impl()->WriteConfigValue(ImplClass::kConfigKey_RegulatoryLocation, location); +} + +template +CHIP_ERROR GenericConfigurationManagerImpl::_GetCountryCode(char * buf, size_t bufSize, size_t & codeLen) +{ + return Impl()->ReadConfigValueStr(ImplClass::kConfigKey_CountryCode, buf, bufSize, codeLen); +} + +template +CHIP_ERROR GenericConfigurationManagerImpl::_StoreCountryCode(const char * code, size_t codeLen) +{ + return Impl()->WriteConfigValueStr(ImplClass::kConfigKey_CountryCode, code, codeLen); +} + +template +CHIP_ERROR GenericConfigurationManagerImpl::_GetBreadcrumb(uint64_t & breadcrumb) +{ + return Impl()->ReadConfigValue(ImplClass::kConfigKey_Breadcrumb, breadcrumb); +} + +template +CHIP_ERROR GenericConfigurationManagerImpl::_StoreBreadcrumb(uint64_t breadcrumb) +{ + return Impl()->WriteConfigValue(ImplClass::kConfigKey_Breadcrumb, breadcrumb); +} + template CHIP_ERROR GenericConfigurationManagerImpl::_GetServiceId(uint64_t & serviceId) { diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index d2345e0ee052b4..a2a5c99228e4f4 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -116,6 +116,12 @@ class GenericConfigurationManagerImpl CHIP_ERROR _GetQRCodeString(char * buf, size_t bufSize); CHIP_ERROR _GetWiFiAPSSID(char * buf, size_t bufSize); CHIP_ERROR _GetBLEDeviceIdentificationInfo(Ble::ChipBLEDeviceIdentificationInfo & deviceIdInfo); + CHIP_ERROR _GetRegulatoryLocation(uint32_t & location); + CHIP_ERROR _StoreRegulatoryLocation(uint32_t location); + CHIP_ERROR _GetCountryCode(char * buf, size_t bufSize, size_t & codeLen); + CHIP_ERROR _StoreCountryCode(const char * code, size_t codeLen); + CHIP_ERROR _GetBreadcrumb(uint64_t & breadcrumb); + CHIP_ERROR _StoreBreadcrumb(uint64_t breadcrumb); CHIP_ERROR _ConfigureChipStack(); #if !defined(NDEBUG) CHIP_ERROR _RunUnitTests(void); diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 26c5adfac43584..e7dbc96a442072 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -204,7 +204,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "../include/platform/TimeSyncManager.h", "../include/platform/internal/BLEManager.h", "../include/platform/internal/CHIPDeviceLayerInternal.h", - "../include/platform/internal/DeviceDescriptionServer.h", + "../include/platform/internal/DeviceControlServer.h", "../include/platform/internal/DeviceNetworkInfo.h", "../include/platform/internal/DeviceNetworkProvisioning.h", "../include/platform/internal/EventLogging.h", @@ -222,6 +222,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "../include/platform/internal/GenericSoftwareUpdateManagerImpl.h", "../include/platform/internal/GenericSoftwareUpdateManagerImpl_BDX.h", "../include/platform/internal/testing/ConfigUnitTest.h", + "DeviceControlServer.cpp", "GeneralUtils.cpp", "Globals.cpp", "PersistedStorage.cpp", diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 4c08ba95323b90..e5becd390a0453 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -67,6 +67,9 @@ const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceId = { k const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceCert = { kConfigNamespace_ChipConfig, "op-device-cert" }; const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceICACerts = { kConfigNamespace_ChipConfig, "op-device-ca-certs" }; const PosixConfig::Key PosixConfig::kConfigKey_OperationalDevicePrivateKey = { kConfigNamespace_ChipConfig, "op-device-key" }; +const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; +const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; +const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Prefix used for NVS keys that contain Chip group encryption keys. const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index e1af67c2222abe..6a77b69351adf5 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -74,6 +74,9 @@ class PosixConfig static const Key kConfigKey_OperationalDeviceICACerts; static const Key kConfigKey_OperationalDevicePrivateKey; static const Key kConfigKey_SetupDiscriminator; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_Breadcrumb; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/DeviceControlServer.cpp b/src/platform/DeviceControlServer.cpp new file mode 100644 index 00000000000000..8a26d9d754e47c --- /dev/null +++ b/src/platform/DeviceControlServer.cpp @@ -0,0 +1,80 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/** + * @file + * Provides the implementation of the DeviceControlServer object. + */ + +#include + +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +DeviceControlServer DeviceControlServer::sInstance; + +DeviceControlServer & DeviceControlServer::DeviceControlSvr() +{ + return sInstance; +} + +CHIP_ERROR DeviceControlServer::ArmFailSafe(uint16_t expiryLengthSeconds) +{ + // TODO + return CHIP_ERROR_NOT_IMPLEMENTED; +} + +CHIP_ERROR DeviceControlServer::DisarmFailSafe() +{ + // TODO + return CHIP_ERROR_NOT_IMPLEMENTED; +} + +CHIP_ERROR DeviceControlServer::CommissioningComplete() +{ + // TODO + return CHIP_ERROR_NOT_IMPLEMENTED; +} + +CHIP_ERROR DeviceControlServer::SetRegulatoryConfig(uint8_t location, const char * countryCode, uint64_t breadcrumb) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + err = ConfigurationMgr().StoreRegulatoryLocation(location); + SuccessOrExit(err); + + err = ConfigurationMgr().StoreCountryCode(countryCode, strlen(countryCode)); + SuccessOrExit(err); + + err = ConfigurationMgr().StoreBreadcrumb(breadcrumb); + SuccessOrExit(err); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "SetRegulatoryConfig failed with error: %s", ErrorStr(err)); + } + + return err; +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index 1fb39300edde0a..d813e8a2d1ec8f 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -95,15 +95,18 @@ class EFR32Config static constexpr Key kConfigKey_OperationalDeviceCert = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_OperationalDeviceICACerts = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); static constexpr Key kConfigKey_OperationalDevicePrivateKey = EFR32ConfigKey(kChipConfig_KeyBase, 0x0C); + static constexpr Key kConfigKey_RegulatoryLocation = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); + static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0E); + static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0F); - static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x0D); - static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1C); // Allows 16 Group Keys to be created. + static constexpr Key kConfigKey_GroupKeyBase = EFR32ConfigKey(kChipConfig_KeyBase, 0x10); + static constexpr Key kConfigKey_GroupKeyMax = EFR32ConfigKey(kChipConfig_KeyBase, 0x1F); // Allows 16 Group Keys to be created. // Set key id limits for each group. static constexpr Key kMinConfigKey_ChipFactory = EFR32ConfigKey(kChipFactory_KeyBase, 0x00); static constexpr Key kMaxConfigKey_ChipFactory = EFR32ConfigKey(kChipFactory_KeyBase, 0x07); static constexpr Key kMinConfigKey_ChipConfig = EFR32ConfigKey(kChipConfig_KeyBase, 0x00); - static constexpr Key kMaxConfigKey_ChipConfig = EFR32ConfigKey(kChipConfig_KeyBase, 0x1C); + static constexpr Key kMaxConfigKey_ChipConfig = EFR32ConfigKey(kChipConfig_KeyBase, 0x1F); static constexpr Key kMinConfigKey_ChipCounter = EFR32ConfigKey(kChipCounter_KeyBase, 0x00); static constexpr Key kMaxConfigKey_ChipCounter = EFR32ConfigKey(kChipCounter_KeyBase, 0x1F); // Allows 32 Counters to be created. diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 1063d56fd9edce..20019b6d2b2c66 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -72,6 +72,9 @@ const ESP32Config::Key ESP32Config::kConfigKey_OperationalDeviceId = { k const ESP32Config::Key ESP32Config::kConfigKey_OperationalDeviceCert = { kConfigNamespace_ChipConfig, "op-device-cert" }; const ESP32Config::Key ESP32Config::kConfigKey_OperationalDeviceICACerts = { kConfigNamespace_ChipConfig, "op-device-ca-certs" }; const ESP32Config::Key ESP32Config::kConfigKey_OperationalDevicePrivateKey = { kConfigNamespace_ChipConfig, "op-device-key" }; +const ESP32Config::Key ESP32Config::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; +const ESP32Config::Key ESP32Config::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; +const ESP32Config::Key ESP32Config::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Prefix used for NVS keys that contain Chip group encryption keys. const char ESP32Config::kGroupKeyNamePrefix[] = "gk-"; diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index 46fdb877376a4a..39bd6b97534983 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -75,6 +75,9 @@ class ESP32Config static const Key kConfigKey_OperationalDeviceICACerts; static const Key kConfigKey_OperationalDevicePrivateKey; static const Key kConfigKey_SetupDiscriminator; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_Breadcrumb; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/K32W/K32WConfig.h b/src/platform/K32W/K32WConfig.h index b93f987c2ade64..72338d9db3076d 100644 --- a/src/platform/K32W/K32WConfig.h +++ b/src/platform/K32W/K32WConfig.h @@ -88,33 +88,37 @@ class K32WConfig static constexpr Key kConfigKey_OperationalDeviceICACerts = K32WConfigKey(kPDMId_ChipConfig, 0x09); static constexpr Key kConfigKey_OperationalDevicePrivateKey = K32WConfigKey(kPDMId_ChipConfig, 0x0A); - static constexpr Key kConfigKey_GroupKey = K32WConfigKey(kPDMId_ChipConfig, 0x0B); - static constexpr Key kConfigKey_GroupKey0 = K32WConfigKey(kPDMId_ChipConfig, 0x0C); - static constexpr Key kConfigKey_GroupKey1 = K32WConfigKey(kPDMId_ChipConfig, 0x0D); - static constexpr Key kConfigKey_GroupKey2 = K32WConfigKey(kPDMId_ChipConfig, 0x0E); - static constexpr Key kConfigKey_GroupKey3 = K32WConfigKey(kPDMId_ChipConfig, 0x0F); - static constexpr Key kConfigKey_GroupKey4 = K32WConfigKey(kPDMId_ChipConfig, 0x10); - static constexpr Key kConfigKey_GroupKey5 = K32WConfigKey(kPDMId_ChipConfig, 0x11); - static constexpr Key kConfigKey_GroupKey6 = K32WConfigKey(kPDMId_ChipConfig, 0x12); - static constexpr Key kConfigKey_GroupKey7 = K32WConfigKey(kPDMId_ChipConfig, 0x13); - static constexpr Key kConfigKey_GroupKey8 = K32WConfigKey(kPDMId_ChipConfig, 0x14); - static constexpr Key kConfigKey_GroupKey9 = K32WConfigKey(kPDMId_ChipConfig, 0x15); - static constexpr Key kConfigKey_GroupKey10 = K32WConfigKey(kPDMId_ChipConfig, 0x16); - static constexpr Key kConfigKey_GroupKey11 = K32WConfigKey(kPDMId_ChipConfig, 0x17); - static constexpr Key kConfigKey_GroupKey12 = K32WConfigKey(kPDMId_ChipConfig, 0x18); - static constexpr Key kConfigKey_GroupKey13 = K32WConfigKey(kPDMId_ChipConfig, 0x19); - static constexpr Key kConfigKey_GroupKey14 = K32WConfigKey(kPDMId_ChipConfig, 0x1A); - static constexpr Key kConfigKey_GroupKey15 = K32WConfigKey(kPDMId_ChipConfig, 0x1B); + static constexpr Key kConfigKey_RegulatoryLocation = K32WConfigKey(kPDMId_ChipConfig, 0x0B); + static constexpr Key kConfigKey_CountryCode = K32WConfigKey(kPDMId_ChipConfig, 0x0C); + static constexpr Key kConfigKey_Breadcrumb = K32WConfigKey(kPDMId_ChipConfig, 0x0D); + + static constexpr Key kConfigKey_GroupKey = K32WConfigKey(kPDMId_ChipConfig, 0x0E); + static constexpr Key kConfigKey_GroupKey0 = K32WConfigKey(kPDMId_ChipConfig, 0x0F); + static constexpr Key kConfigKey_GroupKey1 = K32WConfigKey(kPDMId_ChipConfig, 0x10); + static constexpr Key kConfigKey_GroupKey2 = K32WConfigKey(kPDMId_ChipConfig, 0x11); + static constexpr Key kConfigKey_GroupKey3 = K32WConfigKey(kPDMId_ChipConfig, 0x12); + static constexpr Key kConfigKey_GroupKey4 = K32WConfigKey(kPDMId_ChipConfig, 0x13); + static constexpr Key kConfigKey_GroupKey5 = K32WConfigKey(kPDMId_ChipConfig, 0x14); + static constexpr Key kConfigKey_GroupKey6 = K32WConfigKey(kPDMId_ChipConfig, 0x15); + static constexpr Key kConfigKey_GroupKey7 = K32WConfigKey(kPDMId_ChipConfig, 0x16); + static constexpr Key kConfigKey_GroupKey8 = K32WConfigKey(kPDMId_ChipConfig, 0x17); + static constexpr Key kConfigKey_GroupKey9 = K32WConfigKey(kPDMId_ChipConfig, 0x18); + static constexpr Key kConfigKey_GroupKey10 = K32WConfigKey(kPDMId_ChipConfig, 0x19); + static constexpr Key kConfigKey_GroupKey11 = K32WConfigKey(kPDMId_ChipConfig, 0x1A); + static constexpr Key kConfigKey_GroupKey12 = K32WConfigKey(kPDMId_ChipConfig, 0x1B); + static constexpr Key kConfigKey_GroupKey13 = K32WConfigKey(kPDMId_ChipConfig, 0x1C); + static constexpr Key kConfigKey_GroupKey14 = K32WConfigKey(kPDMId_ChipConfig, 0x1D); + static constexpr Key kConfigKey_GroupKey15 = K32WConfigKey(kPDMId_ChipConfig, 0x1E); static constexpr Key kConfigKey_GroupKeyBase = kConfigKey_GroupKey0; - static constexpr Key kConfigKey_GroupKeyMax = K32WConfigKey(kPDMId_ChipConfig, 0x1B); + static constexpr Key kConfigKey_GroupKeyMax = K32WConfigKey(kPDMId_ChipConfig, 0x1E); ; // Allows 16 Group Keys to be created. // Set key id limits for each group. static constexpr Key kMinConfigKey_ChipFactory = K32WConfigKey(kPDMId_ChipFactory, 0x00); static constexpr Key kMaxConfigKey_ChipFactory = K32WConfigKey(kPDMId_ChipFactory, 0x08); static constexpr Key kMinConfigKey_ChipConfig = K32WConfigKey(kPDMId_ChipConfig, 0x00); - static constexpr Key kMaxConfigKey_ChipConfig = K32WConfigKey(kPDMId_ChipConfig, 0x1A); + static constexpr Key kMaxConfigKey_ChipConfig = K32WConfigKey(kPDMId_ChipConfig, 0x1E); static constexpr Key kMinConfigKey_ChipCounter = K32WConfigKey(kPDMId_ChipCounter, 0x00); static constexpr Key kMaxConfigKey_ChipCounter = K32WConfigKey(kPDMId_ChipCounter, 0x1F); // Allows 32 Counters to be created. diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index ebe9eb1eabd907..e5771074d39ca8 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -72,6 +72,9 @@ const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceId = { k const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceCert = { kConfigNamespace_ChipConfig, "op-device-cert" }; const PosixConfig::Key PosixConfig::kConfigKey_OperationalDeviceICACerts = { kConfigNamespace_ChipConfig, "op-device-ca-certs" }; const PosixConfig::Key PosixConfig::kConfigKey_OperationalDevicePrivateKey = { kConfigNamespace_ChipConfig, "op-device-key" }; +const PosixConfig::Key PosixConfig::kConfigKey_RegulatoryLocation = { kConfigNamespace_ChipConfig, "regulatory-location" }; +const PosixConfig::Key PosixConfig::kConfigKey_CountryCode = { kConfigNamespace_ChipConfig, "country-code" }; +const PosixConfig::Key PosixConfig::kConfigKey_Breadcrumb = { kConfigNamespace_ChipConfig, "breadcrumb" }; // Prefix used for NVS keys that contain Chip group encryption keys. const char PosixConfig::kGroupKeyNamePrefix[] = "gk-"; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index bac6963d790f73..ce597ba346e0af 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -76,6 +76,9 @@ class PosixConfig static const Key kConfigKey_OperationalDeviceICACerts; static const Key kConfigKey_OperationalDevicePrivateKey; static const Key kConfigKey_SetupDiscriminator; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_Breadcrumb; static const char kGroupKeyNamePrefix[]; diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index 6ac82ba05176c3..2f8781a4357b60 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -72,7 +72,9 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_OperationalDeviceId = C const ZephyrConfig::Key ZephyrConfig::kConfigKey_OperationalDeviceCert = CONFIG_KEY(NAMESPACE_CONFIG "op-device-cert"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_OperationalDeviceICACerts = CONFIG_KEY(NAMESPACE_CONFIG "op-device-ca-certs"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_OperationalDevicePrivateKey = CONFIG_KEY(NAMESPACE_CONFIG "op-device-key"); - +const ZephyrConfig::Key ZephyrConfig::kConfigKey_RegulatoryLocation = CONFIG_KEY(NAMESPACE_CONFIG "regulatory-location"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_CountryCode = CONFIG_KEY(NAMESPACE_CONFIG "country-code"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_Breadcrumb = CONFIG_KEY(NAMESPACE_CONFIG "breadcrumb"); namespace { constexpr const char * sAllResettableConfigKeys[] = { ZephyrConfig::kConfigKey_FabricId, @@ -86,7 +88,10 @@ constexpr const char * sAllResettableConfigKeys[] = { ZephyrConfig::kConfigKey_F ZephyrConfig::kConfigKey_OperationalDeviceId, ZephyrConfig::kConfigKey_OperationalDeviceCert, ZephyrConfig::kConfigKey_OperationalDeviceICACerts, - ZephyrConfig::kConfigKey_OperationalDevicePrivateKey }; + ZephyrConfig::kConfigKey_OperationalDevicePrivateKey, + ZephyrConfig::kConfigKey_RegulatoryLocation, + ZephyrConfig::kConfigKey_CountryCode, + ZephyrConfig::kConfigKey_Breadcrumb }; // Data structure to be passed as a parameter of Zephyr's settings_load_subtree_direct() function struct ReadRequest diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index f50cf394b052a1..e804af050f7ca5 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -64,6 +64,9 @@ class ZephyrConfig static const Key kConfigKey_OperationalDeviceCert; static const Key kConfigKey_OperationalDeviceICACerts; static const Key kConfigKey_OperationalDevicePrivateKey; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_Breadcrumb; static CHIP_ERROR Init(void); diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index f228677bef87a0..644a89b0251612 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -68,6 +68,10 @@ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_OperationalDeviceICAC const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_OperationalDevicePrivateKey = { { kCC13X2_26X2ChipFactory_Sysid, 0x001d } }; +const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_RegulatoryLocation = { { kCC13X2_26X2ChipFactory_Sysid, 0x001e } }; +const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_CountryCode = { { kCC13X2_26X2ChipFactory_Sysid, 0x001f } }; +const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_Breadcrumb = { { kCC13X2_26X2ChipFactory_Sysid, 0x0020 } }; + /* Static local variables */ static NVINTF_nvFuncts_t sNvoctpFps = { 0 }; diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h index 78387921221c07..12ef94c62fe431 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h @@ -67,6 +67,9 @@ class CC13X2_26X2Config static const Key kConfigKey_OperationalDeviceCert; static const Key kConfigKey_OperationalDeviceICACerts; static const Key kConfigKey_OperationalDevicePrivateKey; + static const Key kConfigKey_RegulatoryLocation; + static const Key kConfigKey_CountryCode; + static const Key kConfigKey_Breadcrumb; static CHIP_ERROR Init(void); diff --git a/src/platform/qpg6100/qpg6100Config.h b/src/platform/qpg6100/qpg6100Config.h index bcc5b051a7bfd8..328378c547d78e 100644 --- a/src/platform/qpg6100/qpg6100Config.h +++ b/src/platform/qpg6100/qpg6100Config.h @@ -86,9 +86,12 @@ class QPG6100Config static constexpr Key kConfigKey_OperationalDeviceCert = QorvoConfigKey(kFileId_ChipConfig, 0x0A); static constexpr Key kConfigKey_OperationalDeviceICACerts = QorvoConfigKey(kFileId_ChipConfig, 0x0B); static constexpr Key kConfigKey_OperationalDevicePrivateKey = QorvoConfigKey(kFileId_ChipConfig, 0x0C); + static constexpr Key kConfigKey_RegulatoryLocation = QorvoConfigKey(kFileId_ChipConfig, 0x0D); + static constexpr Key kConfigKey_CountryCode = QorvoConfigKey(kFileId_ChipConfig, 0x0E); + static constexpr Key kConfigKey_Breadcrumb = QorvoConfigKey(kFileId_ChipConfig, 0x0F); - static constexpr Key kConfigKey_GroupKeyBase = QorvoConfigKey(kFileId_ChipConfig, 0x0D); - static constexpr Key kConfigKey_GroupKeyMax = QorvoConfigKey(kFileId_ChipConfig, 0x1C); // Allows 16 Group Keys to be created. + static constexpr Key kConfigKey_GroupKeyBase = QorvoConfigKey(kFileId_ChipConfig, 0x10); + static constexpr Key kConfigKey_GroupKeyMax = QorvoConfigKey(kFileId_ChipConfig, 0x1F); // Allows 16 Group Keys to be created. static constexpr Key kConfigKey_CounterKeyBase = QorvoConfigKey(kFileId_ChipCounter, 0x00); static constexpr Key kConfigKey_CounterKeyMax = diff --git a/src/platform/tests/TestConfigurationMgr.cpp b/src/platform/tests/TestConfigurationMgr.cpp index 2a5734f7ad9f05..c8fa8273fb13ab 100644 --- a/src/platform/tests/TestConfigurationMgr.cpp +++ b/src/platform/tests/TestConfigurationMgr.cpp @@ -395,6 +395,52 @@ static void TestConfigurationMgr_ServiceProvisioningData(nlTestSuite * inSuite, NL_TEST_ASSERT(inSuite, memcmp(buf, serviceConfig, serviceConfigLen) == 0); } +static void TestConfigurationMgr_RegulatoryLocation(nlTestSuite * inSuite, void * inContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + uint32_t location = 0; + + err = ConfigurationMgr().StoreRegulatoryLocation(12345); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = ConfigurationMgr().GetRegulatoryLocation(location); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, location == 12345); +} + +static void TestConfigurationMgr_CountryCode(nlTestSuite * inSuite, void * inContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + char buf[8]; + size_t countryCodeLen = 0; + const char * countryCode = "US"; + + err = ConfigurationMgr().StoreCountryCode(countryCode, strlen(countryCode)); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = ConfigurationMgr().GetCountryCode(buf, 8, countryCodeLen); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, countryCodeLen == strlen(countryCode)); + NL_TEST_ASSERT(inSuite, strcmp(buf, countryCode) == 0); +} + +static void TestConfigurationMgr_Breadcrumb(nlTestSuite * inSuite, void * inContext) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + uint64_t breadcrumb = 0; + + err = ConfigurationMgr().StoreBreadcrumb(12345); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + err = ConfigurationMgr().GetBreadcrumb(breadcrumb); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(inSuite, breadcrumb == 12345); +} + /** * Test Suite. It lists all the test functions. */ @@ -418,6 +464,9 @@ static const nlTest sTests[] = { NL_TEST_DEF("Test ConfigurationMgr::ServiceConfig", TestConfigurationMgr_ServiceConfig), NL_TEST_DEF("Test ConfigurationMgr::PairedAccountId", TestConfigurationMgr_PairedAccountId), NL_TEST_DEF("Test ConfigurationMgr::ServiceProvisioningData", TestConfigurationMgr_ServiceProvisioningData), + NL_TEST_DEF("Test ConfigurationMgr::RegulatoryLocation", TestConfigurationMgr_RegulatoryLocation), + NL_TEST_DEF("Test ConfigurationMgr::CountryCode", TestConfigurationMgr_CountryCode), + NL_TEST_DEF("Test ConfigurationMgr::Breadcrumb", TestConfigurationMgr_Breadcrumb), NL_TEST_SENTINEL() }; From aa208e83b61314d536e8395dc7e3df5534a6741e Mon Sep 17 00:00:00 2001 From: shana-apple <61782012+shana-apple@users.noreply.github.com> Date: Tue, 4 May 2021 09:12:45 +0200 Subject: [PATCH 14/31] =?UTF-8?q?Add=20Pairing=20API=20in=20CHIPFramework?= =?UTF-8?q?=20that=20takes=20in=20an=20onboarding=20payload=20=E2=80=A6=20?= =?UTF-8?q?(#6358)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Pairing API in CHIPFramework that takes in an onboarding payload string * Restyled by whitespace * Restyled by clang-format * Fixing headers * Restyled by clang-format * Correct ordering of imports Co-authored-by: Restyled.io Co-authored-by: Justin Wood --- .../Framework/CHIP.xcodeproj/project.pbxproj | 8 ++ .../Framework/CHIP/CHIPDeviceController.h | 10 ++ .../Framework/CHIP/CHIPDeviceController.mm | 20 +++ .../CHIP/CHIPOnboardingPayloadParser.h | 39 ++++++ .../CHIP/CHIPOnboardingPayloadParser.m | 60 +++++++++ src/darwin/Framework/CHIP/CHIPSetupPayload.mm | 2 +- .../CHIPTests/CHIPSetupPayloadParserTests.m | 123 ++++++++++++++++++ 7 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.h create mode 100644 src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.m diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index 82da028a08c42d..ede303d9f1493e 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -46,6 +46,8 @@ 991DC0892475F47D00C13860 /* CHIPDeviceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 991DC0872475F47D00C13860 /* CHIPDeviceController.mm */; }; 991DC08B247704DC00C13860 /* CHIPLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 991DC08A247704DC00C13860 /* CHIPLogging.h */; }; B20252972459E34F00F97062 /* CHIP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B202528D2459E34F00F97062 /* CHIP.framework */; }; + B289D4212639C0D300D4E314 /* CHIPOnboardingPayloadParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B289D41F2639C0D300D4E314 /* CHIPOnboardingPayloadParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B289D4222639C0D300D4E314 /* CHIPOnboardingPayloadParser.m in Sources */ = {isa = PBXBuildFile; fileRef = B289D4202639C0D300D4E314 /* CHIPOnboardingPayloadParser.m */; }; B2E0D7B1245B0B5C003C5B48 /* CHIP.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7A8245B0B5C003C5B48 /* CHIP.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B2245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7A9245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B3245B0B5C003C5B48 /* CHIPError.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7AA245B0B5C003C5B48 /* CHIPError.mm */; }; @@ -112,6 +114,8 @@ B20252912459E34F00F97062 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B20252962459E34F00F97062 /* CHIPTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CHIPTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; B202529D2459E34F00F97062 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B289D41F2639C0D300D4E314 /* CHIPOnboardingPayloadParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPOnboardingPayloadParser.h; sourceTree = ""; }; + B289D4202639C0D300D4E314 /* CHIPOnboardingPayloadParser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CHIPOnboardingPayloadParser.m; sourceTree = ""; }; B2E0D7A8245B0B5C003C5B48 /* CHIP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIP.h; sourceTree = ""; }; B2E0D7A9245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CHIPManualSetupPayloadParser.h; sourceTree = ""; }; B2E0D7AA245B0B5C003C5B48 /* CHIPError.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPError.mm; sourceTree = ""; }; @@ -224,6 +228,8 @@ B2E0D7AB245B0B5C003C5B48 /* CHIPError.h */, B2E0D7AA245B0B5C003C5B48 /* CHIPError.mm */, 991DC08A247704DC00C13860 /* CHIPLogging.h */, + B289D41F2639C0D300D4E314 /* CHIPOnboardingPayloadParser.h */, + B289D4202639C0D300D4E314 /* CHIPOnboardingPayloadParser.m */, B2E0D7A9245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h */, B2E0D7AD245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.mm */, B2E0D7AC245B0B5C003C5B48 /* CHIPQRCodeSetupPayloadParser.h */, @@ -264,6 +270,7 @@ buildActionMask = 2147483647; files = ( 2CB7163B252E8A7B0026E2BB /* CHIPDevicePairingDelegateBridge.h in Headers */, + B289D4212639C0D300D4E314 /* CHIPOnboardingPayloadParser.h in Headers */, 2CB7163F252F731E0026E2BB /* CHIPDevicePairingDelegate.h in Headers */, 2C222AD0255C620600E446B9 /* CHIPDevice.h in Headers */, 991DC0842475F45400C13860 /* CHIPDeviceController.h in Headers */, @@ -422,6 +429,7 @@ 1EC4CE5D25CC26E900D7304F /* CHIPClustersObjc.mm in Sources */, 1E9BD1C72621AFF100FC3246 /* attribute-size.cpp in Sources */, B2E0D7B3245B0B5C003C5B48 /* CHIPError.mm in Sources */, + B289D4222639C0D300D4E314 /* CHIPOnboardingPayloadParser.m in Sources */, 1EC4CE5E25CC26E900D7304F /* call-command-handler.cpp in Sources */, 1EC4CE3B25CC263E00D7304F /* reporting-default-configuration.cpp in Sources */, 1EC4CE4F25CC267700D7304F /* process-cluster-message.cpp in Sources */, diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.h b/src/darwin/Framework/CHIP/CHIPDeviceController.h index eef2f00ea74e04..fbddde6f7e6aa8 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.h +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.h @@ -20,6 +20,8 @@ #import +#import + @class CHIPDevice; NS_ASSUME_NONNULL_BEGIN @@ -35,16 +37,24 @@ NS_ASSUME_NONNULL_BEGIN discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode error:(NSError * __autoreleasing *)error; + - (BOOL)pairDevice:(uint64_t)deviceID address:(NSString *)address port:(uint16_t)port discriminator:(uint16_t)discriminator setupPINCode:(uint32_t)setupPINCode error:(NSError * __autoreleasing *)error; + - (BOOL)pairDeviceWithoutSecurity:(uint64_t)deviceID address:(NSString *)address port:(uint16_t)port error:(NSError * __autoreleasing *)error; + +- (BOOL)pairDevice:(uint64_t)deviceID + onboardingPayload:(NSString *)onboardingPayload + onboardingPayloadType:(CHIPOnboardingPayloadType)onboardingPayloadType + error:(NSError * __autoreleasing *)error; + - (void)setListenPort:(uint16_t)port; - (BOOL)unpairDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error; - (BOOL)stopDevicePairing:(uint64_t)deviceID error:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/CHIPDeviceController.mm b/src/darwin/Framework/CHIP/CHIPDeviceController.mm index 6140123db1a8c2..5e3e1e334bf948 100644 --- a/src/darwin/Framework/CHIP/CHIPDeviceController.mm +++ b/src/darwin/Framework/CHIP/CHIPDeviceController.mm @@ -21,6 +21,7 @@ #import "CHIPError.h" #import "CHIPLogging.h" #import "CHIPPersistentStorageDelegateBridge.h" +#import "CHIPSetupPayload.h" #import "gen/CHIPClustersObjc.h" #include @@ -264,6 +265,25 @@ - (BOOL)pairDeviceWithoutSecurity:(uint64_t)deviceID return success; } +- (BOOL)pairDevice:(uint64_t)deviceID + onboardingPayload:(NSString *)onboardingPayload + onboardingPayloadType:(CHIPOnboardingPayloadType)onboardingPayloadType + error:(NSError * __autoreleasing *)error +{ + BOOL didSucceed = NO; + CHIPSetupPayload * setupPayload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:onboardingPayload + ofType:onboardingPayloadType + error:error]; + if (setupPayload) { + uint16_t discriminator = setupPayload.discriminator.unsignedShortValue; + uint32_t setupPINCode = setupPayload.setUpPINCode.unsignedIntValue; + didSucceed = [self pairDevice:deviceID discriminator:discriminator setupPINCode:setupPINCode error:error]; + } else { + CHIP_LOG_ERROR("Failed to create CHIPSetupPayload for pairing with error %@", *error); + } + return didSucceed; +} + - (BOOL)unpairDevice:(uint64_t)deviceID error:(NSError * __autoreleasing *)error { __block BOOL success; diff --git a/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.h b/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.h new file mode 100644 index 00000000000000..a04da1f818a3f4 --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.h @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 + +NS_ASSUME_NONNULL_BEGIN + +@class CHIPSetupPayload; + +typedef NS_ENUM(NSUInteger, CHIPOnboardingPayloadType) { + CHIPOnboardingPayloadTypeQRCode = 0, + CHIPOnboardingPayloadTypeManualCode, + CHIPOnboardingPayloadTypeNFC, + CHIPOnboardingPayloadTypeAdmin, +}; + +@interface CHIPOnboardingPayloadParser : NSObject + ++ (nullable CHIPSetupPayload *)setupPayloadForOnboardingPayload:(NSString *)onboardingPayload + ofType:(CHIPOnboardingPayloadType)type + error:(NSError * __autoreleasing *)error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.m b/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.m new file mode 100644 index 00000000000000..0e0f6560909a92 --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPOnboardingPayloadParser.m @@ -0,0 +1,60 @@ +/** + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * 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 "CHIPOnboardingPayloadParser.h" +#import "CHIPManualSetupPayloadParser.h" +#import "CHIPQRCodeSetupPayloadParser.h" +#import "CHIPSetupPayload.h" + +@implementation CHIPOnboardingPayloadParser + ++ (nullable CHIPSetupPayload *)setupPayloadForOnboardingPayload:(NSString *)onboardingPayload + ofType:(CHIPOnboardingPayloadType)type + error:(NSError * __autoreleasing *)error +{ + CHIPSetupPayload * payload; + switch (type) { + case CHIPOnboardingPayloadTypeManualCode: + case CHIPOnboardingPayloadTypeAdmin: + payload = [self setupPayloadForManualCodeOnboardingPayload:onboardingPayload error:error]; + break; + case CHIPOnboardingPayloadTypeQRCode: + case CHIPOnboardingPayloadTypeNFC: + payload = [self setupPayloadForQRCodeOnboardingPayload:onboardingPayload error:error]; + break; + default: + break; + } + return payload; +} + ++ (nullable CHIPSetupPayload *)setupPayloadForQRCodeOnboardingPayload:(NSString *)onboardingPayload + error:(NSError * __autoreleasing *)error +{ + CHIPQRCodeSetupPayloadParser * qrCodeParser = + [[CHIPQRCodeSetupPayloadParser alloc] initWithBase38Representation:onboardingPayload]; + return [qrCodeParser populatePayload:error]; +} + ++ (nullable CHIPSetupPayload *)setupPayloadForManualCodeOnboardingPayload:(NSString *)onboardingPayload + error:(NSError * __autoreleasing *)error +{ + CHIPManualSetupPayloadParser * manualParser = + [[CHIPManualSetupPayloadParser alloc] initWithDecimalStringRepresentation:onboardingPayload]; + return [manualParser populatePayload:error]; +} +@end diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm index 944edda92f31a4..a7d0e5e6ed9106 100644 --- a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm @@ -49,7 +49,7 @@ - (id)initWithSetupPayload:(chip::SetupPayload)setupPayload _requiresCustomFlow = setupPayload.requiresCustomFlow == 1; _rendezvousInformation = [self valueOf:setupPayload.rendezvousInformation]; _discriminator = [NSNumber numberWithUnsignedShort:setupPayload.discriminator]; - _setUpPINCode = [NSNumber numberWithUnsignedLong:setupPayload.setUpPINCode]; + _setUpPINCode = [NSNumber numberWithUnsignedInt:setupPayload.setUpPINCode]; [self getSerialNumber:setupPayload]; } diff --git a/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m b/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m index cede9b450c2ddb..39d778d2136eb8 100644 --- a/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPSetupPayloadParserTests.m @@ -19,6 +19,7 @@ */ // module headers #import "CHIPManualSetupPayloadParser.h" +#import "CHIPOnboardingPayloadParser.h" #import "CHIPQRCodeSetupPayloadParser.h" #import "CHIPSetupPayload.h" @@ -34,6 +35,128 @@ @interface CHIPSetupPayloadParserTests : XCTestCase @implementation CHIPSetupPayloadParserTests +- (void)testOnboardingPayloadParser_Manual_NoError +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"636108753500001000015" + ofType:CHIPOnboardingPayloadTypeManualCode + error:&error]; + + XCTAssertNotNil(payload); + XCTAssertNil(error); + + XCTAssertEqual(payload.discriminator.unsignedIntegerValue, 2560); + XCTAssertEqual(payload.setUpPINCode.unsignedIntegerValue, 123456780); + XCTAssertEqual(payload.vendorID.unsignedIntegerValue, 1); + XCTAssertEqual(payload.productID.unsignedIntegerValue, 1); + XCTAssertTrue(payload.requiresCustomFlow); + XCTAssertEqual(payload.version.unsignedIntegerValue, 0); + XCTAssertEqual(payload.rendezvousInformation, kRendezvousInformationNone); +} + +- (void)testOnboardingPayloadParser_Manual_WrongType +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"636108753500001000015" + ofType:CHIPOnboardingPayloadTypeQRCode + error:&error]; + + XCTAssertNil(payload); + XCTAssertEqual(error.code, CHIPErrorCodeInvalidArgument); +} + +- (void)testOnboardingPayloadParser_Admin_NoError +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"636108753500001000015" + ofType:CHIPOnboardingPayloadTypeAdmin + error:&error]; + + XCTAssertNotNil(payload); + XCTAssertNil(error); + + XCTAssertEqual(payload.discriminator.unsignedIntegerValue, 2560); + XCTAssertEqual(payload.setUpPINCode.unsignedIntegerValue, 123456780); + XCTAssertEqual(payload.vendorID.unsignedIntegerValue, 1); + XCTAssertEqual(payload.productID.unsignedIntegerValue, 1); + XCTAssertTrue(payload.requiresCustomFlow); + XCTAssertEqual(payload.version.unsignedIntegerValue, 0); + XCTAssertEqual(payload.rendezvousInformation, kRendezvousInformationNone); +} + +- (void)testOnboardingPayloadParser_Admin_WrongType +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"636108753500001000015" + ofType:CHIPOnboardingPayloadTypeQRCode + error:&error]; + + XCTAssertNil(payload); + XCTAssertEqual(error.code, CHIPErrorCodeInvalidArgument); +} + +- (void)testOnboardingPayloadParser_QRCode_NoError +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"CH:R5L90UV200A3L900000" + ofType:CHIPOnboardingPayloadTypeQRCode + error:&error]; + + XCTAssertNotNil(payload); + XCTAssertNil(error); + + XCTAssertEqual(payload.discriminator.unsignedIntegerValue, 128); + XCTAssertEqual(payload.setUpPINCode.unsignedIntegerValue, 2048); + XCTAssertEqual(payload.vendorID.unsignedIntegerValue, 12); + XCTAssertEqual(payload.productID.unsignedIntegerValue, 1); + XCTAssertFalse(payload.requiresCustomFlow); + XCTAssertEqual(payload.version.unsignedIntegerValue, 5); + XCTAssertEqual(payload.rendezvousInformation, kRendezvousInformationSoftAP); +} + +- (void)testOnboardingPayloadParser_QRCode_WrongType +{ + NSError * error; + CHIPSetupPayload * payload = [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"CH:R5L90UV200A3L900000" + ofType:CHIPOnboardingPayloadTypeAdmin + error:&error]; + + XCTAssertNil(payload); + XCTAssertEqual(error.code, CHIPErrorCodeIntegrityCheckFailed); +} + +- (void)testOnboardingPayloadParser_NFC_NoError +{ + NSError * error; + CHIPSetupPayload * payload = + [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"CH:R5L90UV200A3L90A33P0GQ670.QT52B.E23O6DE044U1077U.3" + ofType:CHIPOnboardingPayloadTypeNFC + error:&error]; + + XCTAssertNotNil(payload); + XCTAssertNil(error); + + XCTAssertEqual(payload.discriminator.unsignedIntegerValue, 128); + XCTAssertEqual(payload.setUpPINCode.unsignedIntegerValue, 2048); + XCTAssertEqual(payload.vendorID.unsignedIntegerValue, 12); + XCTAssertEqual(payload.productID.unsignedIntegerValue, 1); + XCTAssertFalse(payload.requiresCustomFlow); + XCTAssertEqual(payload.version.unsignedIntegerValue, 5); + XCTAssertEqual(payload.rendezvousInformation, kRendezvousInformationSoftAP); +} + +- (void)testOnboardingPayloadParser_NFC_WrongType +{ + NSError * error; + CHIPSetupPayload * payload = + [CHIPOnboardingPayloadParser setupPayloadForOnboardingPayload:@"CH:R5L90UV200A3L90A33P0GQ670.QT52B.E23O6DE044U1077U.3" + ofType:CHIPOnboardingPayloadTypeManualCode + error:&error]; + + XCTAssertNil(payload); + XCTAssertEqual(error.code, CHIPErrorCodeIntegrityCheckFailed); +} + - (void)testManualParser { NSError * error; From d66c807f04723a2e6dba4268e17a34105df9c3b0 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 4 May 2021 04:35:55 -0400 Subject: [PATCH 15/31] Fix android KVS implementation to work across threads (#6372) --- .../java/AndroidKeyValueStoreManagerImpl.cpp | 68 +++++++++++++------ .../java/AndroidKeyValueStoreManagerImpl.h | 6 +- .../java/CHIPDeviceController-JNI.cpp | 2 +- 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/controller/java/AndroidKeyValueStoreManagerImpl.cpp b/src/controller/java/AndroidKeyValueStoreManagerImpl.cpp index d806eaf6b6b00a..b3099bcb817ef5 100644 --- a/src/controller/java/AndroidKeyValueStoreManagerImpl.cpp +++ b/src/controller/java/AndroidKeyValueStoreManagerImpl.cpp @@ -42,18 +42,20 @@ KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, size_t offset) { - ReturnErrorCodeIf(mEnv == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mKeyValueStoreManagerClass == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mGetMethod == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(offset != 0, CHIP_ERROR_INVALID_ARGUMENT); - UtfString javaKey(mEnv, key); + JNIEnv * env = GetEnvForCurrentThread(); + ReturnErrorCodeIf(env == nullptr, CHIP_ERROR_INTERNAL); - jobject javaValue = mEnv->CallStaticObjectMethod(mKeyValueStoreManagerClass, mGetMethod, javaKey.jniValue()); - if (mEnv->ExceptionCheck()) + UtfString javaKey(env, key); + + jobject javaValue = env->CallStaticObjectMethod(mKeyValueStoreManagerClass, mGetMethod, javaKey.jniValue()); + if (env->ExceptionCheck()) { ChipLogError(DeviceLayer, "Java exception in KVS::Get"); - mEnv->ExceptionDescribe(); + env->ExceptionDescribe(); return CHIP_JNI_ERROR_EXCEPTION_THROWN; } @@ -62,7 +64,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t return CHIP_ERROR_KEY_NOT_FOUND; } - JniUtfString utfValue(mEnv, (jstring) javaValue); + JniUtfString utfValue(env, (jstring) javaValue); if (strlen(utfValue.c_str()) > kMaxKvsValueEncodedChars) { ChipLogError(DeviceLayer, "Unexpected large value received from KVS"); @@ -92,19 +94,21 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) { - ReturnErrorCodeIf(mEnv == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mKeyValueStoreManagerClass == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mDeleteMethod == nullptr, CHIP_ERROR_INCORRECT_STATE); - UtfString javaKey(mEnv, key); + JNIEnv * env = GetEnvForCurrentThread(); + ReturnErrorCodeIf(env == nullptr, CHIP_ERROR_INTERNAL); + + UtfString javaKey(env, key); - mEnv->CallStaticVoidMethod(mKeyValueStoreManagerClass, mDeleteMethod, javaKey.jniValue()); + env->CallStaticVoidMethod(mKeyValueStoreManagerClass, mDeleteMethod, javaKey.jniValue()); - if (mEnv->ExceptionCheck()) + if (env->ExceptionCheck()) { ChipLogError(DeviceLayer, "Java exception in KVS::Delete"); - mEnv->ExceptionDescribe(); - mEnv->ExceptionClear(); + env->ExceptionDescribe(); + env->ExceptionClear(); return CHIP_JNI_ERROR_EXCEPTION_THROWN; } @@ -113,36 +117,58 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) { - ReturnErrorCodeIf(mEnv == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mKeyValueStoreManagerClass == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(mSetMethod == nullptr, CHIP_ERROR_INCORRECT_STATE); ReturnErrorCodeIf(value_size > kMaxKvsValueBytes, CHIP_ERROR_INVALID_ARGUMENT); + JNIEnv * env = GetEnvForCurrentThread(); + ReturnErrorCodeIf(env == nullptr, CHIP_ERROR_INTERNAL); + char base64Buffer[kMaxKvsValueEncodedChars]; size_t length = chip::Base64Encode(static_cast(value), value_size, base64Buffer); base64Buffer[length] = 0; - UtfString utfKey(mEnv, key); - UtfString utfBase64Value(mEnv, base64Buffer); + UtfString utfKey(env, key); + UtfString utfBase64Value(env, base64Buffer); - mEnv->CallStaticVoidMethod(mKeyValueStoreManagerClass, mSetMethod, utfKey.jniValue(), utfBase64Value.jniValue()); + env->CallStaticVoidMethod(mKeyValueStoreManagerClass, mSetMethod, utfKey.jniValue(), utfBase64Value.jniValue()); - if (mEnv->ExceptionCheck()) + if (env->ExceptionCheck()) { ChipLogError(DeviceLayer, "Java exception in KVS::Delete"); - mEnv->ExceptionDescribe(); - mEnv->ExceptionClear(); + env->ExceptionDescribe(); + env->ExceptionClear(); return CHIP_JNI_ERROR_EXCEPTION_THROWN; } return CHIP_NO_ERROR; } -void KeyValueStoreManagerImpl::InitializeMethodForward(JNIEnv * env) +JNIEnv * KeyValueStoreManagerImpl::GetEnvForCurrentThread() +{ + if (mJvm == nullptr) + { + ChipLogError(DeviceLayer, "Missing Java VM in persistent storage"); + return nullptr; + } + + JNIEnv * env = nullptr; + + jint err = mJvm->AttachCurrentThread(&env, nullptr); + if (err != JNI_OK) + { + ChipLogError(DeviceLayer, "Failed to get JNIEnv for the current thread"); + return nullptr; + } + + return env; +} + +void KeyValueStoreManagerImpl::InitializeMethodForward(JavaVM * vm, JNIEnv * env) { - mEnv = env; + mJvm = vm; CHIP_ERROR err = GetClassRef(env, "chip/devicecontroller/KeyValueStoreManager", mKeyValueStoreManagerClass); if (err != CHIP_NO_ERROR) diff --git a/src/controller/java/AndroidKeyValueStoreManagerImpl.h b/src/controller/java/AndroidKeyValueStoreManagerImpl.h index ea471798952123..eeda32d5e4c9ba 100644 --- a/src/controller/java/AndroidKeyValueStoreManagerImpl.h +++ b/src/controller/java/AndroidKeyValueStoreManagerImpl.h @@ -31,16 +31,18 @@ class KeyValueStoreManagerImpl : public KeyValueStoreManager CHIP_ERROR _Delete(const char * key); CHIP_ERROR _Put(const char * key, const void * value, size_t value_size); - void InitializeMethodForward(JNIEnv * env); + void InitializeMethodForward(JavaVM * vm, JNIEnv * env); private: - JNIEnv * mEnv = nullptr; + JavaVM * mJvm = nullptr; jclass mKeyValueStoreManagerClass = nullptr; jmethodID mSetMethod = nullptr; jmethodID mGetMethod = nullptr; jmethodID mDeleteMethod = nullptr; + JNIEnv * GetEnvForCurrentThread(); + // ===== Members for internal use by the following friends. friend KeyValueStoreManager & KeyValueStoreMgr(); friend KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(); diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 73b33a9c43f98c..626d6d435e05d6 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -149,7 +149,7 @@ jint JNI_OnLoad(JavaVM * jvm, void * reserved) // Get a JNI environment object. sJVM->GetEnv((void **) &env, JNI_VERSION_1_6); - chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().InitializeMethodForward(env); + chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl().InitializeMethodForward(sJVM, env); ChipLogProgress(Controller, "Loading Java class references."); From 7e97ee49cd9cef3627e439f17b192d7001dc2fbd Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 4 May 2021 18:08:50 +0200 Subject: [PATCH 16/31] Remove endpoint 5 on the tv-app as it creates some random ZAP behavior (#6447) --- .../tv-common/gen/IMClusterCommandHandler.cpp | 4505 +---------------- .../tv-app/tv-common/gen/attribute-size.cpp | 65 - .../tv-common/gen/call-command-handler.cpp | 1325 +---- .../tv-app/tv-common/gen/callback-stub.cpp | 56 - examples/tv-app/tv-common/gen/callback.h | 1259 +---- .../tv-app/tv-common/gen/endpoint_config.h | 540 +- examples/tv-app/tv-common/gen/gen_config.h | 62 +- examples/tv-app/tv-common/tv-app.zap | 3581 +------------ 8 files changed, 540 insertions(+), 10853 deletions(-) diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index 55d9dba3be7e88..5534388176fb7f 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -489,27 +489,23 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace AudioOutput -namespace Binding { +namespace ContentLaunch { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_BIND_COMMAND_ID: { + case ZCL_LAUNCH_CONTENT_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::NodeId nodeId; - bool nodeIdExists = false; - chip::GroupId groupId; - bool groupIdExists = false; - chip::EndpointId endpointId; - bool endpointIdExists = false; - chip::ClusterId clusterId; - bool clusterIdExists = false; + uint8_t autoPlay; + bool autoPlayExists = false; + const uint8_t * data; + bool dataExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -517,58 +513,31 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (nodeIdExists) + if (autoPlayExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(nodeId); + TLVUnpackError = aDataTlv.Get(autoPlay); if (CHIP_NO_ERROR == TLVUnpackError) { - nodeIdExists = true; + autoPlayExists = true; validArgumentCount++; } break; case 1: - if (groupIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(groupId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - groupIdExists = true; - validArgumentCount++; - } - break; - case 2: - if (endpointIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(endpointId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - endpointIdExists = true; - validArgumentCount++; - } - break; - case 3: - if (clusterIdExists) + if (dataExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(clusterId); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(data); if (CHIP_NO_ERROR == TLVUnpackError) { - clusterIdExists = true; + dataExists = true; validArgumentCount++; } break; @@ -596,10 +565,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfBindingClusterBindCallback(apCommandObj, nodeId, groupId, endpointId, clusterId); + emberAfContentLaunchClusterLaunchContentCallback(apCommandObj, autoPlay, const_cast(data)); } else { @@ -607,24 +576,20 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_UNBIND_COMMAND_ID: { + case ZCL_LAUNCH_URL_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::NodeId nodeId; - bool nodeIdExists = false; - chip::GroupId groupId; - bool groupIdExists = false; - chip::EndpointId endpointId; - bool endpointIdExists = false; - chip::ClusterId clusterId; - bool clusterIdExists = false; + const uint8_t * contentURL; + bool contentURLExists = false; + const uint8_t * displayString; + bool displayStringExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -632,58 +597,32 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (nodeIdExists) + if (contentURLExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(nodeId); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(contentURL); if (CHIP_NO_ERROR == TLVUnpackError) { - nodeIdExists = true; + contentURLExists = true; validArgumentCount++; } break; case 1: - if (groupIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(groupId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - groupIdExists = true; - validArgumentCount++; - } - break; - case 2: - if (endpointIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(endpointId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - endpointIdExists = true; - validArgumentCount++; - } - break; - case 3: - if (clusterIdExists) + if (displayStringExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(clusterId); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(displayString); if (CHIP_NO_ERROR == TLVUnpackError) { - clusterIdExists = true; + displayStringExists = true; validArgumentCount++; } break; @@ -711,10 +650,11 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfBindingClusterUnbindCallback(apCommandObj, nodeId, groupId, endpointId, clusterId); + emberAfContentLaunchClusterLaunchURLCallback(apCommandObj, const_cast(contentURL), + const_cast(displayString)); } else { @@ -722,7 +662,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } @@ -730,40 +670,34 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_BINDING_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_CONTENT_LAUNCH_CLUSTER_ID); break; } } } } -} // namespace Binding +} // namespace ContentLaunch -namespace ColorControl { +namespace GeneralCommissioning { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_MOVE_COLOR_TEMPERATURE_COMMAND_ID: { + case ZCL_ARM_FAIL_SAFE_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t moveMode; - bool moveModeExists = false; - uint16_t rate; - bool rateExists = false; - uint16_t colorTemperatureMinimum; - bool colorTemperatureMinimumExists = false; - uint16_t colorTemperatureMaximum; - bool colorTemperatureMaximumExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; + uint16_t expiryLengthSeconds; + bool expiryLengthSecondsExists = false; + uint64_t breadcrumb; + bool breadcrumbExists = false; + uint32_t timeoutMs; + bool timeoutMsExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -771,86 +705,44 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (moveModeExists) + if (expiryLengthSecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(moveMode); + TLVUnpackError = aDataTlv.Get(expiryLengthSeconds); if (CHIP_NO_ERROR == TLVUnpackError) { - moveModeExists = true; + expiryLengthSecondsExists = true; validArgumentCount++; } break; case 1: - if (rateExists) + if (breadcrumbExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(rate); + TLVUnpackError = aDataTlv.Get(breadcrumb); if (CHIP_NO_ERROR == TLVUnpackError) { - rateExists = true; + breadcrumbExists = true; validArgumentCount++; } break; case 2: - if (colorTemperatureMinimumExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(colorTemperatureMinimum); - if (CHIP_NO_ERROR == TLVUnpackError) - { - colorTemperatureMinimumExists = true; - validArgumentCount++; - } - break; - case 3: - if (colorTemperatureMaximumExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(colorTemperatureMaximum); - if (CHIP_NO_ERROR == TLVUnpackError) - { - colorTemperatureMaximumExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 5: - if (optionsOverrideExists) + if (timeoutMsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionsOverride); + TLVUnpackError = aDataTlv.Get(timeoutMs); if (CHIP_NO_ERROR == TLVUnpackError) { - optionsOverrideExists = true; + timeoutMsExists = true; validArgumentCount++; } break; @@ -878,11 +770,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 6 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveColorTemperatureCallback(apCommandObj, moveMode, rate, colorTemperatureMinimum, - colorTemperatureMaximum, optionsMask, optionsOverride); + emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, expiryLengthSeconds, breadcrumb, timeoutMs); } else { @@ -890,24 +781,30 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 6, validArgumentCount, TLVError, TLVUnpackError); + 3, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MOVE_HUE_COMMAND_ID: { + case ZCL_COMMISSIONING_COMPLETE_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj); + break; + } + case ZCL_SET_REGULATORY_CONFIG_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t moveMode; - bool moveModeExists = false; - uint8_t rate; - bool rateExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; + uint8_t location; + bool locationExists = false; + const uint8_t * countryCode; + bool countryCodeExists = false; + uint64_t breadcrumb; + bool breadcrumbExists = false; + uint32_t timeoutMs; + bool timeoutMsExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -915,58 +812,59 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (moveModeExists) + if (locationExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(moveMode); + TLVUnpackError = aDataTlv.Get(location); if (CHIP_NO_ERROR == TLVUnpackError) { - moveModeExists = true; + locationExists = true; validArgumentCount++; } break; case 1: - if (rateExists) + if (countryCodeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(rate); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(countryCode); if (CHIP_NO_ERROR == TLVUnpackError) { - rateExists = true; + countryCodeExists = true; validArgumentCount++; } break; case 2: - if (optionsMaskExists) + if (breadcrumbExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionsMask); + TLVUnpackError = aDataTlv.Get(breadcrumb); if (CHIP_NO_ERROR == TLVUnpackError) { - optionsMaskExists = true; + breadcrumbExists = true; validArgumentCount++; } break; case 3: - if (optionsOverrideExists) + if (timeoutMsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionsOverride); + TLVUnpackError = aDataTlv.Get(timeoutMs); if (CHIP_NO_ERROR == TLVUnpackError) { - optionsOverrideExists = true; + timeoutMsExists = true; validArgumentCount++; } break; @@ -997,7 +895,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveHueCallback(apCommandObj, moveMode, rate, optionsMask, optionsOverride); + emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( + apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); } else { @@ -1009,20 +908,34 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_MOVE_SATURATION_COMMAND_ID: { + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_GENERAL_COMMISSIONING_CLUSTER_ID); + break; + } + } + } +} + +} // namespace GeneralCommissioning + +namespace KeypadInput { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_SEND_KEY_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t moveMode; - bool moveModeExists = false; - uint8_t rate; - bool rateExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; + uint8_t keyCode; + bool keyCodeExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1030,58 +943,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (moveModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(moveMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - moveModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (rateExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(rate); - if (CHIP_NO_ERROR == TLVUnpackError) - { - rateExists = true; - validArgumentCount++; - } - break; - case 2: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsOverrideExists) + if (keyCodeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionsOverride); + TLVUnpackError = aDataTlv.Get(keyCode); if (CHIP_NO_ERROR == TLVUnpackError) { - optionsOverrideExists = true; + keyCodeExists = true; validArgumentCount++; } break; @@ -1109,10 +980,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveSaturationCallback(apCommandObj, moveMode, rate, optionsMask, optionsOverride); + emberAfKeypadInputClusterSendKeyCallback(apCommandObj, keyCode); } else { @@ -1120,3844 +991,72 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MOVE_TO_COLOR_TEMPERATURE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t colorTemperature; - bool colorTemperatureExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_KEYPAD_INPUT_CLUSTER_ID); + break; + } + } + } +} - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (colorTemperatureExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(colorTemperature); - if (CHIP_NO_ERROR == TLVUnpackError) - { - colorTemperatureExists = true; - validArgumentCount++; - } - break; - case 1: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 2: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveToColorTemperatureCallback(apCommandObj, colorTemperature, transitionTime, - optionsMask, optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MOVE_TO_HUE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t hue; - bool hueExists = false; - uint8_t direction; - bool directionExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (hueExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(hue); - if (CHIP_NO_ERROR == TLVUnpackError) - { - hueExists = true; - validArgumentCount++; - } - break; - case 1: - if (directionExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(direction); - if (CHIP_NO_ERROR == TLVUnpackError) - { - directionExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveToHueCallback(apCommandObj, hue, direction, transitionTime, optionsMask, - optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 5, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MOVE_TO_HUE_AND_SATURATION_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t hue; - bool hueExists = false; - uint8_t saturation; - bool saturationExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (hueExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(hue); - if (CHIP_NO_ERROR == TLVUnpackError) - { - hueExists = true; - validArgumentCount++; - } - break; - case 1: - if (saturationExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(saturation); - if (CHIP_NO_ERROR == TLVUnpackError) - { - saturationExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveToHueAndSaturationCallback(apCommandObj, hue, saturation, transitionTime, optionsMask, - optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 5, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MOVE_TO_SATURATION_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t saturation; - bool saturationExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (saturationExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(saturation); - if (CHIP_NO_ERROR == TLVUnpackError) - { - saturationExists = true; - validArgumentCount++; - } - break; - case 1: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 2: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterMoveToSaturationCallback(apCommandObj, saturation, transitionTime, optionsMask, - optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_STEP_COLOR_TEMPERATURE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t stepMode; - bool stepModeExists = false; - uint16_t stepSize; - bool stepSizeExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint16_t colorTemperatureMinimum; - bool colorTemperatureMinimumExists = false; - uint16_t colorTemperatureMaximum; - bool colorTemperatureMaximumExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (stepModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (stepSizeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepSize); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepSizeExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (colorTemperatureMinimumExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(colorTemperatureMinimum); - if (CHIP_NO_ERROR == TLVUnpackError) - { - colorTemperatureMinimumExists = true; - validArgumentCount++; - } - break; - case 4: - if (colorTemperatureMaximumExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(colorTemperatureMaximum); - if (CHIP_NO_ERROR == TLVUnpackError) - { - colorTemperatureMaximumExists = true; - validArgumentCount++; - } - break; - case 5: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 6: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterStepColorTemperatureCallback(apCommandObj, stepMode, stepSize, transitionTime, - colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 7, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_STEP_HUE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t stepMode; - bool stepModeExists = false; - uint8_t stepSize; - bool stepSizeExists = false; - uint8_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (stepModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (stepSizeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepSize); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepSizeExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterStepHueCallback(apCommandObj, stepMode, stepSize, transitionTime, optionsMask, - optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 5, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_STEP_SATURATION_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t stepMode; - bool stepModeExists = false; - uint8_t stepSize; - bool stepSizeExists = false; - uint8_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (stepModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (stepSizeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepSize); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepSizeExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterStepSaturationCallback(apCommandObj, stepMode, stepSize, transitionTime, optionsMask, - optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 5, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_STOP_MOVE_STEP_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t optionsMask; - bool optionsMaskExists = false; - uint8_t optionsOverride; - bool optionsOverrideExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (optionsMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsMaskExists = true; - validArgumentCount++; - } - break; - case 1: - if (optionsOverrideExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionsOverride); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionsOverrideExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfColorControlClusterStopMoveStepCallback(apCommandObj, optionsMask, optionsOverride); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_COLOR_CONTROL_CLUSTER_ID); - break; - } - } - } -} - -} // namespace ColorControl - -namespace ContentLaunch { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_LAUNCH_CONTENT_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t autoPlay; - bool autoPlayExists = false; - const uint8_t * data; - bool dataExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (autoPlayExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(autoPlay); - if (CHIP_NO_ERROR == TLVUnpackError) - { - autoPlayExists = true; - validArgumentCount++; - } - break; - case 1: - if (dataExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(data); - if (CHIP_NO_ERROR == TLVUnpackError) - { - dataExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfContentLaunchClusterLaunchContentCallback(apCommandObj, autoPlay, const_cast(data)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_LAUNCH_URL_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - const uint8_t * contentURL; - bool contentURLExists = false; - const uint8_t * displayString; - bool displayStringExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (contentURLExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(contentURL); - if (CHIP_NO_ERROR == TLVUnpackError) - { - contentURLExists = true; - validArgumentCount++; - } - break; - case 1: - if (displayStringExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(displayString); - if (CHIP_NO_ERROR == TLVUnpackError) - { - displayStringExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfContentLaunchClusterLaunchURLCallback(apCommandObj, const_cast(contentURL), - const_cast(displayString)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_CONTENT_LAUNCH_CLUSTER_ID); - break; - } - } - } -} - -} // namespace ContentLaunch - -namespace DoorLock { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_CLEAR_ALL_PINS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearAllPinsCallback(apCommandObj); - break; - } - case ZCL_CLEAR_ALL_RFIDS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearAllRfidsCallback(apCommandObj); - break; - } - case ZCL_CLEAR_HOLIDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearHolidayScheduleCallback(apCommandObj, scheduleId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_CLEAR_PIN_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearPinCallback(apCommandObj, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_CLEAR_RFID_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearRfidCallback(apCommandObj, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_CLEAR_WEEKDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearWeekdayScheduleCallback(apCommandObj, scheduleId, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_CLEAR_YEARDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterClearYeardayScheduleCallback(apCommandObj, scheduleId, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_HOLIDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetHolidayScheduleCallback(apCommandObj, scheduleId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_LOG_RECORD_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t logIndex; - bool logIndexExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (logIndexExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(logIndex); - if (CHIP_NO_ERROR == TLVUnpackError) - { - logIndexExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetLogRecordCallback(apCommandObj, logIndex); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_PIN_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetPinCallback(apCommandObj, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_RFID_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetRfidCallback(apCommandObj, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_USER_TYPE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetUserTypeCallback(apCommandObj, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_WEEKDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetWeekdayScheduleCallback(apCommandObj, scheduleId, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_GET_YEARDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterGetYeardayScheduleCallback(apCommandObj, scheduleId, userId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_HOLIDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint32_t localStartTime; - bool localStartTimeExists = false; - uint32_t localEndTime; - bool localEndTimeExists = false; - uint8_t operatingModeDuringHoliday; - bool operatingModeDuringHolidayExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (localStartTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(localStartTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - localStartTimeExists = true; - validArgumentCount++; - } - break; - case 2: - if (localEndTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(localEndTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - localEndTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (operatingModeDuringHolidayExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(operatingModeDuringHoliday); - if (CHIP_NO_ERROR == TLVUnpackError) - { - operatingModeDuringHolidayExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetHolidayScheduleCallback(apCommandObj, scheduleId, localStartTime, localEndTime, - operatingModeDuringHoliday); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_PIN_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint8_t userStatus; - bool userStatusExists = false; - uint8_t userType; - bool userTypeExists = false; - const uint8_t * pin; - bool pinExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userStatusExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userStatus); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userStatusExists = true; - validArgumentCount++; - } - break; - case 2: - if (userTypeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userType); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userTypeExists = true; - validArgumentCount++; - } - break; - case 3: - if (pinExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(pin); - if (CHIP_NO_ERROR == TLVUnpackError) - { - pinExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetPinCallback(apCommandObj, userId, userStatus, userType, const_cast(pin)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_RFID_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint8_t userStatus; - bool userStatusExists = false; - uint8_t userType; - bool userTypeExists = false; - const uint8_t * id; - bool idExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userStatusExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userStatus); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userStatusExists = true; - validArgumentCount++; - } - break; - case 2: - if (userTypeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userType); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userTypeExists = true; - validArgumentCount++; - } - break; - case 3: - if (idExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(id); - if (CHIP_NO_ERROR == TLVUnpackError) - { - idExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetRfidCallback(apCommandObj, userId, userStatus, userType, const_cast(id)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_USER_TYPE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t userId; - bool userIdExists = false; - uint8_t userType; - bool userTypeExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userTypeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userType); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userTypeExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetUserTypeCallback(apCommandObj, userId, userType); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_WEEKDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint8_t daysMask; - bool daysMaskExists = false; - uint8_t startHour; - bool startHourExists = false; - uint8_t startMinute; - bool startMinuteExists = false; - uint8_t endHour; - bool endHourExists = false; - uint8_t endMinute; - bool endMinuteExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - case 2: - if (daysMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(daysMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - daysMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (startHourExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(startHour); - if (CHIP_NO_ERROR == TLVUnpackError) - { - startHourExists = true; - validArgumentCount++; - } - break; - case 4: - if (startMinuteExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(startMinute); - if (CHIP_NO_ERROR == TLVUnpackError) - { - startMinuteExists = true; - validArgumentCount++; - } - break; - case 5: - if (endHourExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(endHour); - if (CHIP_NO_ERROR == TLVUnpackError) - { - endHourExists = true; - validArgumentCount++; - } - break; - case 6: - if (endMinuteExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(endMinute); - if (CHIP_NO_ERROR == TLVUnpackError) - { - endMinuteExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 7 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetWeekdayScheduleCallback(apCommandObj, scheduleId, userId, daysMask, startHour, startMinute, - endHour, endMinute); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 7, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SET_YEARDAY_SCHEDULE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t scheduleId; - bool scheduleIdExists = false; - uint16_t userId; - bool userIdExists = false; - uint32_t localStartTime; - bool localStartTimeExists = false; - uint32_t localEndTime; - bool localEndTimeExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (scheduleIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(scheduleId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - scheduleIdExists = true; - validArgumentCount++; - } - break; - case 1: - if (userIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(userId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - userIdExists = true; - validArgumentCount++; - } - break; - case 2: - if (localStartTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(localStartTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - localStartTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (localEndTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(localEndTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - localEndTimeExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterSetYeardayScheduleCallback(apCommandObj, scheduleId, userId, localStartTime, localEndTime); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_UNLOCK_WITH_TIMEOUT_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t timeoutInSeconds; - bool timeoutInSecondsExists = false; - const uint8_t * pin; - bool pinExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (timeoutInSecondsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(timeoutInSeconds); - if (CHIP_NO_ERROR == TLVUnpackError) - { - timeoutInSecondsExists = true; - validArgumentCount++; - } - break; - case 1: - if (pinExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(pin); - if (CHIP_NO_ERROR == TLVUnpackError) - { - pinExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfDoorLockClusterUnlockWithTimeoutCallback(apCommandObj, timeoutInSeconds, const_cast(pin)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_DOOR_LOCK_CLUSTER_ID); - break; - } - } - } -} - -} // namespace DoorLock - -namespace GeneralCommissioning { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_ARM_FAIL_SAFE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t expiryLengthSeconds; - bool expiryLengthSecondsExists = false; - uint64_t breadcrumb; - bool breadcrumbExists = false; - uint32_t timeoutMs; - bool timeoutMsExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (expiryLengthSecondsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(expiryLengthSeconds); - if (CHIP_NO_ERROR == TLVUnpackError) - { - expiryLengthSecondsExists = true; - validArgumentCount++; - } - break; - case 1: - if (breadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - breadcrumbExists = true; - validArgumentCount++; - } - break; - case 2: - if (timeoutMsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(timeoutMs); - if (CHIP_NO_ERROR == TLVUnpackError) - { - timeoutMsExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfGeneralCommissioningClusterArmFailSafeCallback(apCommandObj, expiryLengthSeconds, breadcrumb, timeoutMs); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_COMMISSIONING_COMPLETE_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfGeneralCommissioningClusterCommissioningCompleteCallback(apCommandObj); - break; - } - case ZCL_SET_REGULATORY_CONFIG_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t location; - bool locationExists = false; - const uint8_t * countryCode; - bool countryCodeExists = false; - uint64_t breadcrumb; - bool breadcrumbExists = false; - uint32_t timeoutMs; - bool timeoutMsExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (locationExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(location); - if (CHIP_NO_ERROR == TLVUnpackError) - { - locationExists = true; - validArgumentCount++; - } - break; - case 1: - if (countryCodeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(countryCode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - countryCodeExists = true; - validArgumentCount++; - } - break; - case 2: - if (breadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - breadcrumbExists = true; - validArgumentCount++; - } - break; - case 3: - if (timeoutMsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(timeoutMs); - if (CHIP_NO_ERROR == TLVUnpackError) - { - timeoutMsExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback( - apCommandObj, location, const_cast(countryCode), breadcrumb, timeoutMs); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_GENERAL_COMMISSIONING_CLUSTER_ID); - break; - } - } - } -} - -} // namespace GeneralCommissioning - -namespace IasZone { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_ZONE_ENROLL_RESPONSE_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t enrollResponseCode; - bool enrollResponseCodeExists = false; - uint8_t zoneId; - bool zoneIdExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (enrollResponseCodeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(enrollResponseCode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - enrollResponseCodeExists = true; - validArgumentCount++; - } - break; - case 1: - if (zoneIdExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(zoneId); - if (CHIP_NO_ERROR == TLVUnpackError) - { - zoneIdExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfIasZoneClusterZoneEnrollResponseCallback(apCommandObj, enrollResponseCode, zoneId); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_IAS_ZONE_CLUSTER_ID); - break; - } - } - } -} - -} // namespace IasZone - -namespace KeypadInput { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_SEND_KEY_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t keyCode; - bool keyCodeExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (keyCodeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(keyCode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - keyCodeExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfKeypadInputClusterSendKeyCallback(apCommandObj, keyCode); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_KEYPAD_INPUT_CLUSTER_ID); - break; - } - } - } -} - -} // namespace KeypadInput - -namespace LowPower { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_SLEEP_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLowPowerClusterSleepCallback(apCommandObj); - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LOW_POWER_CLUSTER_ID); - break; - } - } - } -} - -} // namespace LowPower - -namespace MediaInput { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterHideInputStatusCallback(apCommandObj); - break; - } - case ZCL_RENAME_INPUT_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t index; - bool indexExists = false; - const uint8_t * name; - bool nameExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (indexExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(index); - if (CHIP_NO_ERROR == TLVUnpackError) - { - indexExists = true; - validArgumentCount++; - } - break; - case 1: - if (nameExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(name); - if (CHIP_NO_ERROR == TLVUnpackError) - { - nameExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterRenameInputCallback(apCommandObj, index, const_cast(name)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SELECT_INPUT_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t index; - bool indexExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (indexExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(index); - if (CHIP_NO_ERROR == TLVUnpackError) - { - indexExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterSelectInputCallback(apCommandObj, index); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterShowInputStatusCallback(apCommandObj); - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_INPUT_CLUSTER_ID); - break; - } - } - } -} - -} // namespace MediaInput - -namespace MediaPlayback { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); - break; - } - case ZCL_MEDIA_NEXT_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PAUSE_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PLAY_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); - break; - } - case ZCL_MEDIA_REWIND_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); - break; - } - case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (deltaPositionMillisecondsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); - if (CHIP_NO_ERROR == TLVUnpackError) - { - deltaPositionMillisecondsExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (deltaPositionMillisecondsExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); - if (CHIP_NO_ERROR == TLVUnpackError) - { - deltaPositionMillisecondsExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t position; - bool positionExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (positionExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(position); - if (CHIP_NO_ERROR == TLVUnpackError) - { - positionExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } +} // namespace KeypadInput - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - case ZCL_MEDIA_START_OVER_COMMAND_ID: { +namespace LowPower { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); - break; - } - case ZCL_MEDIA_STOP_COMMAND_ID: { +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_SLEEP_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); + emberAfLowPowerClusterSleepCallback(apCommandObj); break; } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LOW_POWER_CLUSTER_ID); break; } } } } -} // namespace MediaPlayback +} // namespace LowPower -namespace NetworkCommissioning { +namespace MediaInput { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_DISABLE_NETWORK_COMMAND_ID: { + case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaInputClusterHideInputStatusCallback(apCommandObj); + break; + } + case ZCL_RENAME_INPUT_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::ByteSpan networkID; - bool networkIDExists = false; - uint64_t breadcrumb; - bool breadcrumbExists = false; - uint32_t timeoutMs; - bool timeoutMsExists = false; + uint8_t index; + bool indexExists = false; + const uint8_t * name; + bool nameExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -4965,48 +1064,31 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (networkIDExists) + if (indexExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - { - const uint8_t * data = nullptr; - TLVUnpackError = aDataTlv.GetDataPtr(data); - networkID = chip::ByteSpan(data, aDataTlv.GetLength()); - } + TLVUnpackError = aDataTlv.Get(index); if (CHIP_NO_ERROR == TLVUnpackError) { - networkIDExists = true; + indexExists = true; validArgumentCount++; } break; case 1: - if (breadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - breadcrumbExists = true; - validArgumentCount++; - } - break; - case 2: - if (timeoutMsExists) + if (nameExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(timeoutMs); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(name); if (CHIP_NO_ERROR == TLVUnpackError) { - timeoutMsExists = true; + nameExists = true; validArgumentCount++; } break; @@ -5034,10 +1116,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfNetworkCommissioningClusterDisableNetworkCallback(apCommandObj, networkID, breadcrumb, timeoutMs); + emberAfMediaInputClusterRenameInputCallback(apCommandObj, index, const_cast(name)); } else { @@ -5045,22 +1127,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_ENABLE_NETWORK_COMMAND_ID: { + case ZCL_SELECT_INPUT_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::ByteSpan networkID; - bool networkIDExists = false; - uint64_t breadcrumb; - bool breadcrumbExists = false; - uint32_t timeoutMs; - bool timeoutMsExists = false; + uint8_t index; + bool indexExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -5068,48 +1146,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (networkIDExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - { - const uint8_t * data = nullptr; - TLVUnpackError = aDataTlv.GetDataPtr(data); - networkID = chip::ByteSpan(data, aDataTlv.GetLength()); - } - if (CHIP_NO_ERROR == TLVUnpackError) - { - networkIDExists = true; - validArgumentCount++; - } - break; - case 1: - if (breadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - breadcrumbExists = true; - validArgumentCount++; - } - break; - case 2: - if (timeoutMsExists) + if (indexExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(timeoutMs); + TLVUnpackError = aDataTlv.Get(index); if (CHIP_NO_ERROR == TLVUnpackError) { - timeoutMsExists = true; + indexExists = true; validArgumentCount++; } break; @@ -5137,10 +1183,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfNetworkCommissioningClusterEnableNetworkCallback(apCommandObj, networkID, breadcrumb, timeoutMs); + emberAfMediaInputClusterSelectInputCallback(apCommandObj, index); } else { @@ -5148,35 +1194,97 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: { + case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaInputClusterShowInputStatusCallback(apCommandObj); + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_INPUT_CLUSTER_ID); + break; + } + } + } +} + +} // namespace MediaInput + +namespace MediaPlayback { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); + break; + } + case ZCL_MEDIA_NEXT_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); + break; + } + case ZCL_MEDIA_PAUSE_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); + break; + } + case ZCL_MEDIA_PLAY_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); + break; + } + case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); + break; + } + case ZCL_MEDIA_REWIND_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); + break; + } + case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint32_t timeoutMs; - bool timeoutMsExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (timeoutMsExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(timeoutMs); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - timeoutMsExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -5207,7 +1315,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(apCommandObj, timeoutMs); + emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -5219,67 +1327,31 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_REMOVE_NETWORK_COMMAND_ID: { + case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::ByteSpan NetworkID; - bool NetworkIDExists = false; - uint64_t Breadcrumb; - bool BreadcrumbExists = false; - uint32_t TimeoutMs; - bool TimeoutMsExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (NetworkIDExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - { - const uint8_t * data = nullptr; - TLVUnpackError = aDataTlv.GetDataPtr(data); - NetworkID = chip::ByteSpan(data, aDataTlv.GetLength()); - } - if (CHIP_NO_ERROR == TLVUnpackError) - { - NetworkIDExists = true; - validArgumentCount++; - } - break; - case 1: - if (BreadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(Breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - BreadcrumbExists = true; - validArgumentCount++; - } - break; - case 2: - if (TimeoutMsExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(TimeoutMs); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - TimeoutMsExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -5307,10 +1379,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfNetworkCommissioningClusterRemoveNetworkCallback(apCommandObj, NetworkID, Breadcrumb, TimeoutMs); + emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -5318,22 +1390,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_SCAN_NETWORKS_COMMAND_ID: { + case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - chip::ByteSpan ssid; - bool ssidExists = false; - uint64_t breadcrumb; - bool breadcrumbExists = false; - uint32_t timeoutMs; - bool timeoutMsExists = false; + uint64_t position; + bool positionExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -5341,48 +1409,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (ssidExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - { - const uint8_t * data = nullptr; - TLVUnpackError = aDataTlv.GetDataPtr(data); - ssid = chip::ByteSpan(data, aDataTlv.GetLength()); - } - if (CHIP_NO_ERROR == TLVUnpackError) - { - ssidExists = true; - validArgumentCount++; - } - break; - case 1: - if (breadcrumbExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(breadcrumb); - if (CHIP_NO_ERROR == TLVUnpackError) - { - breadcrumbExists = true; - validArgumentCount++; - } - break; - case 2: - if (timeoutMsExists) + if (positionExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(timeoutMs); + TLVUnpackError = aDataTlv.Get(position); if (CHIP_NO_ERROR == TLVUnpackError) { - timeoutMsExists = true; + positionExists = true; validArgumentCount++; } break; @@ -5410,10 +1446,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfNetworkCommissioningClusterScanNetworksCallback(apCommandObj, ssid, breadcrumb, timeoutMs); + emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); } else { @@ -5421,22 +1457,34 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } + case ZCL_MEDIA_START_OVER_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); + break; + } + case ZCL_MEDIA_STOP_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); + break; + } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_NETWORK_COMMISSIONING_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); break; } } } } -} // namespace NetworkCommissioning +} // namespace MediaPlayback namespace OnOff { @@ -5839,24 +1887,12 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_AUDIO_OUTPUT_CLUSTER_ID: clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_BINDING_CLUSTER_ID: - clusters::Binding::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; - case ZCL_COLOR_CONTROL_CLUSTER_ID: - clusters::ColorControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: clusters::ContentLaunch::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_DOOR_LOCK_CLUSTER_ID: - clusters::DoorLock::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_IAS_ZONE_CLUSTER_ID: - clusters::IasZone::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; case ZCL_KEYPAD_INPUT_CLUSTER_ID: clusters::KeypadInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; @@ -5869,9 +1905,6 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: - clusters::NetworkCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; case ZCL_ON_OFF_CLUSTER_ID: clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; diff --git a/examples/tv-app/tv-common/gen/attribute-size.cpp b/examples/tv-app/tv-common/gen/attribute-size.cpp index 3d1ffc9b216a77..876e63f739a116 100644 --- a/examples/tv-app/tv-common/gen/attribute-size.cpp +++ b/examples/tv-app/tv-common/gen/attribute-size.cpp @@ -77,58 +77,6 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo uint16_t entryLength = 0; switch (clusterId) { - case 0xF004: // Group Key Management Cluster - { - uint16_t entryOffset = kSizeLengthInBytes; - switch (am->attributeId) - { - case 0x0000: // groups - { - entryLength = 6; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %l is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupState - _GroupState * entry = reinterpret_cast<_GroupState *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->VendorGroupId, write ? (uint8_t *) &entry->VendorGroupId : src, write, - &entryOffset, sizeof(entry->VendorGroupId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySetIndex, write ? (uint8_t *) &entry->GroupKeySetIndex : src, - write, &entryOffset, sizeof(entry->GroupKeySetIndex)); // INT16U - break; - } - case 0x0001: // group keys - { - entryLength = 29; - if (((index - 1) * entryLength) > (am->size - entryLength)) - { - ChipLogError(Zcl, "Index %l is invalid.", index); - return 0; - } - entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); - // Struct _GroupKey - _GroupKey * entry = reinterpret_cast<_GroupKey *>(write ? src : dest); - copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, - &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyIndex, write ? (uint8_t *) &entry->GroupKeyIndex : src, write, - &entryOffset, sizeof(entry->GroupKeyIndex)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyRoot, write ? (uint8_t *) &entry->GroupKeyRoot : src, write, - &entryOffset, 16); // OCTET_STRING - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeyEpochStartTime, - write ? (uint8_t *) &entry->GroupKeyEpochStartTime : src, write, &entryOffset, - sizeof(entry->GroupKeyEpochStartTime)); // INT64U - copyListMember(write ? dest : (uint8_t *) &entry->GroupKeySecurityPolicy, - write ? (uint8_t *) &entry->GroupKeySecurityPolicy : src, write, &entryOffset, - sizeof(entry->GroupKeySecurityPolicy)); // GroupKeySecurityPolicy - break; - } - } - break; - } } return entryLength; @@ -148,19 +96,6 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut uint16_t entryLength = 0; switch (clusterId) { - case 0xF004: // Group Key Management Cluster - switch (attributeId) - { - case 0x0000: // groups - // Struct _GroupState - entryLength = 6; - break; - case 0x0001: // group keys - // Struct _GroupKey - entryLength = 29; - break; - } - break; } uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength); diff --git a/examples/tv-app/tv-common/gen/call-command-handler.cpp b/examples/tv-app/tv-common/gen/call-command-handler.cpp index 17b5393e5ac11e..9ac0c2d36a3055 100644 --- a/examples/tv-app/tv-common/gen/call-command-handler.cpp +++ b/examples/tv-app/tv-common/gen/call-command-handler.cpp @@ -32,27 +32,20 @@ EmberAfStatus emberAfAccountLoginClusterServerCommandParse(EmberAfClusterCommand EmberAfStatus emberAfApplicationBasicClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfApplicationLauncherClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfAudioOutputClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfBarrierControlClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfBindingClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfColorControlClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfContentLaunchClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfDoorLockClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfGroupKeyManagementClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfGroupsClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfIasZoneClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfIdentifyClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfKeypadInputClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfLowPowerClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfMediaInputClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfMediaPlaybackClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTvChannelClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTargetNavigatorClusterServerCommandParse(EmberAfClusterCommand * cmd); -EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfWakeOnLanClusterServerCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) @@ -107,36 +100,20 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_AUDIO_OUTPUT_CLUSTER_ID: result = emberAfAudioOutputClusterServerCommandParse(cmd); break; - case ZCL_BARRIER_CONTROL_CLUSTER_ID: - // No commands are enabled for cluster Barrier Control - result = status(false, true, cmd->mfgSpecific); - break; - case ZCL_BINDING_CLUSTER_ID: - result = emberAfBindingClusterServerCommandParse(cmd); - break; case ZCL_COLOR_CONTROL_CLUSTER_ID: - result = emberAfColorControlClusterServerCommandParse(cmd); + // No commands are enabled for cluster Color Control + result = status(false, true, cmd->mfgSpecific); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: result = emberAfContentLaunchClusterServerCommandParse(cmd); break; - case ZCL_DOOR_LOCK_CLUSTER_ID: - result = emberAfDoorLockClusterServerCommandParse(cmd); - break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: result = emberAfGeneralCommissioningClusterServerCommandParse(cmd); break; - case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: - // No commands are enabled for cluster Group Key Management - result = status(false, true, cmd->mfgSpecific); - break; case ZCL_GROUPS_CLUSTER_ID: // No commands are enabled for cluster Groups result = status(false, true, cmd->mfgSpecific); break; - case ZCL_IAS_ZONE_CLUSTER_ID: - result = emberAfIasZoneClusterServerCommandParse(cmd); - break; case ZCL_IDENTIFY_CLUSTER_ID: // No commands are enabled for cluster Identify result = status(false, true, cmd->mfgSpecific); @@ -157,9 +134,6 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: result = emberAfMediaPlaybackClusterServerCommandParse(cmd); break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: - result = emberAfNetworkCommissioningClusterServerCommandParse(cmd); - break; case ZCL_ON_OFF_CLUSTER_ID: result = emberAfOnOffClusterServerCommandParse(cmd); break; @@ -173,10 +147,6 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: result = emberAfTargetNavigatorClusterServerCommandParse(cmd); break; - case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: - // No commands are enabled for cluster Temperature Measurement - result = status(false, true, cmd->mfgSpecific); - break; case ZCL_WAKE_ON_LAN_CLUSTER_ID: // No commands are enabled for cluster Wake on LAN result = status(false, true, cmd->mfgSpecific); @@ -251,1096 +221,122 @@ EmberAfStatus emberAfApplicationLauncherClusterServerCommandParse(EmberAfCluster case ZCL_LAUNCH_APP_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; uint8_t * data; - /* TYPE WARNING: array array defaults to */ uint8_t * application; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + emberAfStringLength(data) + 1u); - application = cmd->buffer + payloadOffset; - - wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback(nullptr, data, application); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfAudioOutputClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_RENAME_OUTPUT_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t index; - uint8_t * name; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - name = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfAudioOutputClusterRenameOutputCallback(nullptr, index, name); - break; - } - case ZCL_SELECT_OUTPUT_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t index; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfAudioOutputClusterSelectOutputCallback(nullptr, index); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfBindingClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_BIND_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::NodeId nodeId; - chip::GroupId groupId; - chip::EndpointId endpointId; - chip::ClusterId clusterId; - - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - nodeId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - groupId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - endpointId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - clusterId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfBindingClusterBindCallback(nullptr, nodeId, groupId, endpointId, clusterId); - break; - } - case ZCL_UNBIND_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::NodeId nodeId; - chip::GroupId groupId; - chip::EndpointId endpointId; - chip::ClusterId clusterId; - - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - nodeId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - groupId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - endpointId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - clusterId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfBindingClusterUnbindCallback(nullptr, nodeId, groupId, endpointId, clusterId); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfColorControlClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_MOVE_COLOR_TEMPERATURE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t moveMode; - uint16_t rate; - uint16_t colorTemperatureMinimum; - uint16_t colorTemperatureMaximum; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - rate = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - colorTemperatureMinimum = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - colorTemperatureMaximum = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveColorTemperatureCallback( - nullptr, moveMode, rate, colorTemperatureMinimum, colorTemperatureMaximum, optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_HUE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t moveMode; - uint8_t rate; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveHueCallback(nullptr, moveMode, rate, optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_SATURATION_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t moveMode; - uint8_t rate; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveSaturationCallback(nullptr, moveMode, rate, optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_TO_COLOR_TEMPERATURE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t colorTemperature; - uint16_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - colorTemperature = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveToColorTemperatureCallback(nullptr, colorTemperature, transitionTime, - optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_TO_HUE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t hue; - uint8_t direction; - uint16_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - hue = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - direction = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = - emberAfColorControlClusterMoveToHueCallback(nullptr, hue, direction, transitionTime, optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_TO_HUE_AND_SATURATION_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t hue; - uint8_t saturation; - uint16_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - hue = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - saturation = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveToHueAndSaturationCallback(nullptr, hue, saturation, transitionTime, - optionsMask, optionsOverride); - break; - } - case ZCL_MOVE_TO_SATURATION_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t saturation; - uint16_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - saturation = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterMoveToSaturationCallback(nullptr, saturation, transitionTime, optionsMask, - optionsOverride); - break; - } - case ZCL_STEP_COLOR_TEMPERATURE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t stepMode; - uint16_t stepSize; - uint16_t transitionTime; - uint16_t colorTemperatureMinimum; - uint16_t colorTemperatureMaximum; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepSize = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - colorTemperatureMinimum = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - colorTemperatureMaximum = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterStepColorTemperatureCallback(nullptr, stepMode, stepSize, transitionTime, - colorTemperatureMinimum, colorTemperatureMaximum, - optionsMask, optionsOverride); - break; - } - case ZCL_STEP_HUE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t stepMode; - uint8_t stepSize; - uint8_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterStepHueCallback(nullptr, stepMode, stepSize, transitionTime, optionsMask, - optionsOverride); - break; - } - case ZCL_STEP_SATURATION_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t stepMode; - uint8_t stepSize; - uint8_t transitionTime; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterStepSaturationCallback(nullptr, stepMode, stepSize, transitionTime, optionsMask, - optionsOverride); - break; - } - case ZCL_STOP_MOVE_STEP_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t optionsMask; - uint8_t optionsOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionsOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfColorControlClusterStopMoveStepCallback(nullptr, optionsMask, optionsOverride); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfContentLaunchClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_LAUNCH_CONTENT_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t autoPlay; - uint8_t * data; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - autoPlay = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfContentLaunchClusterLaunchContentCallback(nullptr, autoPlay, data); - break; - } - case ZCL_LAUNCH_URL_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t * contentURL; - uint8_t * displayString; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - contentURL = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + emberAfStringLength(contentURL) + 1u); - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - displayString = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfContentLaunchClusterLaunchURLCallback(nullptr, contentURL, displayString); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfDoorLockClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_CLEAR_ALL_PINS_COMMAND_ID: { - wasHandled = emberAfDoorLockClusterClearAllPinsCallback(nullptr); - break; - } - case ZCL_CLEAR_ALL_RFIDS_COMMAND_ID: { - wasHandled = emberAfDoorLockClusterClearAllRfidsCallback(nullptr); - break; - } - case ZCL_CLEAR_HOLIDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterClearHolidayScheduleCallback(nullptr, scheduleId); - break; - } - case ZCL_CLEAR_PIN_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterClearPinCallback(nullptr, userId); - break; - } - case ZCL_CLEAR_RFID_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterClearRfidCallback(nullptr, userId); - break; - } - case ZCL_CLEAR_WEEKDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterClearWeekdayScheduleCallback(nullptr, scheduleId, userId); - break; - } - case ZCL_CLEAR_YEARDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterClearYeardayScheduleCallback(nullptr, scheduleId, userId); - break; - } - case ZCL_GET_HOLIDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetHolidayScheduleCallback(nullptr, scheduleId); - break; - } - case ZCL_GET_LOG_RECORD_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t logIndex; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - logIndex = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetLogRecordCallback(nullptr, logIndex); - break; - } - case ZCL_GET_PIN_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetPinCallback(nullptr, userId); - break; - } - case ZCL_GET_RFID_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetRfidCallback(nullptr, userId); - break; - } - case ZCL_GET_USER_TYPE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetUserTypeCallback(nullptr, userId); - break; - } - case ZCL_GET_WEEKDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetWeekdayScheduleCallback(nullptr, scheduleId, userId); - break; - } - case ZCL_GET_YEARDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterGetYeardayScheduleCallback(nullptr, scheduleId, userId); - break; - } - case ZCL_SET_HOLIDAY_SCHEDULE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint32_t localStartTime; - uint32_t localEndTime; - uint8_t operatingModeDuringHoliday; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - localStartTime = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 4); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - localEndTime = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 4); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - operatingModeDuringHoliday = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterSetHolidayScheduleCallback(nullptr, scheduleId, localStartTime, localEndTime, - operatingModeDuringHoliday); - break; - } - case ZCL_SET_PIN_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - uint8_t userStatus; - uint8_t userType; - uint8_t * pin; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userStatus = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userType = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - pin = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfDoorLockClusterSetPinCallback(nullptr, userId, userStatus, userType, pin); - break; - } - case ZCL_SET_RFID_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - uint8_t userStatus; - uint8_t userType; - uint8_t * id; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userStatus = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userType = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); + /* TYPE WARNING: array array defaults to */ uint8_t * application; + if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - id = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + emberAfStringLength(data) + 1u); + application = cmd->buffer + payloadOffset; - wasHandled = emberAfDoorLockClusterSetRfidCallback(nullptr, userId, userStatus, userType, id); + wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback(nullptr, data, application); + break; + } + default: { + // Unrecognized command ID, error status will apply. break; } - case ZCL_SET_USER_TYPE_COMMAND_ID: { + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} +EmberAfStatus emberAfAudioOutputClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_RENAME_OUTPUT_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t userId; - uint8_t userType; + uint8_t index; + uint8_t * name; - if (cmd->bufLen < payloadOffset + 2) + if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) + index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - userType = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + name = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfDoorLockClusterSetUserTypeCallback(nullptr, userId, userType); + wasHandled = emberAfAudioOutputClusterRenameOutputCallback(nullptr, index, name); break; } - case ZCL_SET_WEEKDAY_SCHEDULE_COMMAND_ID: { + case ZCL_SELECT_OUTPUT_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - uint8_t daysMask; - uint8_t startHour; - uint8_t startMinute; - uint8_t endHour; - uint8_t endMinute; + uint8_t index; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - daysMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - startHour = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - startMinute = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - endHour = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - endMinute = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfDoorLockClusterSetWeekdayScheduleCallback(nullptr, scheduleId, userId, daysMask, startHour, - startMinute, endHour, endMinute); + wasHandled = emberAfAudioOutputClusterSelectOutputCallback(nullptr, index); + break; + } + default: { + // Unrecognized command ID, error status will apply. break; } - case ZCL_SET_YEARDAY_SCHEDULE_COMMAND_ID: { + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} +EmberAfStatus emberAfContentLaunchClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_LAUNCH_CONTENT_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t scheduleId; - uint16_t userId; - uint32_t localStartTime; - uint32_t localEndTime; + uint8_t autoPlay; + uint8_t * data; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - scheduleId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + autoPlay = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - userId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - localStartTime = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 4); - if (cmd->bufLen < payloadOffset + 4) + if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - localEndTime = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); + data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = - emberAfDoorLockClusterSetYeardayScheduleCallback(nullptr, scheduleId, userId, localStartTime, localEndTime); + wasHandled = emberAfContentLaunchClusterLaunchContentCallback(nullptr, autoPlay, data); break; } - case ZCL_UNLOCK_WITH_TIMEOUT_COMMAND_ID: { + case ZCL_LAUNCH_URL_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t timeoutInSeconds; - uint8_t * pin; + uint8_t * contentURL; + uint8_t * displayString; - if (cmd->bufLen < payloadOffset + 2) + if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - timeoutInSeconds = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); + contentURL = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + emberAfStringLength(contentURL) + 1u); if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - pin = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + displayString = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfDoorLockClusterUnlockWithTimeoutCallback(nullptr, timeoutInSeconds, pin); + wasHandled = emberAfContentLaunchClusterLaunchURLCallback(nullptr, contentURL, displayString); break; } default: { @@ -1433,42 +429,6 @@ EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfCluste } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfIasZoneClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_ZONE_ENROLL_RESPONSE_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t enrollResponseCode; - uint8_t zoneId; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - enrollResponseCode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - zoneId = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfIasZoneClusterZoneEnrollResponseCallback(nullptr, enrollResponseCode, zoneId); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} EmberAfStatus emberAfKeypadInputClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -1662,155 +622,6 @@ EmberAfStatus emberAfMediaPlaybackClusterServerCommandParse(EmberAfClusterComman } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfNetworkCommissioningClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_DISABLE_NETWORK_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::ByteSpan networkID; - uint64_t breadcrumb; - uint32_t timeoutMs; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - { - uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - networkID = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); - } - payloadOffset = static_cast(payloadOffset + networkID.size() + 1u); - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterDisableNetworkCallback(nullptr, networkID, breadcrumb, timeoutMs); - break; - } - case ZCL_ENABLE_NETWORK_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::ByteSpan networkID; - uint64_t breadcrumb; - uint32_t timeoutMs; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - { - uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - networkID = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); - } - payloadOffset = static_cast(payloadOffset + networkID.size() + 1u); - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterEnableNetworkCallback(nullptr, networkID, breadcrumb, timeoutMs); - break; - } - case ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint32_t timeoutMs; - - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(nullptr, timeoutMs); - break; - } - case ZCL_REMOVE_NETWORK_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::ByteSpan NetworkID; - uint64_t Breadcrumb; - uint32_t TimeoutMs; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - { - uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - NetworkID = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); - } - payloadOffset = static_cast(payloadOffset + NetworkID.size() + 1u); - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - Breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - TimeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterRemoveNetworkCallback(nullptr, NetworkID, Breadcrumb, TimeoutMs); - break; - } - case ZCL_SCAN_NETWORKS_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - chip::ByteSpan ssid; - uint64_t breadcrumb; - uint32_t timeoutMs; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - { - uint8_t * rawData = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - ssid = chip::ByteSpan(rawData + 1u, emberAfStringLength(rawData)); - } - payloadOffset = static_cast(payloadOffset + ssid.size() + 1u); - if (cmd->bufLen < payloadOffset + 8) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - breadcrumb = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 8); - if (cmd->bufLen < payloadOffset + 4) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - timeoutMs = emberAfGetInt32u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfNetworkCommissioningClusterScanNetworksCallback(nullptr, ssid, breadcrumb, timeoutMs); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index 5d89bd17988000..952b0bd3dbed56 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -41,33 +41,18 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_AUDIO_OUTPUT_CLUSTER_ID: emberAfAudioOutputClusterInitCallback(endpoint); break; - case ZCL_BARRIER_CONTROL_CLUSTER_ID: - emberAfBarrierControlClusterInitCallback(endpoint); - break; - case ZCL_BINDING_CLUSTER_ID: - emberAfBindingClusterInitCallback(endpoint); - break; case ZCL_COLOR_CONTROL_CLUSTER_ID: emberAfColorControlClusterInitCallback(endpoint); break; case ZCL_CONTENT_LAUNCH_CLUSTER_ID: emberAfContentLaunchClusterInitCallback(endpoint); break; - case ZCL_DOOR_LOCK_CLUSTER_ID: - emberAfDoorLockClusterInitCallback(endpoint); - break; case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: emberAfGeneralCommissioningClusterInitCallback(endpoint); break; - case ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID: - emberAfGroupKeyManagementClusterInitCallback(endpoint); - break; case ZCL_GROUPS_CLUSTER_ID: emberAfGroupsClusterInitCallback(endpoint); break; - case ZCL_IAS_ZONE_CLUSTER_ID: - emberAfIasZoneClusterInitCallback(endpoint); - break; case ZCL_IDENTIFY_CLUSTER_ID: emberAfIdentifyClusterInitCallback(endpoint); break; @@ -86,9 +71,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: emberAfMediaPlaybackClusterInitCallback(endpoint); break; - case ZCL_NETWORK_COMMISSIONING_CLUSTER_ID: - emberAfNetworkCommissioningClusterInitCallback(endpoint); - break; case ZCL_ON_OFF_CLUSTER_ID: emberAfOnOffClusterInitCallback(endpoint); break; @@ -101,9 +83,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: emberAfTargetNavigatorClusterInitCallback(endpoint); break; - case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: - emberAfTemperatureMeasurementClusterInitCallback(endpoint); - break; case ZCL_WAKE_ON_LAN_CLUSTER_ID: emberAfWakeOnLanClusterInitCallback(endpoint); break; @@ -133,16 +112,6 @@ void __attribute__((weak)) emberAfAudioOutputClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfBarrierControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} -void __attribute__((weak)) emberAfBindingClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfColorControlClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -153,31 +122,16 @@ void __attribute__((weak)) emberAfContentLaunchClusterInitCallback(EndpointId en // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfDoorLockClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfGeneralCommissioningClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfGroupKeyManagementClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfGroupsClusterInitCallback(EndpointId endpoint) { // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfIasZoneClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfIdentifyClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -208,11 +162,6 @@ void __attribute__((weak)) emberAfMediaPlaybackClusterInitCallback(EndpointId en // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfNetworkCommissioningClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -233,11 +182,6 @@ void __attribute__((weak)) emberAfTargetNavigatorClusterInitCallback(EndpointId // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfWakeOnLanClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index cce8e153396db9..b48e438e919777 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -72,22 +72,6 @@ void emberAfApplicationLauncherClusterInitCallback(chip::EndpointId endpoint); */ void emberAfAudioOutputClusterInitCallback(chip::EndpointId endpoint); -/** @brief Barrier Control Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfBarrierControlClusterInitCallback(chip::EndpointId endpoint); - -/** @brief Binding Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfBindingClusterInitCallback(chip::EndpointId endpoint); - /** @brief Color Control Cluster Init * * Cluster Init @@ -104,14 +88,6 @@ void emberAfColorControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfContentLaunchClusterInitCallback(chip::EndpointId endpoint); -/** @brief Door Lock Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfDoorLockClusterInitCallback(chip::EndpointId endpoint); - /** @brief General Commissioning Cluster Init * * Cluster Init @@ -120,14 +96,6 @@ void emberAfDoorLockClusterInitCallback(chip::EndpointId endpoint); */ void emberAfGeneralCommissioningClusterInitCallback(chip::EndpointId endpoint); -/** @brief Group Key Management Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfGroupKeyManagementClusterInitCallback(chip::EndpointId endpoint); - /** @brief Groups Cluster Init * * Cluster Init @@ -136,14 +104,6 @@ void emberAfGroupKeyManagementClusterInitCallback(chip::EndpointId endpoint); */ void emberAfGroupsClusterInitCallback(chip::EndpointId endpoint); -/** @brief IAS Zone Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIasZoneClusterInitCallback(chip::EndpointId endpoint); - /** @brief Identify Cluster Init * * Cluster Init @@ -192,14 +152,6 @@ void emberAfMediaInputClusterInitCallback(chip::EndpointId endpoint); */ void emberAfMediaPlaybackClusterInitCallback(chip::EndpointId endpoint); -/** @brief Network Commissioning Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfNetworkCommissioningClusterInitCallback(chip::EndpointId endpoint); - /** @brief On/off Cluster Init * * Cluster Init @@ -232,14 +184,6 @@ void emberAfTvChannelClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTargetNavigatorClusterInitCallback(chip::EndpointId endpoint); -/** @brief Temperature Measurement Cluster Init - * - * Cluster Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); - /** @brief Wake on LAN Cluster Init * * Cluster Init @@ -533,27 +477,27 @@ EmberAfStatus emberAfAudioOutputClusterServerPreAttributeChangedCallback(chip::E void emberAfAudioOutputClusterServerTickCallback(chip::EndpointId endpoint); // -// Barrier Control Cluster server +// Color Control Cluster server // -/** @brief Barrier Control Cluster Server Init +/** @brief Color Control Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfBarrierControlClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfColorControlClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Barrier Control Cluster Server Attribute Changed +/** @brief Color Control Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfBarrierControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfColorControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Barrier Control Cluster Server Manufacturer Specific Attribute Changed +/** @brief Color Control Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -561,11 +505,11 @@ void emberAfBarrierControlClusterServerAttributeChangedCallback(chip::EndpointId * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfBarrierControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfColorControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Barrier Control Cluster Server Message Sent +/** @brief Color Control Cluster Server Message Sent * * Server Message Sent * @@ -576,11 +520,11 @@ void emberAfBarrierControlClusterServerManufacturerSpecificAttributeChangedCallb * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBarrierControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Barrier Control Cluster Server Pre Attribute Changed +/** @brief Color Control Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -590,41 +534,40 @@ void emberAfBarrierControlClusterServerMessageSentCallback(EmberOutgoingMessageT * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfBarrierControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfColorControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Barrier Control Cluster Server Tick +/** @brief Color Control Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfBarrierControlClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfColorControlClusterServerTickCallback(chip::EndpointId endpoint); // -// Binding Cluster server +// Content Launch Cluster server // -/** @brief Binding Cluster Server Init +/** @brief Content Launch Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfBindingClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfContentLaunchClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Binding Cluster Server Attribute Changed +/** @brief Content Launch Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfBindingClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Binding Cluster Server Manufacturer Specific Attribute Changed +/** @brief Content Launch Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -632,11 +575,11 @@ void emberAfBindingClusterServerAttributeChangedCallback(chip::EndpointId endpoi * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfBindingClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Binding Cluster Server Message Sent +/** @brief Content Launch Cluster Server Message Sent * * Server Message Sent * @@ -647,11 +590,11 @@ void emberAfBindingClusterServerManufacturerSpecificAttributeChangedCallback(chi * @param message The message that was sent * @param status The status of the sent message */ -void emberAfBindingClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Binding Cluster Server Pre Attribute Changed +/** @brief Content Launch Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -661,40 +604,40 @@ void emberAfBindingClusterServerMessageSentCallback(EmberOutgoingMessageType typ * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfBindingClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfContentLaunchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Binding Cluster Server Tick +/** @brief Content Launch Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfBindingClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfContentLaunchClusterServerTickCallback(chip::EndpointId endpoint); // -// Color Control Cluster server +// General Commissioning Cluster server // -/** @brief Color Control Cluster Server Init +/** @brief General Commissioning Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfColorControlClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfGeneralCommissioningClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Color Control Cluster Server Attribute Changed +/** @brief General Commissioning Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfColorControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfGeneralCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Color Control Cluster Server Manufacturer Specific Attribute Changed +/** @brief General Commissioning Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -702,11 +645,11 @@ void emberAfColorControlClusterServerAttributeChangedCallback(chip::EndpointId e * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfColorControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Color Control Cluster Server Message Sent +/** @brief General Commissioning Cluster Server Message Sent * * Server Message Sent * @@ -717,11 +660,11 @@ void emberAfColorControlClusterServerManufacturerSpecificAttributeChangedCallbac * @param message The message that was sent * @param status The status of the sent message */ -void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Color Control Cluster Server Pre Attribute Changed +/** @brief General Commissioning Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -731,40 +674,41 @@ void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfColorControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Color Control Cluster Server Tick +/** @brief General Commissioning Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfColorControlClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfGeneralCommissioningClusterServerTickCallback(chip::EndpointId endpoint); // -// Content Launch Cluster server +// Groups Cluster server // -/** @brief Content Launch Cluster Server Init +/** @brief Groups Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfContentLaunchClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfGroupsClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Content Launch Cluster Server Attribute Changed +/** @brief Groups Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfGroupsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Content Launch Cluster Server Manufacturer Specific Attribute Changed +/** @brief Groups Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -772,11 +716,11 @@ void emberAfContentLaunchClusterServerAttributeChangedCallback(chip::EndpointId * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfGroupsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Content Launch Cluster Server Message Sent +/** @brief Groups Cluster Server Message Sent * * Server Message Sent * @@ -787,11 +731,11 @@ void emberAfContentLaunchClusterServerManufacturerSpecificAttributeChangedCallba * @param message The message that was sent * @param status The status of the sent message */ -void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfGroupsClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Content Launch Cluster Server Pre Attribute Changed +/** @brief Groups Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -801,40 +745,40 @@ void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageTy * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfContentLaunchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfGroupsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Content Launch Cluster Server Tick +/** @brief Groups Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfContentLaunchClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfGroupsClusterServerTickCallback(chip::EndpointId endpoint); // -// Door Lock Cluster server +// Identify Cluster server // -/** @brief Door Lock Cluster Server Init +/** @brief Identify Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfDoorLockClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfIdentifyClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Door Lock Cluster Server Attribute Changed +/** @brief Identify Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfDoorLockClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfIdentifyClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Door Lock Cluster Server Manufacturer Specific Attribute Changed +/** @brief Identify Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -842,11 +786,11 @@ void emberAfDoorLockClusterServerAttributeChangedCallback(chip::EndpointId endpo * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfDoorLockClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, +void emberAfIdentifyClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, uint16_t manufacturerCode); -/** @brief Door Lock Cluster Server Message Sent +/** @brief Identify Cluster Server Message Sent * * Server Message Sent * @@ -857,11 +801,11 @@ void emberAfDoorLockClusterServerManufacturerSpecificAttributeChangedCallback(ch * @param message The message that was sent * @param status The status of the sent message */ -void emberAfDoorLockClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, +void emberAfIdentifyClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status); -/** @brief Door Lock Cluster Server Pre Attribute Changed +/** @brief Identify Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -871,40 +815,40 @@ void emberAfDoorLockClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfDoorLockClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, +EmberAfStatus emberAfIdentifyClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, uint8_t size, uint8_t * value); -/** @brief Door Lock Cluster Server Tick +/** @brief Identify Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfDoorLockClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfIdentifyClusterServerTickCallback(chip::EndpointId endpoint); // -// General Commissioning Cluster server +// Keypad Input Cluster server // -/** @brief General Commissioning Cluster Server Init +/** @brief Keypad Input Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfGeneralCommissioningClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfKeypadInputClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief General Commissioning Cluster Server Attribute Changed +/** @brief Keypad Input Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfGeneralCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfKeypadInputClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief General Commissioning Cluster Server Manufacturer Specific Attribute Changed +/** @brief Keypad Input Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -912,11 +856,11 @@ void emberAfGeneralCommissioningClusterServerAttributeChangedCallback(chip::Endp * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfKeypadInputClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief General Commissioning Cluster Server Message Sent +/** @brief Keypad Input Cluster Server Message Sent * * Server Message Sent * @@ -927,11 +871,11 @@ void emberAfGeneralCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfKeypadInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief General Commissioning Cluster Server Pre Attribute Changed +/** @brief Keypad Input Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -941,41 +885,40 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfKeypadInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief General Commissioning Cluster Server Tick +/** @brief Keypad Input Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfGeneralCommissioningClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfKeypadInputClusterServerTickCallback(chip::EndpointId endpoint); // -// Group Key Management Cluster server +// Level Control Cluster server // -/** @brief Group Key Management Cluster Server Init +/** @brief Level Control Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfGroupKeyManagementClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Group Key Management Cluster Server Attribute Changed +/** @brief Level Control Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfGroupKeyManagementClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfLevelControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Group Key Management Cluster Server Manufacturer Specific Attribute Changed +/** @brief Level Control Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -983,11 +926,11 @@ void emberAfGroupKeyManagementClusterServerAttributeChangedCallback(chip::Endpoi * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfGroupKeyManagementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Group Key Management Cluster Server Message Sent +/** @brief Level Control Cluster Server Message Sent * * Server Message Sent * @@ -998,11 +941,11 @@ void emberAfGroupKeyManagementClusterServerManufacturerSpecificAttributeChangedC * @param message The message that was sent * @param status The status of the sent message */ -void emberAfGroupKeyManagementClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Group Key Management Cluster Server Pre Attribute Changed +/** @brief Level Control Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -1012,41 +955,40 @@ void emberAfGroupKeyManagementClusterServerMessageSentCallback(EmberOutgoingMess * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfGroupKeyManagementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Group Key Management Cluster Server Tick +/** @brief Level Control Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfGroupKeyManagementClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint); // -// Groups Cluster server +// Low Power Cluster server // -/** @brief Groups Cluster Server Init +/** @brief Low Power Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfGroupsClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfLowPowerClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Groups Cluster Server Attribute Changed +/** @brief Low Power Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfGroupsClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfLowPowerClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Groups Cluster Server Manufacturer Specific Attribute Changed +/** @brief Low Power Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -1054,361 +996,11 @@ void emberAfGroupsClusterServerAttributeChangedCallback(chip::EndpointId endpoin * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfGroupsClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfLowPowerClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Groups Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfGroupsClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Groups Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfGroupsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief Groups Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfGroupsClusterServerTickCallback(chip::EndpointId endpoint); - -// -// IAS Zone Cluster server -// - -/** @brief IAS Zone Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIasZoneClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief IAS Zone Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfIasZoneClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief IAS Zone Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfIasZoneClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief IAS Zone Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfIasZoneClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief IAS Zone Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfIasZoneClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief IAS Zone Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfIasZoneClusterServerTickCallback(chip::EndpointId endpoint); - -// -// Identify Cluster server -// - -/** @brief Identify Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfIdentifyClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Identify Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfIdentifyClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Identify Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfIdentifyClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Identify Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfIdentifyClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Identify Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfIdentifyClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief Identify Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfIdentifyClusterServerTickCallback(chip::EndpointId endpoint); - -// -// Keypad Input Cluster server -// - -/** @brief Keypad Input Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfKeypadInputClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Keypad Input Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfKeypadInputClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Keypad Input Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfKeypadInputClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Keypad Input Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfKeypadInputClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Keypad Input Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfKeypadInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief Keypad Input Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfKeypadInputClusterServerTickCallback(chip::EndpointId endpoint); - -// -// Level Control Cluster server -// - -/** @brief Level Control Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Level Control Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfLevelControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Level Control Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Level Control Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Level Control Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief Level Control Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint); - -// -// Low Power Cluster server -// - -/** @brief Low Power Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfLowPowerClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Low Power Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfLowPowerClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Low Power Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfLowPowerClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Low Power Cluster Server Message Sent +/** @brief Low Power Cluster Server Message Sent * * Server Message Sent * @@ -1503,110 +1095,40 @@ void emberAfMediaInputClusterServerMessageSentCallback(EmberOutgoingMessageType * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfMediaInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); - -/** @brief Media Input Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfMediaInputClusterServerTickCallback(chip::EndpointId endpoint); - -// -// Media Playback Cluster server -// - -/** @brief Media Playback Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfMediaPlaybackClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Media Playback Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfMediaPlaybackClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Media Playback Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfMediaPlaybackClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Media Playback Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfMediaPlaybackClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Media Playback Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfMediaPlaybackClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfMediaInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Media Playback Cluster Server Tick +/** @brief Media Input Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfMediaPlaybackClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfMediaInputClusterServerTickCallback(chip::EndpointId endpoint); // -// Network Commissioning Cluster server +// Media Playback Cluster server // -/** @brief Network Commissioning Cluster Server Init +/** @brief Media Playback Cluster Server Init * * Server Init * * @param endpoint Endpoint that is being initialized */ -void emberAfNetworkCommissioningClusterServerInitCallback(chip::EndpointId endpoint); +void emberAfMediaPlaybackClusterServerInitCallback(chip::EndpointId endpoint); -/** @brief Network Commissioning Cluster Server Attribute Changed +/** @brief Media Playback Cluster Server Attribute Changed * * Server Attribute Changed * * @param endpoint Endpoint that is being initialized * @param attributeId Attribute that changed */ -void emberAfNetworkCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); +void emberAfMediaPlaybackClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); -/** @brief Network Commissioning Cluster Server Manufacturer Specific Attribute Changed +/** @brief Media Playback Cluster Server Manufacturer Specific Attribute Changed * * Server Manufacturer Specific Attribute Changed * @@ -1614,11 +1136,11 @@ void emberAfNetworkCommissioningClusterServerAttributeChangedCallback(chip::Endp * @param attributeId Attribute that changed * @param manufacturerCode Manufacturer Code of the attribute that changed */ -void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); +void emberAfMediaPlaybackClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); -/** @brief Network Commissioning Cluster Server Message Sent +/** @brief Media Playback Cluster Server Message Sent * * Server Message Sent * @@ -1629,11 +1151,11 @@ void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChange * @param message The message that was sent * @param status The status of the sent message */ -void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); +void emberAfMediaPlaybackClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); -/** @brief Network Commissioning Cluster Server Pre Attribute Changed +/** @brief Media Playback Cluster Server Pre Attribute Changed * * server Pre Attribute Changed * @@ -1643,18 +1165,17 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, - uint8_t * value); +EmberAfStatus emberAfMediaPlaybackClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); -/** @brief Network Commissioning Cluster Server Tick +/** @brief Media Playback Cluster Server Tick * * server Tick * * @param endpoint Endpoint that is being served */ -void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint); +void emberAfMediaPlaybackClusterServerTickCallback(chip::EndpointId endpoint); // // On/off Cluster server @@ -1935,77 +1456,6 @@ EmberAfStatus emberAfTargetNavigatorClusterServerPreAttributeChangedCallback(chi */ void emberAfTargetNavigatorClusterServerTickCallback(chip::EndpointId endpoint); -// -// Temperature Measurement Cluster server -// - -/** @brief Temperature Measurement Cluster Server Init - * - * Server Init - * - * @param endpoint Endpoint that is being initialized - */ -void emberAfTemperatureMeasurementClusterServerInitCallback(chip::EndpointId endpoint); - -/** @brief Temperature Measurement Cluster Server Attribute Changed - * - * Server Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - */ -void emberAfTemperatureMeasurementClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); - -/** @brief Temperature Measurement Cluster Server Manufacturer Specific Attribute Changed - * - * Server Manufacturer Specific Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute that changed - * @param manufacturerCode Manufacturer Code of the attribute that changed - */ -void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - uint16_t manufacturerCode); - -/** @brief Temperature Measurement Cluster Server Message Sent - * - * Server Message Sent - * - * @param type The type of message sent - * @param indexOrDestination The destination or address to which the message was sent - * @param apsFrame The APS frame for the message - * @param msgLen The length of the message - * @param message The message that was sent - * @param status The status of the sent message - */ -void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, - EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, - EmberStatus status); - -/** @brief Temperature Measurement Cluster Server Pre Attribute Changed - * - * server Pre Attribute Changed - * - * @param endpoint Endpoint that is being initialized - * @param attributeId Attribute to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, - chip::AttributeId attributeId, - EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); - -/** @brief Temperature Measurement Cluster Server Tick - * - * server Tick - * - * @param endpoint Endpoint that is being served - */ -void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint); - // // Wake on LAN Cluster server // @@ -2117,160 +1567,6 @@ bool emberAfAudioOutputClusterRenameOutputCallback(chip::app::Command * commandO bool emberAfAudioOutputClusterSelectOutputCallback(chip::app::Command * commandObj, uint8_t index); -/** - * @brief Binding Cluster Bind Command callback - * @param nodeId - * @param groupId - * @param endpointId - * @param clusterId - */ - -bool emberAfBindingClusterBindCallback(chip::app::Command * commandObj, chip::NodeId nodeId, chip::GroupId groupId, - chip::EndpointId endpointId, chip::ClusterId clusterId); - -/** - * @brief Binding Cluster Unbind Command callback - * @param nodeId - * @param groupId - * @param endpointId - * @param clusterId - */ - -bool emberAfBindingClusterUnbindCallback(chip::app::Command * commandObj, chip::NodeId nodeId, chip::GroupId groupId, - chip::EndpointId endpointId, chip::ClusterId clusterId); - -/** - * @brief Color Control Cluster MoveColorTemperature Command callback - * @param moveMode - * @param rate - * @param colorTemperatureMinimum - * @param colorTemperatureMaximum - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveColorTemperatureCallback(chip::app::Command * commandObj, uint8_t moveMode, uint16_t rate, - uint16_t colorTemperatureMinimum, uint16_t colorTemperatureMaximum, - uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveHue Command callback - * @param moveMode - * @param rate - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveHueCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate, uint8_t optionsMask, - uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveSaturation Command callback - * @param moveMode - * @param rate - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveSaturationCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate, - uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveToColorTemperature Command callback - * @param colorTemperature - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveToColorTemperatureCallback(chip::app::Command * commandObj, uint16_t colorTemperature, - uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveToHue Command callback - * @param hue - * @param direction - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveToHueCallback(chip::app::Command * commandObj, uint8_t hue, uint8_t direction, - uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveToHueAndSaturation Command callback - * @param hue - * @param saturation - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveToHueAndSaturationCallback(chip::app::Command * commandObj, uint8_t hue, uint8_t saturation, - uint16_t transitionTime, uint8_t optionsMask, - uint8_t optionsOverride); - -/** - * @brief Color Control Cluster MoveToSaturation Command callback - * @param saturation - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterMoveToSaturationCallback(chip::app::Command * commandObj, uint8_t saturation, - uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster StepColorTemperature Command callback - * @param stepMode - * @param stepSize - * @param transitionTime - * @param colorTemperatureMinimum - * @param colorTemperatureMaximum - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterStepColorTemperatureCallback(chip::app::Command * commandObj, uint8_t stepMode, uint16_t stepSize, - uint16_t transitionTime, uint16_t colorTemperatureMinimum, - uint16_t colorTemperatureMaximum, uint8_t optionsMask, - uint8_t optionsOverride); - -/** - * @brief Color Control Cluster StepHue Command callback - * @param stepMode - * @param stepSize - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterStepHueCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, - uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster StepSaturation Command callback - * @param stepMode - * @param stepSize - * @param transitionTime - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterStepSaturationCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, - uint8_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride); - -/** - * @brief Color Control Cluster StopMoveStep Command callback - * @param optionsMask - * @param optionsOverride - */ - -bool emberAfColorControlClusterStopMoveStepCallback(chip::app::Command * commandObj, uint8_t optionsMask, uint8_t optionsOverride); - /** * @brief Content Launch Cluster LaunchContent Command callback * @param autoPlay @@ -2287,181 +1583,6 @@ bool emberAfContentLaunchClusterLaunchContentCallback(chip::app::Command * comma bool emberAfContentLaunchClusterLaunchURLCallback(chip::app::Command * commandObj, uint8_t * contentURL, uint8_t * displayString); -/** - * @brief Door Lock Cluster ClearAllPins Command callback - */ - -bool emberAfDoorLockClusterClearAllPinsCallback(chip::app::Command * commandObj); - -/** - * @brief Door Lock Cluster ClearAllRfids Command callback - */ - -bool emberAfDoorLockClusterClearAllRfidsCallback(chip::app::Command * commandObj); - -/** - * @brief Door Lock Cluster ClearHolidaySchedule Command callback - * @param scheduleId - */ - -bool emberAfDoorLockClusterClearHolidayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId); - -/** - * @brief Door Lock Cluster ClearPin Command callback - * @param userId - */ - -bool emberAfDoorLockClusterClearPinCallback(chip::app::Command * commandObj, uint16_t userId); - -/** - * @brief Door Lock Cluster ClearRfid Command callback - * @param userId - */ - -bool emberAfDoorLockClusterClearRfidCallback(chip::app::Command * commandObj, uint16_t userId); - -/** - * @brief Door Lock Cluster ClearWeekdaySchedule Command callback - * @param scheduleId - * @param userId - */ - -bool emberAfDoorLockClusterClearWeekdayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId); - -/** - * @brief Door Lock Cluster ClearYeardaySchedule Command callback - * @param scheduleId - * @param userId - */ - -bool emberAfDoorLockClusterClearYeardayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId); - -/** - * @brief Door Lock Cluster GetHolidaySchedule Command callback - * @param scheduleId - */ - -bool emberAfDoorLockClusterGetHolidayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId); - -/** - * @brief Door Lock Cluster GetLogRecord Command callback - * @param logIndex - */ - -bool emberAfDoorLockClusterGetLogRecordCallback(chip::app::Command * commandObj, uint16_t logIndex); - -/** - * @brief Door Lock Cluster GetPin Command callback - * @param userId - */ - -bool emberAfDoorLockClusterGetPinCallback(chip::app::Command * commandObj, uint16_t userId); - -/** - * @brief Door Lock Cluster GetRfid Command callback - * @param userId - */ - -bool emberAfDoorLockClusterGetRfidCallback(chip::app::Command * commandObj, uint16_t userId); - -/** - * @brief Door Lock Cluster GetUserType Command callback - * @param userId - */ - -bool emberAfDoorLockClusterGetUserTypeCallback(chip::app::Command * commandObj, uint16_t userId); - -/** - * @brief Door Lock Cluster GetWeekdaySchedule Command callback - * @param scheduleId - * @param userId - */ - -bool emberAfDoorLockClusterGetWeekdayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId); - -/** - * @brief Door Lock Cluster GetYeardaySchedule Command callback - * @param scheduleId - * @param userId - */ - -bool emberAfDoorLockClusterGetYeardayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId); - -/** - * @brief Door Lock Cluster SetHolidaySchedule Command callback - * @param scheduleId - * @param localStartTime - * @param localEndTime - * @param operatingModeDuringHoliday - */ - -bool emberAfDoorLockClusterSetHolidayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint32_t localStartTime, - uint32_t localEndTime, uint8_t operatingModeDuringHoliday); - -/** - * @brief Door Lock Cluster SetPin Command callback - * @param userId - * @param userStatus - * @param userType - * @param pin - */ - -bool emberAfDoorLockClusterSetPinCallback(chip::app::Command * commandObj, uint16_t userId, uint8_t userStatus, uint8_t userType, - uint8_t * pin); - -/** - * @brief Door Lock Cluster SetRfid Command callback - * @param userId - * @param userStatus - * @param userType - * @param id - */ - -bool emberAfDoorLockClusterSetRfidCallback(chip::app::Command * commandObj, uint16_t userId, uint8_t userStatus, uint8_t userType, - uint8_t * id); - -/** - * @brief Door Lock Cluster SetUserType Command callback - * @param userId - * @param userType - */ - -bool emberAfDoorLockClusterSetUserTypeCallback(chip::app::Command * commandObj, uint16_t userId, uint8_t userType); - -/** - * @brief Door Lock Cluster SetWeekdaySchedule Command callback - * @param scheduleId - * @param userId - * @param daysMask - * @param startHour - * @param startMinute - * @param endHour - * @param endMinute - */ - -bool emberAfDoorLockClusterSetWeekdayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId, - uint8_t daysMask, uint8_t startHour, uint8_t startMinute, uint8_t endHour, - uint8_t endMinute); - -/** - * @brief Door Lock Cluster SetYeardaySchedule Command callback - * @param scheduleId - * @param userId - * @param localStartTime - * @param localEndTime - */ - -bool emberAfDoorLockClusterSetYeardayScheduleCallback(chip::app::Command * commandObj, uint8_t scheduleId, uint16_t userId, - uint32_t localStartTime, uint32_t localEndTime); - -/** - * @brief Door Lock Cluster UnlockWithTimeout Command callback - * @param timeoutInSeconds - * @param pin - */ - -bool emberAfDoorLockClusterUnlockWithTimeoutCallback(chip::app::Command * commandObj, uint16_t timeoutInSeconds, uint8_t * pin); - /** * @brief General Commissioning Cluster ArmFailSafe Command callback * @param expiryLengthSeconds @@ -2489,14 +1610,6 @@ bool emberAfGeneralCommissioningClusterCommissioningCompleteCallback(chip::app:: bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::app::Command * commandObj, uint8_t location, uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs); -/** - * @brief IAS Zone Cluster ZoneEnrollResponse Command callback - * @param enrollResponseCode - * @param zoneId - */ - -bool emberAfIasZoneClusterZoneEnrollResponseCallback(chip::app::Command * commandObj, uint8_t enrollResponseCode, uint8_t zoneId); - /** * @brief Keypad Input Cluster SendKey Command callback * @param keyCode @@ -2606,54 +1719,6 @@ bool emberAfMediaPlaybackClusterMediaStartOverCallback(chip::app::Command * comm bool emberAfMediaPlaybackClusterMediaStopCallback(chip::app::Command * commandObj); -/** - * @brief Network Commissioning Cluster DisableNetwork Command callback - * @param networkID - * @param breadcrumb - * @param timeoutMs - */ - -bool emberAfNetworkCommissioningClusterDisableNetworkCallback(chip::app::Command * commandObj, chip::ByteSpan networkID, - uint64_t breadcrumb, uint32_t timeoutMs); - -/** - * @brief Network Commissioning Cluster EnableNetwork Command callback - * @param networkID - * @param breadcrumb - * @param timeoutMs - */ - -bool emberAfNetworkCommissioningClusterEnableNetworkCallback(chip::app::Command * commandObj, chip::ByteSpan networkID, - uint64_t breadcrumb, uint32_t timeoutMs); - -/** - * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback - * @param timeoutMs - */ - -bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(chip::app::Command * commandObj, - uint32_t timeoutMs); - -/** - * @brief Network Commissioning Cluster RemoveNetwork Command callback - * @param networkID - * @param breadcrumb - * @param timeoutMs - */ - -bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(chip::app::Command * commandObj, chip::ByteSpan NetworkID, - uint64_t Breadcrumb, uint32_t TimeoutMs); - -/** - * @brief Network Commissioning Cluster ScanNetworks Command callback - * @param ssid - * @param breadcrumb - * @param timeoutMs - */ - -bool emberAfNetworkCommissioningClusterScanNetworksCallback(chip::app::Command * commandObj, chip::ByteSpan ssid, - uint64_t breadcrumb, uint32_t timeoutMs); - /** * @brief On/off Cluster Off Command callback */ diff --git a/examples/tv-app/tv-common/gen/endpoint_config.h b/examples/tv-app/tv-common/gen/endpoint_config.h index 95fd02872e8c02..6897a4aacd1026 100644 --- a/examples/tv-app/tv-common/gen/endpoint_config.h +++ b/examples/tv-app/tv-common/gen/endpoint_config.h @@ -160,85 +160,6 @@ /* 624 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: General Commissioning (server), big-endian */ \ - \ - /* 656 - FabricId, */ \ - 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 664 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Color Control (server), big-endian */ \ - \ - /* 672 - compensation text, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: IAS Zone (server), big-endian */ \ - \ - /* 926 - IAS CIE address, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Application Basic (server), big-endian */ \ - \ - /* 934 - vendor name, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 966 - application name, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 998 - application id, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Group Key Management (server), big-endian */ \ - \ - /* 1030 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 1284 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #else // !BIGENDIAN_CPU @@ -378,90 +299,11 @@ /* 624 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: General Commissioning (server), little-endian */ \ - \ - /* 656 - FabricId, */ \ - 1, 'o', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 664 - Breadcrumb, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Color Control (server), little-endian */ \ - \ - /* 672 - compensation text, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: IAS Zone (server), little-endian */ \ - \ - /* 926 - IAS CIE address, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Application Basic (server), little-endian */ \ - \ - /* 934 - vendor name, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 966 - application name, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 998 - application id, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* Endpoint: 5, Cluster: Group Key Management (server), little-endian */ \ - \ - /* 1030 - groups, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - \ - /* 1284 - group keys, */ \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (40) +#define GENERATED_DEFAULTS_COUNT (31) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -489,7 +331,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 188 +#define GENERATED_ATTRIBUTE_COUNT 87 #define GENERATED_ATTRIBUTES \ { \ \ @@ -632,141 +474,6 @@ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application satus */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Identify (server) */ \ - { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x0000) }, /* identify time */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Groups (server) */ \ - { 0x0000, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* name support */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Scenes (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* scene count */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current scene */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* current group */ \ - { 0x0003, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* scene valid */ \ - { 0x0004, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* name support */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: On/off (server) */ \ - { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* on/off */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Level Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current level */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: General Commissioning (server) */ \ - { 0x0000, ZAP_TYPE(OCTET_STRING), 8, 0, ZAP_LONG_DEFAULTS_INDEX(656) }, /* FabricId */ \ - { 0x0001, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(664) }, /* Breadcrumb */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Network Commissioning (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Door Lock (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* lock state */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* lock type */ \ - { 0x0002, ZAP_TYPE(BOOLEAN), 1, 0, ZAP_EMPTY_DEFAULT() }, /* actuator enabled */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Barrier Control (server) */ \ - { 0x0001, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier moving state */ \ - { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* barrier safety status */ \ - { 0x0003, ZAP_TYPE(BITMAP8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier capabilities */ \ - { 0x000A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* barrier position */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Color Control (server) */ \ - { 0x0000, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current hue */ \ - { 0x0001, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* current saturation */ \ - { 0x0002, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* remaining time */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ - { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ - { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* drift compensation */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, ZAP_LONG_DEFAULTS_INDEX(672) }, /* compensation text */ \ - { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ - { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ - { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ - { 0x0010, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* number of primaries */ \ - { 0x0011, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 1 x */ \ - { 0x0012, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 1 y */ \ - { 0x0013, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 1 intensity */ \ - { 0x0015, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 2 x */ \ - { 0x0016, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 2 y */ \ - { 0x0017, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 2 intensity */ \ - { 0x0019, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 3 x */ \ - { 0x001A, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 3 y */ \ - { 0x001B, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 3 intensity */ \ - { 0x0020, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 4 x */ \ - { 0x0021, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 4 y */ \ - { 0x0022, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 4 intensity */ \ - { 0x0024, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 5 x */ \ - { 0x0025, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 5 y */ \ - { 0x0026, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 5 intensity */ \ - { 0x0028, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 6 x */ \ - { 0x0029, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* primary 6 y */ \ - { 0x002A, ZAP_TYPE(INT8U), 1, 0, ZAP_EMPTY_DEFAULT() }, /* primary 6 intensity */ \ - { 0x0030, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* white point x */ \ - { 0x0031, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* white point y */ \ - { 0x0032, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point r x */ \ - { 0x0033, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point r y */ \ - { 0x0034, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point r intensity */ \ - { 0x0036, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point g x */ \ - { 0x0037, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point g y */ \ - { 0x0038, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point g intensity */ \ - { 0x003A, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point b x */ \ - { 0x003B, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point b y */ \ - { 0x003C, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_EMPTY_DEFAULT() }, /* color point b intensity */ \ - { 0x4000, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* enhanced current hue */ \ - { 0x4001, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* enhanced color mode */ \ - { 0x4002, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop active */ \ - { 0x4003, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* color loop direction */ \ - { 0x4004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0019) }, /* color loop time */ \ - { 0x400A, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color capabilities */ \ - { 0x400B, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* color temp physical min */ \ - { 0x400C, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0xFEFF) }, /* color temp physical max */ \ - { 0x400D, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* couple color temp to level min-mireds */ \ - { 0x4010, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_EMPTY_DEFAULT() }, /* start up color temperature mireds */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Temperature Measurement (server) */ \ - { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* measured value */ \ - { 0x0001, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* min measured value */ \ - { 0x0002, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* max measured value */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: IAS Zone (server) */ \ - { 0x0000, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x00) }, /* zone state */ \ - { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ - { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ - { 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(926) }, /* IAS CIE address */ \ - { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Low Power (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(934) }, /* vendor name */ \ - { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(966) }, /* application name */ \ - { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(998) }, /* application id */ \ - { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ - { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application satus */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Binding (server) */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ - \ - /* Endpoint: 5, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1030) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1284) }, /* group keys */ \ - { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ } // This is an array of EmberAfCluster structures. @@ -792,18 +499,10 @@ }; \ const EmberAfGenericClusterFunction chipFuncArrayColorControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfColorControlClusterServerInitCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayDoorLockServer[] = { \ - (EmberAfGenericClusterFunction) emberAfDoorLockClusterServerAttributeChangedCallback, \ - }; \ - const EmberAfGenericClusterFunction chipFuncArrayIasZoneServer[] = { \ - (EmberAfGenericClusterFunction) emberAfIasZoneClusterServerInitCallback, \ - (EmberAfGenericClusterFunction) emberAfIasZoneClusterServerMessageSentCallback, \ - (EmberAfGenericClusterFunction) emberAfIasZoneClusterServerPreAttributeChangedCallback, \ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 42 +#define GENERATED_CLUSTER_COUNT 26 #define GENERATED_CLUSTERS \ { \ { 0x0003, \ @@ -908,79 +607,6 @@ { \ 0x050D, ZAP_ATTRIBUTE_INDEX(79), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 4, Cluster: Application Basic (server) */ \ - { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(87), \ - 2, \ - 4, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayIdentifyServer }, /* Endpoint: 5, Cluster: Identify (server) */ \ - { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(89), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayGroupsServer }, /* Endpoint: 5, Cluster: Groups (server) */ \ - { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(91), \ - 6, \ - 8, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayScenesServer }, /* Endpoint: 5, Cluster: Scenes (server) */ \ - { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(97), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayOnOffServer }, /* Endpoint: 5, Cluster: On/off (server) */ \ - { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(99), \ - 2, \ - 3, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayLevelControlServer }, /* Endpoint: 5, Cluster: Level Control (server) */ \ - { \ - 0x0030, ZAP_ATTRIBUTE_INDEX(101), 3, 18, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: General Commissioning (server) */ \ - { \ - 0x0031, ZAP_ATTRIBUTE_INDEX(104), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Network Commissioning (server) */ \ - { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(105), \ - 4, \ - 5, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ - chipFuncArrayDoorLockServer }, /* Endpoint: 5, Cluster: Door Lock (server) */ \ - { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(109), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Barrier Control (server) */ \ - { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(114), \ - 51, \ - 336, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ - chipFuncArrayColorControlServer }, /* Endpoint: 5, Cluster: Color Control (server) */ \ - { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(165), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Temperature Measurement (server) */ \ - { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(169), \ - 6, \ - 16, \ - ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ - ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ - chipFuncArrayIasZoneServer }, /* Endpoint: 5, Cluster: IAS Zone (server) */ \ - { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(175), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Low Power (server) */ \ - { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(176), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Application Basic (server) */ \ - { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(184), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Binding (server) */ \ - { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(185), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ - }, /* Endpoint: 5, Cluster: Group Key Management (server) */ \ } #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index])) @@ -989,61 +615,61 @@ #define GENERATED_ENDPOINT_TYPES \ { \ { ZAP_CLUSTER_INDEX(0), 16, 333 }, { ZAP_CLUSTER_INDEX(16), 3, 38 }, { ZAP_CLUSTER_INDEX(19), 4, 168 }, \ - { ZAP_CLUSTER_INDEX(23), 1, 105 }, { ZAP_CLUSTER_INDEX(24), 2, 107 }, { ZAP_CLUSTER_INDEX(26), 16, 1032 }, \ + { ZAP_CLUSTER_INDEX(23), 1, 105 }, { ZAP_CLUSTER_INDEX(24), 2, 107 }, \ } // Largest attribute size is needed for various buffers -#define ATTRIBUTE_LARGEST (255) +#define ATTRIBUTE_LARGEST (33) // Total size of singleton attributes #define ATTRIBUTE_SINGLETONS_SIZE (0) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (1783) +#define ATTRIBUTE_MAX_SIZE (751) // Number of fixed endpoints -#define FIXED_ENDPOINT_COUNT (6) +#define FIXED_ENDPOINT_COUNT (5) // Array of endpoints that are supported, the data inside // the array is the endpoint number. #define FIXED_ENDPOINT_ARRAY \ { \ - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005 \ + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004 \ } // Array of profile ids #define FIXED_PROFILE_IDS \ { \ - 0x0999, 0x0999, 0x0999, 0x0999, 0x0999, 0x0103 \ + 0x0999, 0x0999, 0x0999, 0x0999, 0x0999 \ } // Array of device ids #define FIXED_DEVICE_IDS \ { \ - 0, 0, 0, 0, 0, 0 \ + 0, 0, 0, 0, 0 \ } // Array of device versions #define FIXED_DEVICE_VERSIONS \ { \ - 1, 1, 1, 1, 1, 1 \ + 1, 1, 1, 1, 1 \ } // Array of endpoint types supported on each endpoint #define FIXED_ENDPOINT_TYPES \ { \ - 0, 1, 2, 3, 4, 5 \ + 0, 1, 2, 3, 4 \ } // Array of networks supported on each endpoint #define FIXED_NETWORKS \ { \ - 0, 0, 0, 0, 0, 0 \ + 0, 0, 0, 0, 0 \ } // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (230) +#define EMBER_AF_GENERATED_COMMAND_COUNT (133) #define GENERATED_COMMANDS \ { \ \ @@ -1223,130 +849,6 @@ { 0x050A, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchContentResponse */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LaunchURL */ \ { 0x050A, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LaunchURLResponse */ \ - \ - /* Endpoint: 5, Cluster: Identify (server) */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Identify */ \ - { 0x0003, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* IdentifyQueryResponse */ \ - { 0x0003, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* IdentifyQuery */ \ - \ - /* Endpoint: 5, Cluster: Groups (server) */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroup */ \ - { 0x0004, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddGroupResponse */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewGroup */ \ - { 0x0004, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewGroupResponse */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetGroupMembership */ \ - { 0x0004, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetGroupMembershipResponse */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveGroup */ \ - { 0x0004, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveGroupResponse */ \ - { 0x0004, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllGroups */ \ - { 0x0004, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddGroupIfIdentifying */ \ - \ - /* Endpoint: 5, Cluster: Scenes (server) */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* AddScene */ \ - { 0x0005, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* AddSceneResponse */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ViewScene */ \ - { 0x0005, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ViewSceneResponse */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveScene */ \ - { 0x0005, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveSceneResponse */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveAllScenes */ \ - { 0x0005, 0x03, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveAllScenesResponse */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StoreScene */ \ - { 0x0005, 0x04, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* StoreSceneResponse */ \ - { 0x0005, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RecallScene */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetSceneMembership */ \ - { 0x0005, 0x06, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSceneMembershipResponse */ \ - \ - /* Endpoint: 5, Cluster: On/off (server) */ \ - { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Off */ \ - { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On */ \ - { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Toggle */ \ - \ - /* Endpoint: 5, Cluster: Level Control (server) */ \ - { 0x0008, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevel */ \ - { 0x0008, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Move */ \ - { 0x0008, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Step */ \ - { 0x0008, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Stop */ \ - { 0x0008, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToLevelWithOnOff */ \ - { 0x0008, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveWithOnOff */ \ - { 0x0008, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepWithOnOff */ \ - { 0x0008, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StopWithOnOff */ \ - \ - /* Endpoint: 5, Cluster: General Commissioning (server) */ \ - { 0x0030, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ArmFailSafe */ \ - { 0x0030, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ArmFailSafeResponse */ \ - { 0x0030, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfig */ \ - { 0x0030, 0x03, \ - ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRegulatoryConfigResponse */ \ - \ - /* Endpoint: 5, Cluster: Network Commissioning (server) */ \ - { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ScanNetworks */ \ - { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ScanNetworksResponse */ \ - { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveNetwork */ \ - { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* RemoveNetworkResponse */ \ - { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* EnableNetwork */ \ - { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* EnableNetworkResponse */ \ - { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* DisableNetwork */ \ - { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* DisableNetworkResponse */ \ - { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ - \ - /* Endpoint: 5, Cluster: Door Lock (server) */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* LockDoor */ \ - { 0x0101, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* LockDoorResponse */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UnlockDoor */ \ - { 0x0101, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* UnlockDoorResponse */ \ - { 0x0101, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* UnlockWithTimeout */ \ - { 0x0101, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetLogRecord */ \ - { 0x0101, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetPin */ \ - { 0x0101, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetPin */ \ - { 0x0101, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearPin */ \ - { 0x0101, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllPins */ \ - { 0x0101, 0x0B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetWeekdaySchedule */ \ - { 0x0101, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetWeekdaySchedule */ \ - { 0x0101, 0x0D, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearWeekdaySchedule */ \ - { 0x0101, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetYeardaySchedule */ \ - { 0x0101, 0x0F, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetYeardaySchedule */ \ - { 0x0101, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearYeardaySchedule */ \ - { 0x0101, 0x11, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetHolidaySchedule */ \ - { 0x0101, 0x12, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetHolidaySchedule */ \ - { 0x0101, 0x13, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearHolidaySchedule */ \ - { 0x0101, 0x14, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetUserType */ \ - { 0x0101, 0x15, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetUserType */ \ - { 0x0101, 0x16, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* SetRfid */ \ - { 0x0101, 0x17, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* GetRfid */ \ - { 0x0101, 0x18, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearRfid */ \ - { 0x0101, 0x19, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* ClearAllRfids */ \ - \ - /* Endpoint: 5, Cluster: Barrier Control (server) */ \ - { 0x0103, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlGoToPercent */ \ - { 0x0103, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* BarrierControlStop */ \ - \ - /* Endpoint: 5, Cluster: Color Control (server) */ \ - { 0x0300, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHue */ \ - { 0x0300, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveHue */ \ - { 0x0300, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepHue */ \ - { 0x0300, 0x03, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToSaturation */ \ - { 0x0300, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveSaturation */ \ - { 0x0300, 0x05, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepSaturation */ \ - { 0x0300, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToHueAndSaturation */ \ - { 0x0300, 0x07, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveToColor */ \ - { 0x0300, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* MoveColor */ \ - { 0x0300, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* StepColor */ \ - { 0x0300, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveToColorTemperature */ \ - { 0x0300, 0x47, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StopMoveStep */ \ - { 0x0300, 0x4B, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* MoveColorTemperature */ \ - { 0x0300, 0x4C, ZAP_COMMAND_MASK(INCOMING_SERVER) | ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* StepColorTemperature */ \ - \ - /* Endpoint: 5, Cluster: IAS Zone (server) */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* ZoneEnrollResponse */ \ - { 0x0500, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneStatusChangeNotification */ \ - { 0x0500, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* ZoneEnrollRequest */ \ - \ - /* Endpoint: 5, Cluster: Low Power (server) */ \ - { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ - \ - /* Endpoint: 5, Cluster: Binding (server) */ \ - { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ - { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ } // Array of EmberAfManufacturerCodeEntry structures for commands. @@ -1381,10 +883,10 @@ #define ZAP_REPORT_DIRECTION(x) ZRD(x) // User options for plugin Reporting -#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (8) +#define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (6) #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS -#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (8) +#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (6) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \ { \ \ @@ -1415,14 +917,4 @@ { \ ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0008, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ }, /* current level */ \ - \ - /* Endpoint: 5, Cluster: Door Lock (server) */ \ - { \ - ZAP_REPORT_DIRECTION(REPORTED), 0x0005, 0x0101, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ - }, /* lock state */ \ - \ - /* Endpoint: 5, Cluster: Temperature Measurement (server) */ \ - { \ - ZAP_REPORT_DIRECTION(REPORTED), 0x0005, 0x0402, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \ - }, /* measured value */ \ } diff --git a/examples/tv-app/tv-common/gen/gen_config.h b/examples/tv-app/tv-common/gen/gen_config.h index d1adf4a88125bf..c65b4259eca82a 100644 --- a/examples/tv-app/tv-common/gen/gen_config.h +++ b/examples/tv-app/tv-common/gen/gen_config.h @@ -30,30 +30,23 @@ /**** Cluster endpoint counts ****/ #define EMBER_AF_ACCOUNT_LOGIN_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (4) +#define EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (3) #define EMBER_AF_APPLICATION_LAUNCHER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_AUDIO_OUTPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_BARRIER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_BINDING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_COLOR_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_CONTENT_LAUNCH_CLUSTER_SERVER_ENDPOINT_COUNT (3) -#define EMBER_AF_DOOR_LOCK_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define EMBER_AF_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define EMBER_AF_IAS_ZONE_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_GENERAL_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_IDENTIFY_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_KEYPAD_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (3) -#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_INPUT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define EMBER_AF_NETWORK_COMMISSIONING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (3) -#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) +#define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TV_CHANNEL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -78,16 +71,6 @@ #define EMBER_AF_PLUGIN_AUDIO_OUTPUT_SERVER #define EMBER_AF_PLUGIN_AUDIO_OUTPUT -// Use this macro to check if the server side of the Barrier Control cluster is included -#define ZCL_USING_BARRIER_CONTROL_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_BARRIER_CONTROL_SERVER -#define EMBER_AF_PLUGIN_BARRIER_CONTROL - -// Use this macro to check if the server side of the Binding cluster is included -#define ZCL_USING_BINDING_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_BINDING_SERVER -#define EMBER_AF_PLUGIN_BINDING - // Use this macro to check if the server side of the Color Control cluster is included #define ZCL_USING_COLOR_CONTROL_CLUSTER_SERVER #define EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER @@ -102,33 +85,16 @@ #define EMBER_AF_PLUGIN_CONTENT_LAUNCH_SERVER #define EMBER_AF_PLUGIN_CONTENT_LAUNCH -// Use this macro to check if the server side of the Door Lock cluster is included -#define ZCL_USING_DOOR_LOCK_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_DOOR_LOCK_SERVER -#define EMBER_AF_PLUGIN_DOOR_LOCK - // Use this macro to check if the server side of the General Commissioning cluster is included #define ZCL_USING_GENERAL_COMMISSIONING_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING_SERVER #define EMBER_AF_PLUGIN_GENERAL_COMMISSIONING -// Use this macro to check if the server side of the Group Key Management cluster is included -#define ZCL_USING_GROUP_KEY_MANAGEMENT_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT_SERVER -#define EMBER_AF_PLUGIN_GROUP_KEY_MANAGEMENT - // Use this macro to check if the server side of the Groups cluster is included #define ZCL_USING_GROUPS_CLUSTER_SERVER #define EMBER_AF_PLUGIN_GROUPS_SERVER #define EMBER_AF_PLUGIN_GROUPS -// Use this macro to check if the server side of the IAS Zone cluster is included -#define ZCL_USING_IAS_ZONE_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_IAS_ZONE_SERVER -#define EMBER_AF_PLUGIN_IAS_ZONE -// User options for server plugin IAS Zone -#define EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE 541 - // Use this macro to check if the server side of the Identify cluster is included #define ZCL_USING_IDENTIFY_CLUSTER_SERVER #define EMBER_AF_PLUGIN_IDENTIFY_SERVER @@ -163,11 +129,6 @@ #define EMBER_AF_PLUGIN_MEDIA_PLAYBACK_SERVER #define EMBER_AF_PLUGIN_MEDIA_PLAYBACK -// Use this macro to check if the server side of the Network Commissioning cluster is included -#define ZCL_USING_NETWORK_COMMISSIONING_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING_SERVER -#define EMBER_AF_PLUGIN_NETWORK_COMMISSIONING - // Use this macro to check if the server side of the On/off cluster is included #define ZCL_USING_ON_OFF_CLUSTER_SERVER #define EMBER_AF_PLUGIN_ON_OFF_SERVER @@ -190,11 +151,6 @@ #define EMBER_AF_PLUGIN_TARGET_NAVIGATOR_SERVER #define EMBER_AF_PLUGIN_TARGET_NAVIGATOR -// Use this macro to check if the server side of the Temperature Measurement cluster is included -#define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_SERVER -#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_SERVER -#define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT - // Use this macro to check if the server side of the Wake on LAN cluster is included #define ZCL_USING_WAKE_ON_LAN_CLUSTER_SERVER #define EMBER_AF_PLUGIN_WAKE_ON_LAN_SERVER diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 6a566987e7a5bb..de9cdb6acfa492 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 26, + "featureLevel": 29, "creator": "zap", "keyValuePairs": [ { @@ -4699,3558 +4699,6 @@ ] } ] - }, - { - "name": "Anonymous Endpoint Type", - "deviceTypeName": "CHIP-All-Clusters-Server", - "deviceTypeCode": 0, - "deviceTypeProfileId": 259, - "clusters": [ - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Identify", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "IdentifyQuery", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Identify", - "code": 3, - "mfgCode": null, - "define": "IDENTIFY_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "IdentifyQueryResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "identify time", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddGroup", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ViewGroup", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetGroupMembership", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveGroup", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveAllGroups", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "AddGroupIfIdentifying", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Groups", - "code": 4, - "mfgCode": null, - "define": "GROUPS_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "AddGroupResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ViewGroupResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetGroupMembershipResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveGroupResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "name support", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "AddScene", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ViewScene", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveScene", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveAllScenes", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StoreScene", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RecallScene", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetSceneMembership", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Scenes", - "code": 5, - "mfgCode": null, - "define": "SCENES_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "AddSceneResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ViewSceneResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveSceneResponse", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveAllScenesResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StoreSceneResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetSceneMembershipResponse", - "code": 6, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "scene count", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current scene", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current group", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "scene valid", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "name support", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Off", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "On", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Toggle", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off", - "code": 6, - "mfgCode": null, - "define": "ON_OFF_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "on/off", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToLevel", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Move", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Step", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Stop", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToLevelWithOnOff", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveWithOnOff", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepWithOnOff", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StopWithOnOff", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Level Control", - "code": 8, - "mfgCode": null, - "define": "LEVEL_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "current level", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic", - "code": 40, - "mfgCode": null, - "define": "BASIC_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MfgSpecificPing", - "code": 0, - "mfgCode": 4098, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Basic", - "code": 40, - "mfgCode": null, - "define": "BASIC_CLUSTER", - "side": "server", - "enabled": 0, - "commands": [ - { - "name": "StartUp", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ShutDown", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Leave", - "code": 2, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "InteractionModelVersion", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorName", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "VendorID", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductName", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "ProductID", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "UserLabel", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Location", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersion", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "HardwareVersionString", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersion", - "code": 9, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "SoftwareVersionString", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ArmFailSafe", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfig", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "General Commissioning", - "code": 48, - "mfgCode": null, - "define": "GENERAL_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ArmFailSafeResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRegulatoryConfigResponse", - "code": 3, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "FabricId", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "o", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Breadcrumb", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ScanNetworks", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveNetwork", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "EnableNetwork", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "DisableNetwork", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLastNetworkCommissioningResult", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Network Commissioning", - "code": 49, - "mfgCode": null, - "define": "NETWORK_COMMISSIONING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ScanNetworksResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "RemoveNetworkResponse", - "code": 11, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "EnableNetworkResponse", - "code": 13, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "DisableNetworkResponse", - "code": 15, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Door Lock", - "code": 257, - "mfgCode": null, - "define": "DOOR_LOCK_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "LockDoor", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UnlockDoor", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UnlockWithTimeout", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetLogRecord", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetPin", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetPin", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearPin", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllPins", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetWeekdaySchedule", - "code": 11, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetWeekdaySchedule", - "code": 12, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearWeekdaySchedule", - "code": 13, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetYeardaySchedule", - "code": 14, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetYeardaySchedule", - "code": 15, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearYeardaySchedule", - "code": 16, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetHolidaySchedule", - "code": 17, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetHolidaySchedule", - "code": 18, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearHolidaySchedule", - "code": 19, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetUserType", - "code": 20, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetUserType", - "code": 21, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "SetRfid", - "code": 22, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "GetRfid", - "code": 23, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearRfid", - "code": 24, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "ClearAllRfids", - "code": 25, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Door Lock", - "code": 257, - "mfgCode": null, - "define": "DOOR_LOCK_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "LockDoorResponse", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "UnlockDoorResponse", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "lock state", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "lock type", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "actuator enabled", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "door state", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enable logging", - "code": 32, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "language", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "led settings", - "code": 34, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "auto relock time", - "code": 35, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "sound volume", - "code": 36, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "operating mode", - "code": 37, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "default configuration register", - "code": 39, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enable local programming", - "code": 40, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enable one touch locking", - "code": 41, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enable inside status led", - "code": 42, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enable privacy mode button", - "code": 43, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "wrong code entry limit", - "code": 48, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "user code temporary disable time", - "code": 49, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "send pin over the air", - "code": 50, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "require pin for rf operation", - "code": 51, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zigbee security level", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "alarm mask", - "code": 64, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "keypad operation event mask", - "code": 65, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "RF operation event mask", - "code": 66, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "manual operation event mask", - "code": 67, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rfid operation event mask", - "code": 68, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "keypad programming event mask", - "code": 69, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rf programming event mask", - "code": 70, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rfid programming event mask", - "code": 71, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Barrier Control", - "code": 259, - "mfgCode": null, - "define": "BARRIER_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "BarrierControlGoToPercent", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "BarrierControlStop", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Barrier Control", - "code": 259, - "mfgCode": null, - "define": "BARRIER_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "barrier moving state", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier safety status", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier capabilities", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier position", - "code": 10, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "MoveToHue", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveHue", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepHue", - "code": 2, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToSaturation", - "code": 3, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveSaturation", - "code": 4, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepSaturation", - "code": 5, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToHueAndSaturation", - "code": 6, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToColor", - "code": 7, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveColor", - "code": 8, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepColor", - "code": 9, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveToColorTemperature", - "code": 10, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StopMoveStep", - "code": 71, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "MoveColorTemperature", - "code": 75, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "StepColorTemperature", - "code": 76, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Color Control", - "code": 768, - "mfgCode": null, - "define": "COLOR_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "current hue", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current saturation", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "remaining time", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current x", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x616B", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "current y", - "code": 4, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x607D", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "drift compensation", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "compensation text", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color temperature", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00FA", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color mode", - "code": 8, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color control options", - "code": 15, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "number of primaries", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 1 x", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 1 y", - "code": 18, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 1 intensity", - "code": 19, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 2 x", - "code": 21, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 2 y", - "code": 22, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 2 intensity", - "code": 23, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 3 x", - "code": 25, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 3 y", - "code": 26, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 3 intensity", - "code": 27, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 4 x", - "code": 32, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 4 y", - "code": 33, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 4 intensity", - "code": 34, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 5 x", - "code": 36, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 5 y", - "code": 37, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 5 intensity", - "code": 38, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 6 x", - "code": 40, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 6 y", - "code": 41, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "primary 6 intensity", - "code": 42, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "white point x", - "code": 48, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "white point y", - "code": 49, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point r x", - "code": 50, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point r y", - "code": 51, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point r intensity", - "code": 52, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point g x", - "code": 54, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point g y", - "code": 55, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point g intensity", - "code": 56, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point b x", - "code": 58, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point b y", - "code": 59, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color point b intensity", - "code": 60, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enhanced current hue", - "code": 16384, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "enhanced color mode", - "code": 16385, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color loop active", - "code": 16386, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color loop direction", - "code": 16387, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color loop time", - "code": 16388, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0019", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color capabilities", - "code": 16394, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color temp physical min", - "code": 16395, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "color temp physical max", - "code": 16396, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xFEFF", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "couple color temp to level min-mireds", - "code": 16397, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "start up color temperature mireds", - "code": 16400, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Temperature Measurement", - "code": 1026, - "mfgCode": null, - "define": "TEMP_MEASUREMENT_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Temperature Measurement", - "code": 1026, - "mfgCode": null, - "define": "TEMP_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "measured value", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "min measured value", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "max measured value", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "tolerance", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 0, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "ZoneEnrollResponse", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 0 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "IAS Zone", - "code": 1280, - "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [ - { - "name": "ZoneStatusChangeNotification", - "code": 0, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 0, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "zone state", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone type", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "zone status", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "IAS CIE address", - "code": 16, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "Zone ID", - "code": 17, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xff", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Low Power", - "code": 1288, - "mfgCode": null, - "define": "LOW_POWER_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Sleep", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Low Power", - "code": 1288, - "mfgCode": null, - "define": "LOW_POWER_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Application Basic", - "code": 1293, - "mfgCode": null, - "define": "APPLICATION_BASIC_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Application Basic", - "code": 1293, - "mfgCode": null, - "define": "APPLICATION_BASIC_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "vendor name", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "vendor id", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "application name", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "product id", - "code": 3, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "application id", - "code": 5, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "catalog vendor id", - "code": 6, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "application satus", - "code": 7, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x01", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Binding", - "code": 61440, - "mfgCode": null, - "define": "BINDING_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ - { - "name": "Bind", - "code": 0, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - }, - { - "name": "Unbind", - "code": 1, - "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Binding", - "code": 61440, - "mfgCode": null, - "define": "BINDING_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Group Key Management", - "code": 61444, - "mfgCode": null, - "define": "GROUP_KEY_MANAGEMENT_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "client", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Group Key Management", - "code": 61444, - "mfgCode": null, - "define": "GROUP_KEY_MANAGEMENT_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ - { - "name": "groups", - "code": 0, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "group keys", - "code": 1, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "cluster revision", - "code": 65533, - "mfgCode": null, - "side": "server", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 0, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - } - ] } ], "endpoints": [ @@ -8259,42 +4707,45 @@ "endpointTypeIndex": 0, "profileId": 2457, "endpointId": 0, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 1, "profileId": 2457, "endpointId": 1, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 2, "profileId": 2457, "endpointId": 2, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 3, "profileId": 2457, "endpointId": 3, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null }, { "endpointTypeName": "Anonymous Endpoint Type", "endpointTypeIndex": 4, "profileId": 2457, "endpointId": 4, - "networkId": 0 - }, - { - "endpointTypeName": "Anonymous Endpoint Type", - "endpointTypeIndex": 5, - "profileId": 259, - "endpointId": 5, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null } ], "log": [] From 06a1db58a3ddc3f7ad36aaf87349f16022e89cb1 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 4 May 2021 18:19:01 +0200 Subject: [PATCH 17/31] [Darwin] Do not push the DNSServiceRegister onto the main dispatch queue (#6444) --- src/platform/Darwin/MdnsImpl.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/platform/Darwin/MdnsImpl.cpp b/src/platform/Darwin/MdnsImpl.cpp index d7aad43b6d3800..111d0956e7f2f4 100644 --- a/src/platform/Darwin/MdnsImpl.cpp +++ b/src/platform/Darwin/MdnsImpl.cpp @@ -297,9 +297,6 @@ CHIP_ERROR Register(uint32_t interfaceId, const char * type, const char * name, VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err), CHIP_ERROR_INTERNAL); - err = DNSServiceSetDispatchQueue(sdRef, chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue()); - VerifyOrReturnError(CheckForSuccess(sdCtx, __func__, err, true), CHIP_ERROR_INTERNAL); - return MdnsContexts::GetInstance().Add(sdCtx, sdRef); } From dab17fb378ffc342d94b754a8f03f8d034b9addf Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 4 May 2021 19:18:41 +0200 Subject: [PATCH 18/31] Add a Test Cluster in order to validate the generation/implementation of the Data Model (#6445) * Add a Test Cluster * Activate the Test Cluster server into multiples ZAP configuration * Update Darwin tests to use the Test Cluster * Update gen/ folders --- .../all-clusters-common/all-clusters-app.zap | 1104 ++++++++-- .../gen/IMClusterCommandHandler.cpp | 41 + .../all-clusters-common/gen/attribute-id.h | 23 + .../gen/attribute-size.cpp | 29 + .../gen/call-command-handler.cpp | 32 + .../all-clusters-common/gen/callback-stub.cpp | 8 + .../all-clusters-common/gen/callback.h | 96 + .../gen/client-command-macro.h | 28 + .../all-clusters-common/gen/cluster-id.h | 3 + .../all-clusters-common/gen/command-id.h | 6 + .../all-clusters-common/gen/endpoint_config.h | 285 ++- .../all-clusters-common/gen/gen_config.h | 6 + .../all-clusters-common/gen/print-cluster.h | 7 + .../esp32/main/CMakeLists.txt | 1 + .../all-clusters-app/esp32/main/component.mk | 1 + .../bridge-common/gen/attribute-id.h | 23 + .../bridge-common/gen/client-command-macro.h | 28 + .../bridge-app/bridge-common/gen/cluster-id.h | 3 + .../bridge-app/bridge-common/gen/command-id.h | 6 + .../bridge-common/gen/print-cluster.h | 7 + examples/chip-tool/chip-tool.zap | 349 +++- .../chip-tool/commands/clusters/Commands.h | 1773 +++++++++++++++-- .../chip-tool/gen/CHIPClientCallbacks.cpp | 33 + examples/chip-tool/gen/CHIPClientCallbacks.h | 2 + examples/chip-tool/gen/CHIPClusters.cpp | 356 ++++ examples/chip-tool/gen/CHIPClusters.h | 71 + examples/chip-tool/gen/CHIPClustersObjc.h | 47 + examples/chip-tool/gen/CHIPClustersObjc.mm | 1160 ++++++++++- .../chip-tool/gen/IMClusterCommandHandler.cpp | 87 + examples/chip-tool/gen/attribute-id.h | 23 + .../chip-tool/gen/call-command-handler.cpp | 33 + examples/chip-tool/gen/callback-stub.cpp | 8 + examples/chip-tool/gen/callback.h | 85 + examples/chip-tool/gen/client-command-macro.h | 28 + examples/chip-tool/gen/cluster-id.h | 3 + examples/chip-tool/gen/command-id.h | 6 + examples/chip-tool/gen/endpoint_config.h | 26 +- examples/chip-tool/gen/gen_config.h | 5 + examples/chip-tool/gen/print-cluster.h | 7 + examples/chip-tool/templates/commands.zapt | 24 + .../lighting-common/gen/attribute-id.h | 23 + .../gen/client-command-macro.h | 28 + .../lighting-common/gen/cluster-id.h | 3 + .../lighting-common/gen/command-id.h | 6 + .../lighting-common/gen/print-cluster.h | 7 + .../lock-app/lock-common/gen/attribute-id.h | 23 + .../lock-common/gen/client-command-macro.h | 28 + .../lock-app/lock-common/gen/cluster-id.h | 3 + .../lock-app/lock-common/gen/command-id.h | 6 + .../lock-app/lock-common/gen/print-cluster.h | 7 + .../esp32/main/gen/attribute-id.h | 23 + .../esp32/main/gen/client-command-macro.h | 28 + .../esp32/main/gen/cluster-id.h | 3 + .../esp32/main/gen/command-id.h | 6 + .../esp32/main/gen/print-cluster.h | 7 + examples/tv-app/tv-common/gen/attribute-id.h | 23 + .../tv-common/gen/client-command-macro.h | 28 + examples/tv-app/tv-common/gen/cluster-id.h | 3 + examples/tv-app/tv-common/gen/command-id.h | 6 + examples/tv-app/tv-common/gen/print-cluster.h | 7 + examples/window-app/common/gen/attribute-id.h | 23 + .../common/gen/client-command-macro.h | 28 + examples/window-app/common/gen/cluster-id.h | 3 + examples/window-app/common/gen/command-id.h | 6 + .../window-app/common/gen/print-cluster.h | 7 + src/app/chip-zcl-zpro-codec-api.h | 281 +++ .../test-cluster-server.cpp | 63 + src/app/encoder.cpp | 453 +++++ src/app/util/util.cpp | 6 + .../templates/app/CHIPClustersObjc-src.zapt | 80 +- src/app/zap-templates/zcl/test-cluster.xml | 82 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.py | 2 + src/controller/controller-clusters.zap | 343 +++- .../python/chip/clusters/CHIPClusters.cpp | 180 ++ .../python/chip/clusters/CHIPClusters.py | 134 ++ .../python/gen/CHIPClientCallbacks.cpp | 33 + .../python/gen/CHIPClientCallbacks.h | 2 + src/controller/python/gen/CHIPClusters.cpp | 356 ++++ src/controller/python/gen/CHIPClusters.h | 71 + src/controller/python/gen/CHIPClustersObjc.h | 47 + src/controller/python/gen/CHIPClustersObjc.mm | 1160 ++++++++++- .../python/gen/IMClusterCommandHandler.cpp | 87 + src/controller/python/gen/attribute-id.h | 23 + .../python/gen/call-command-handler.cpp | 33 + src/controller/python/gen/callback-stub.cpp | 8 + src/controller/python/gen/callback.h | 85 + .../python/gen/client-command-macro.h | 28 + src/controller/python/gen/cluster-id.h | 3 + src/controller/python/gen/command-id.h | 6 + src/controller/python/gen/endpoint_config.h | 26 +- src/controller/python/gen/gen_config.h | 5 + src/controller/python/gen/print-cluster.h | 7 + src/controller/python/local-clusters.zap | 343 +++- src/darwin/Framework/CHIP/chip-tool.zap | 353 +++- .../CHIP/gen/CHIPClientCallbacks.cpp | 33 + .../Framework/CHIP/gen/CHIPClientCallbacks.h | 2 + .../Framework/CHIP/gen/CHIPClusters.cpp | 356 ++++ src/darwin/Framework/CHIP/gen/CHIPClusters.h | 71 + .../Framework/CHIP/gen/CHIPClustersObjc.h | 47 + .../Framework/CHIP/gen/CHIPClustersObjc.mm | 1160 ++++++++++- .../CHIP/gen/IMClusterCommandHandler.cpp | 87 + src/darwin/Framework/CHIP/gen/attribute-id.h | 23 + .../CHIP/gen/call-command-handler.cpp | 33 + .../Framework/CHIP/gen/callback-stub.cpp | 8 + src/darwin/Framework/CHIP/gen/callback.h | 85 + .../Framework/CHIP/gen/client-command-macro.h | 28 + src/darwin/Framework/CHIP/gen/cluster-id.h | 3 + src/darwin/Framework/CHIP/gen/command-id.h | 6 + .../Framework/CHIP/gen/endpoint_config.h | 26 +- src/darwin/Framework/CHIP/gen/gen_config.h | 5 + src/darwin/Framework/CHIP/gen/print-cluster.h | 7 + .../CHIP/templates/clusters-tests.zapt | 55 +- src/darwin/Framework/CHIP/templates/helper.js | 40 +- .../Framework/CHIPTests/CHIPClustersTests.m | 861 ++++++-- 115 files changed, 12638 insertions(+), 797 deletions(-) create mode 100644 src/app/clusters/test-cluster-server/test-cluster-server.cpp create mode 100644 src/app/zap-templates/zcl/test-cluster.xml diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 8c5d88e91d88be..8f3b7d2ba614a7 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -3691,6 +3691,347 @@ } ] }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestSpecificResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "boolean", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap8", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap16", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap32", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap64", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8u", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16u", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32u", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64u", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8s", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16s", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32s", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64s", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum8", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Binding", "code": 61440, @@ -7237,105 +7578,330 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 6 y", + "code": 41, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "primary 6 intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "white point x", + "code": 48, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "white point y", + "code": 49, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r x", + "code": 50, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r y", + "code": 51, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point r intensity", + "code": 52, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g x", + "code": 54, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g y", + "code": 55, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point g intensity", + "code": 56, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b x", + "code": 58, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b y", + "code": 59, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "color point b intensity", + "code": 60, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enhanced current hue", + "code": 16384, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enhanced color mode", + "code": 16385, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "primary 6 y", - "code": 41, + "name": "color loop active", + "code": 16386, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "primary 6 intensity", - "code": 42, + "name": "color loop direction", + "code": 16387, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x00", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "white point x", - "code": 48, + "name": "color loop time", + "code": 16388, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0019", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "white point y", - "code": 49, + "name": "color capabilities", + "code": 16394, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color point r x", - "code": 50, + "name": "color temp physical min", + "code": 16395, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color point r y", - "code": 51, + "name": "color temp physical max", + "code": 16396, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0xFEFF", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color point r intensity", - "code": 52, + "name": "couple color temp to level min-mireds", + "code": 16397, "mfgCode": null, "side": "server", "included": 1, @@ -7349,8 +7915,8 @@ "reportableChange": 0 }, { - "name": "color point g x", - "code": 54, + "name": "start up color temperature mireds", + "code": 16400, "mfgCode": null, "side": "server", "included": 1, @@ -7364,128 +7930,198 @@ "reportableChange": 0 }, { - "name": "color point g y", - "code": 55, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMP_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [], + "attributes": [ { - "name": "color point g intensity", - "code": 56, + "name": "cluster revision", + "code": 65533, "mfgCode": null, - "side": "server", + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMP_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { - "name": "color point b x", - "code": 58, + "name": "measured value", + "code": 0, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", - "reportable": 0, + "defaultValue": "0x8000", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color point b y", - "code": 59, + "name": "min measured value", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x8000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color point b intensity", - "code": 60, + "name": "max measured value", + "code": 2, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x8000", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "enhanced current hue", - "code": 16384, + "name": "tolerance", + "code": 3, "mfgCode": null, "side": "server", - "included": 1, + "included": 0, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", - "reportable": 0, + "defaultValue": "", + "reportable": 1, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "enhanced color mode", - "code": 16385, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "3", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "IAS Zone", + "code": 1280, + "mfgCode": null, + "define": "IAS_ZONE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "color loop active", - "code": 16386, + "name": "ZoneEnrollResponse", + "code": 0, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 + } + ] + }, + { + "name": "IAS Zone", + "code": 1280, + "mfgCode": null, + "define": "IAS_ZONE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ZoneStatusChangeNotification", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 }, { - "name": "color loop direction", - "code": 16387, + "name": "ZoneEnrollRequest", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "zone state", + "code": 0, "mfgCode": null, "side": "server", "included": 1, @@ -7499,23 +8135,23 @@ "reportableChange": 0 }, { - "name": "color loop time", - "code": 16388, + "name": "zone type", + "code": 1, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0019", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color capabilities", - "code": 16394, + "name": "zone status", + "code": 2, "mfgCode": null, "side": "server", "included": 1, @@ -7529,65 +8165,96 @@ "reportableChange": 0 }, { - "name": "color temp physical min", - "code": 16395, + "name": "IAS CIE address", + "code": 16, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "color temp physical max", - "code": 16396, + "name": "Zone ID", + "code": 17, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xFEFF", + "defaultValue": "0xff", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "couple color temp to level min-mireds", - "code": 16397, + "name": "cluster revision", + "code": 65533, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "2", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Low Power", + "code": 1288, + "mfgCode": null, + "define": "LOW_POWER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ { - "name": "start up color temperature mireds", - "code": 16400, + "name": "Sleep", + "code": 0, "mfgCode": null, - "side": "server", + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - }, + } + ] + }, + { + "name": "Low Power", + "code": 1288, + "mfgCode": null, + "define": "LOW_POWER_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [], + "attributes": [ { "name": "cluster revision", "code": 65533, @@ -7597,7 +8264,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -7606,10 +8273,10 @@ ] }, { - "name": "Temperature Measurement", - "code": 1026, + "name": "Application Basic", + "code": 1293, "mfgCode": null, - "define": "TEMP_MEASUREMENT_CLUSTER", + "define": "APPLICATION_BASIC_CLUSTER", "side": "client", "enabled": 0, "commands": [], @@ -7623,7 +8290,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -7632,16 +8299,16 @@ ] }, { - "name": "Temperature Measurement", - "code": 1026, + "name": "Application Basic", + "code": 1293, "mfgCode": null, - "define": "TEMP_MEASUREMENT_CLUSTER", + "define": "APPLICATION_BASIC_CLUSTER", "side": "server", "enabled": 1, "commands": [], "attributes": [ { - "name": "measured value", + "name": "vendor name", "code": 0, "mfgCode": null, "side": "server", @@ -7649,14 +8316,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, + "defaultValue": "", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "min measured value", + "name": "vendor id", "code": 1, "mfgCode": null, "side": "server", @@ -7664,14 +8331,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "max measured value", + "name": "application name", "code": 2, "mfgCode": null, "side": "server", @@ -7679,23 +8346,68 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x8000", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "tolerance", + "name": "product id", "code": 3, "mfgCode": null, "side": "server", - "included": 0, + "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, "defaultValue": "", - "reportable": 1, + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "application id", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "catalog vendor id", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "application satus", + "code": 7, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 @@ -7709,7 +8421,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -7718,20 +8430,28 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Test Cluster", + "code": 1295, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "TEST_CLUSTER", "side": "client", "enabled": 0, "commands": [ { - "name": "ZoneEnrollResponse", + "name": "Test", "code": 0, "mfgCode": null, "source": "client", "incoming": 1, "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 } ], "attributes": [ @@ -7744,7 +8464,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0x0001", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -7753,33 +8473,25 @@ ] }, { - "name": "IAS Zone", - "code": 1280, + "name": "Test Cluster", + "code": 1295, "mfgCode": null, - "define": "IAS_ZONE_CLUSTER", + "define": "TEST_CLUSTER", "side": "server", "enabled": 1, "commands": [ { - "name": "ZoneStatusChangeNotification", + "name": "TestSpecificResponse", "code": 0, "mfgCode": null, "source": "server", "incoming": 1, "outgoing": 1 - }, - { - "name": "ZoneEnrollRequest", - "code": 1, - "mfgCode": null, - "source": "server", - "incoming": 1, - "outgoing": 1 } ], "attributes": [ { - "name": "zone state", + "name": "boolean", "code": 0, "mfgCode": null, "side": "server", @@ -7787,14 +8499,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x00", + "defaultValue": "false", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "zone type", + "name": "bitmap8", "code": 1, "mfgCode": null, "side": "server", @@ -7802,14 +8514,14 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "zone status", + "name": "bitmap16", "code": 2, "mfgCode": null, "side": "server", @@ -7817,233 +8529,195 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0000", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "IAS CIE address", - "code": 16, + "name": "bitmap32", + "code": 3, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "Zone ID", - "code": 17, + "name": "bitmap64", + "code": 4, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0xff", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "cluster revision", - "code": 65533, + "name": "int8u", + "code": 5, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "2", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Low Power", - "code": 1288, - "mfgCode": null, - "define": "LOW_POWER_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [ + }, { - "name": "Sleep", - "code": 0, + "name": "int16u", + "code": 6, "mfgCode": null, - "source": "client", - "incoming": 1, - "outgoing": 1 - } - ], - "attributes": [ + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, { - "name": "cluster revision", - "code": 65533, + "name": "int32u", + "code": 8, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Low Power", - "code": 1288, - "mfgCode": null, - "define": "LOW_POWER_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "cluster revision", - "code": 65533, + "name": "int64u", + "code": 12, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Application Basic", - "code": 1293, - "mfgCode": null, - "define": "APPLICATION_BASIC_CLUSTER", - "side": "client", - "enabled": 0, - "commands": [], - "attributes": [ + }, { - "name": "cluster revision", - "code": 65533, + "name": "int8s", + "code": 13, "mfgCode": null, - "side": "client", + "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x0001", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 - } - ] - }, - { - "name": "Application Basic", - "code": 1293, - "mfgCode": null, - "define": "APPLICATION_BASIC_CLUSTER", - "side": "server", - "enabled": 1, - "commands": [], - "attributes": [ + }, { - "name": "vendor name", - "code": 0, + "name": "int16s", + "code": 14, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "vendor id", - "code": 1, + "name": "int32s", + "code": 16, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "application name", - "code": 2, + "name": "int64s", + "code": 20, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "product id", - "code": 3, + "name": "enum8", + "code": 21, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "application id", - "code": 5, + "name": "enum16", + "code": 22, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": "0", "reportable": 0, "minInterval": 0, "maxInterval": 65344, "reportableChange": 0 }, { - "name": "catalog vendor id", - "code": 6, + "name": "octet_string", + "code": 25, "mfgCode": null, "side": "server", "included": 1, @@ -8057,15 +8731,15 @@ "reportableChange": 0 }, { - "name": "application satus", - "code": 7, + "name": "list_int8u", + "code": 26, "mfgCode": null, "side": "server", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0x01", + "defaultValue": "", "reportable": 0, "minInterval": 0, "maxInterval": 65344, @@ -11204,4 +11878,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp index 5e448886555b09..add9c631d73289 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp @@ -7846,6 +7846,44 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace Scenes +namespace TestCluster { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_TEST_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestCallback(apCommandObj); + break; + } + case ZCL_TEST_NOT_HANDLED_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestNotHandledCallback(apCommandObj); + break; + } + case ZCL_TEST_SPECIFIC_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestSpecificCallback(apCommandObj); + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TEST_CLUSTER_ID); + break; + } + } + } +} + +} // namespace TestCluster + } // namespace clusters void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, @@ -7906,6 +7944,9 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_SCENES_CLUSTER_ID: clusters::Scenes::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; + case ZCL_TEST_CLUSTER_ID: + clusters::TestCluster::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; default: // Unrecognized cluster ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp index a2af3ffbbeb79c..a5e65dbe0558d9 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp @@ -219,6 +219,26 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo } break; } + case 0x050F: // Test Cluster Cluster + { + uint16_t entryOffset = kSizeLengthInBytes; + switch (am->attributeId) + { + case 0x001A: // list_int8u + { + entryLength = 1; + if (((index - 1) * entryLength) > (am->size - entryLength)) + { + ChipLogError(Zcl, "Index %l is invalid.", index); + return 0; + } + entryOffset = static_cast(entryOffset + ((index - 1) * entryLength)); + copyListMember(dest, src, write, &entryOffset, entryLength); // INT8U + break; + } + } + break; + } } return entryLength; @@ -281,6 +301,15 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut break; } break; + case 0x050F: // Test Cluster Cluster + switch (attributeId) + { + case 0x001A: // list_int8u + // uint8_t + entryLength = 1; + break; + } + break; } uint32_t totalSize = kSizeLengthInBytes + (entryCount * entryLength); diff --git a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp index 359ea148d3e8b3..73343ad86fb48c 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp @@ -51,6 +51,7 @@ EmberAfStatus emberAfPumpConfigurationAndControlClusterServerCommandParse(EmberA EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfSwitchClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTemperatureMeasurementClusterServerCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTestClusterClusterServerCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThermostatClusterServerCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) @@ -168,6 +169,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Temperature Measurement result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEST_CLUSTER_ID: + result = emberAfTestClusterClusterServerCommandParse(cmd); + break; case ZCL_THERMOSTAT_CLUSTER_ID: // No commands are enabled for cluster Thermostat result = status(false, true, cmd->mfgSpecific); @@ -2525,3 +2529,31 @@ EmberAfStatus emberAfScenesClusterServerCommandParse(EmberAfClusterCommand * cmd } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfTestClusterClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_TEST_COMMAND_ID: { + wasHandled = emberAfTestClusterClusterTestCallback(nullptr); + break; + } + case ZCL_TEST_NOT_HANDLED_COMMAND_ID: { + wasHandled = emberAfTestClusterClusterTestNotHandledCallback(nullptr); + break; + } + case ZCL_TEST_SPECIFIC_COMMAND_ID: { + wasHandled = emberAfTestClusterClusterTestSpecificCallback(nullptr); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index 3edeb0a239c183..1bbe68114bb09c 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -98,6 +98,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; + case ZCL_TEST_CLUSTER_ID: + emberAfTestClusterClusterInitCallback(endpoint); + break; case ZCL_THERMOSTAT_CLUSTER_ID: emberAfThermostatClusterInitCallback(endpoint); break; @@ -222,6 +225,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfTestClusterClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index 1baf35248f386a..dad543f3dde278 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -224,6 +224,14 @@ void emberAfSwitchClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Test Cluster Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thermostat Cluster Init * * Cluster Init @@ -1851,6 +1859,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallb */ void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint); +// +// Test Cluster Cluster server +// + +/** @brief Test Cluster Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Test Cluster Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTestClusterClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Test Cluster Cluster Server Manufacturer Specific Attribute Changed + * + * Server Manufacturer Specific Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + * @param manufacturerCode Manufacturer Code of the attribute that changed + */ +void emberAfTestClusterClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Test Cluster Cluster Server Message Sent + * + * Server Message Sent + * + * @param type The type of message sent + * @param indexOrDestination The destination or address to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfTestClusterClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Test Cluster Cluster Server Pre Attribute Changed + * + * server Pre Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +EmberAfStatus emberAfTestClusterClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); + +/** @brief Test Cluster Cluster Server Tick + * + * server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTestClusterClusterServerTickCallback(chip::EndpointId endpoint); + // // Thermostat Cluster server // @@ -2724,6 +2802,24 @@ bool emberAfScenesClusterStoreSceneCallback(chip::app::Command * commandObj, uin bool emberAfScenesClusterViewSceneCallback(chip::app::Command * commandObj, uint16_t groupId, uint8_t sceneId); +/** + * @brief Test Cluster Cluster Test Command callback + */ + +bool emberAfTestClusterClusterTestCallback(chip::app::Command * commandObj); + +/** + * @brief Test Cluster Cluster TestNotHandled Command callback + */ + +bool emberAfTestClusterClusterTestNotHandledCallback(chip::app::Command * commandObj); + +/** + * @brief Test Cluster Cluster TestSpecific Command callback + */ + +bool emberAfTestClusterClusterTestSpecificCallback(chip::app::Command * commandObj); + // // Non-Cluster Related Callbacks // diff --git a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h +++ b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/all-clusters-app/all-clusters-common/gen/command-id.h b/examples/all-clusters-app/all-clusters-common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/command-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index 73e3201945103e..782523410a36f1 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -196,9 +196,35 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Test Cluster (server), big-endian */ \ + \ + /* 2150 - bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2154 - bitmap64, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2162 - int32u, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2166 - int64u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2174 - int32s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2178 - int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2186 - octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2196 - list_int8u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 0, Cluster: Group Key Management (server), big-endian */ \ \ - /* 2150 - groups, */ \ + /* 2206 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -214,7 +240,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2404 - group keys, */ \ + /* 2460 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -232,7 +258,7 @@ \ /* Endpoint: 1, Cluster: Descriptor (server), big-endian */ \ \ - /* 2658 - device list, */ \ + /* 2714 - device list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -248,7 +274,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2912 - server list, */ \ + /* 2968 - server list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -264,7 +290,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3166 - client list, */ \ + /* 3222 - client list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -280,7 +306,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3420 - parts list, */ \ + /* 3476 - parts list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -298,7 +324,7 @@ \ /* Endpoint: 1, Cluster: Color Control (server), big-endian */ \ \ - /* 3674 - compensation text, */ \ + /* 3730 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -316,22 +342,48 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), big-endian */ \ \ - /* 3928 - IAS CIE address, */ \ + /* 3984 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Basic (server), big-endian */ \ \ - /* 3936 - vendor name, */ \ + /* 3992 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3968 - application name, */ \ + /* 4024 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4000 - application id, */ \ + /* 4056 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Test Cluster (server), big-endian */ \ + \ + /* 4088 - bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4092 - bitmap64, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4100 - int32u, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4104 - int64u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4112 - int32s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4116 - int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4124 - octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4134 - list_int8u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #else // !BIGENDIAN_CPU @@ -507,9 +559,35 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ + /* Endpoint: 0, Cluster: Test Cluster (server), little-endian */ \ + \ + /* 2150 - bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2154 - bitmap64, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2162 - int32u, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2166 - int64u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2174 - int32s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2178 - int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2186 - octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 2196 - list_int8u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ /* Endpoint: 0, Cluster: Group Key Management (server), little-endian */ \ \ - /* 2150 - groups, */ \ + /* 2206 - groups, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -525,7 +603,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2404 - group keys, */ \ + /* 2460 - group keys, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -543,7 +621,7 @@ \ /* Endpoint: 1, Cluster: Descriptor (server), little-endian */ \ \ - /* 2658 - device list, */ \ + /* 2714 - device list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -559,7 +637,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 2912 - server list, */ \ + /* 2968 - server list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -575,7 +653,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3166 - client list, */ \ + /* 3222 - client list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -591,7 +669,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3420 - parts list, */ \ + /* 3476 - parts list, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -609,7 +687,7 @@ \ /* Endpoint: 1, Cluster: Color Control (server), little-endian */ \ \ - /* 3674 - compensation text, */ \ + /* 3730 - compensation text, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ @@ -627,27 +705,53 @@ \ /* Endpoint: 1, Cluster: IAS Zone (server), little-endian */ \ \ - /* 3928 - IAS CIE address, */ \ + /* 3984 - IAS CIE address, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ /* Endpoint: 1, Cluster: Application Basic (server), little-endian */ \ \ - /* 3936 - vendor name, */ \ + /* 3992 - vendor name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 3968 - application name, */ \ + /* 4024 - application name, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ \ - /* 4000 - application id, */ \ + /* 4056 - application id, */ \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* Endpoint: 1, Cluster: Test Cluster (server), little-endian */ \ + \ + /* 4088 - bitmap32, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4092 - bitmap64, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4100 - int32u, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4104 - int64u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4112 - int32s, */ \ + 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4116 - int64s, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4124 - octet_string, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + \ + /* 4134 - list_int8u, */ \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ } #endif // BIGENDIAN_CPU -#define GENERATED_DEFAULTS_COUNT (30) +#define GENERATED_DEFAULTS_COUNT (46) #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE #define ZAP_LONG_DEFAULTS_INDEX(index) \ @@ -675,7 +779,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 153 +#define GENERATED_ATTRIBUTE_COUNT 189 #define GENERATED_ATTRIBUTES \ { \ \ @@ -726,12 +830,33 @@ { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(1896) }, /* fabrics list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ + /* Endpoint: 0, Cluster: Test Cluster (server) */ \ + { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ + { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ + { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2150) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2154) }, /* bitmap64 */ \ + { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ + { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2162) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2166) }, /* int64u */ \ + { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ + { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2174) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(2178) }, /* int64s */ \ + { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ + { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ + { 0x0019, ZAP_TYPE(OCTET_STRING), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_LONG_DEFAULTS_INDEX(2186) }, /* octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(2196) }, /* list_int8u */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 0, Cluster: Group Key Management (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2150) }, /* groups */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2404) }, /* group keys */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2206) }, /* groups */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2460) }, /* group keys */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Identify (server) */ \ @@ -759,10 +884,10 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ - { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2658) }, /* device list */ \ - { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2912) }, /* server list */ \ - { 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3166) }, /* client list */ \ - { 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3420) }, /* parts list */ \ + { 0x0000, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2714) }, /* device list */ \ + { 0x0001, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(2968) }, /* server list */ \ + { 0x0002, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3222) }, /* client list */ \ + { 0x0003, ZAP_TYPE(ARRAY), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3476) }, /* parts list */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: OTA Software Update Server (server) */ \ @@ -817,7 +942,7 @@ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x616B) }, /* current x */ \ { 0x0004, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x607D) }, /* current y */ \ { 0x0005, ZAP_TYPE(ENUM8), 1, 0, ZAP_EMPTY_DEFAULT() }, /* drift compensation */ \ - { 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3674) }, /* compensation text */ \ + { 0x0006, ZAP_TYPE(CHAR_STRING), 254, 0, ZAP_LONG_DEFAULTS_INDEX(3730) }, /* compensation text */ \ { 0x0007, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x00FA) }, /* color temperature */ \ { 0x0008, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* color mode */ \ { 0x000F, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0x00) }, /* color control options */ \ @@ -875,7 +1000,7 @@ { 0x0001, ZAP_TYPE(ENUM16), 2, 0, ZAP_EMPTY_DEFAULT() }, /* zone type */ \ { 0x0002, ZAP_TYPE(BITMAP16), 2, 0, ZAP_SIMPLE_DEFAULT(0x0000) }, /* zone status */ \ { 0x0010, ZAP_TYPE(IEEE_ADDRESS), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), \ - ZAP_LONG_DEFAULTS_INDEX(3928) }, /* IAS CIE address */ \ + ZAP_LONG_DEFAULTS_INDEX(3984) }, /* IAS CIE address */ \ { 0x0011, ZAP_TYPE(INT8U), 1, 0, ZAP_SIMPLE_DEFAULT(0xff) }, /* Zone ID */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(2) }, /* cluster revision */ \ \ @@ -883,15 +1008,36 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Application Basic (server) */ \ - { 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3936) }, /* vendor name */ \ + { 0x0000, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3992) }, /* vendor name */ \ { 0x0001, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* vendor id */ \ - { 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(3968) }, /* application name */ \ + { 0x0002, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(4024) }, /* application name */ \ { 0x0003, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* product id */ \ - { 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(4000) }, /* application id */ \ + { 0x0005, ZAP_TYPE(CHAR_STRING), 32, 0, ZAP_LONG_DEFAULTS_INDEX(4056) }, /* application id */ \ { 0x0006, ZAP_TYPE(INT16U), 2, 0, ZAP_EMPTY_DEFAULT() }, /* catalog vendor id */ \ { 0x0007, ZAP_TYPE(ENUM8), 1, 0, ZAP_SIMPLE_DEFAULT(0x01) }, /* application satus */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ + /* Endpoint: 1, Cluster: Test Cluster (server) */ \ + { 0x0000, ZAP_TYPE(BOOLEAN), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(false) }, /* boolean */ \ + { 0x0001, ZAP_TYPE(BITMAP8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap8 */ \ + { 0x0002, ZAP_TYPE(BITMAP16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* bitmap16 */ \ + { 0x0003, ZAP_TYPE(BITMAP32), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4088) }, /* bitmap32 */ \ + { 0x0004, ZAP_TYPE(BITMAP64), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4092) }, /* bitmap64 */ \ + { 0x0005, ZAP_TYPE(INT8U), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8u */ \ + { 0x0006, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16u */ \ + { 0x0008, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4100) }, /* int32u */ \ + { 0x000C, ZAP_TYPE(INT64U), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4104) }, /* int64u */ \ + { 0x000D, ZAP_TYPE(INT8S), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int8s */ \ + { 0x000E, ZAP_TYPE(INT16S), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* int16s */ \ + { 0x0010, ZAP_TYPE(INT32S), 4, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4112) }, /* int32s */ \ + { 0x0014, ZAP_TYPE(INT64S), 8, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_LONG_DEFAULTS_INDEX(4116) }, /* int64s */ \ + { 0x0015, ZAP_TYPE(ENUM8), 1, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum8 */ \ + { 0x0016, ZAP_TYPE(ENUM16), 2, ZAP_ATTRIBUTE_MASK(WRITABLE), ZAP_SIMPLE_DEFAULT(0) }, /* enum16 */ \ + { 0x0019, ZAP_TYPE(OCTET_STRING), 10, ZAP_ATTRIBUTE_MASK(WRITABLE), \ + ZAP_LONG_DEFAULTS_INDEX(4124) }, /* octet_string */ \ + { 0x001A, ZAP_TYPE(ARRAY), 10, 0, ZAP_LONG_DEFAULTS_INDEX(4134) }, /* list_int8u */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ /* Endpoint: 1, Cluster: Binding (server) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ @@ -937,7 +1083,7 @@ }; #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 27 +#define GENERATED_CLUSTER_COUNT 29 #define GENERATED_CLUSTERS \ { \ { \ @@ -959,93 +1105,99 @@ 0x003E, ZAP_ATTRIBUTE_INDEX(27), 2, 256, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(29), 18, 71, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 0, Cluster: Test Cluster (server) */ \ + { \ + 0xF000, ZAP_ATTRIBUTE_INDEX(47), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Binding (server) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(30), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(48), 3, 510, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 0, Cluster: Group Key Management (server) */ \ { 0x0003, \ - ZAP_ATTRIBUTE_INDEX(33), \ + ZAP_ATTRIBUTE_INDEX(51), \ 2, \ 4, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayIdentifyServer }, /* Endpoint: 1, Cluster: Identify (server) */ \ { 0x0004, \ - ZAP_ATTRIBUTE_INDEX(35), \ + ZAP_ATTRIBUTE_INDEX(53), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayGroupsServer }, /* Endpoint: 1, Cluster: Groups (server) */ \ { 0x0005, \ - ZAP_ATTRIBUTE_INDEX(37), \ + ZAP_ATTRIBUTE_INDEX(55), \ 6, \ 8, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayScenesServer }, /* Endpoint: 1, Cluster: Scenes (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(43), \ + ZAP_ATTRIBUTE_INDEX(61), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayOnOffServer }, /* Endpoint: 1, Cluster: On/off (server) */ \ { 0x0008, \ - ZAP_ATTRIBUTE_INDEX(45), \ + ZAP_ATTRIBUTE_INDEX(63), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayLevelControlServer }, /* Endpoint: 1, Cluster: Level Control (server) */ \ { \ - 0x001D, ZAP_ATTRIBUTE_INDEX(47), 5, 1018, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x001D, ZAP_ATTRIBUTE_INDEX(65), 5, 1018, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Descriptor (server) */ \ { \ - 0x0029, ZAP_ATTRIBUTE_INDEX(52), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0029, ZAP_ATTRIBUTE_INDEX(70), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: OTA Software Update Server (server) */ \ { \ - 0x002A, ZAP_ATTRIBUTE_INDEX(53), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x002A, ZAP_ATTRIBUTE_INDEX(71), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: OTA Software Update Client (server) */ \ - { 0x003B, ZAP_ATTRIBUTE_INDEX(54), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 1, Cluster: Switch (server) */ \ + { 0x003B, ZAP_ATTRIBUTE_INDEX(72), 3, 4, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 1, Cluster: Switch (server) */ \ { 0x0101, \ - ZAP_ATTRIBUTE_INDEX(57), \ + ZAP_ATTRIBUTE_INDEX(75), \ 4, \ 5, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ chipFuncArrayDoorLockServer }, /* Endpoint: 1, Cluster: Door Lock (server) */ \ { \ - 0x0103, ZAP_ATTRIBUTE_INDEX(61), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0103, ZAP_ATTRIBUTE_INDEX(79), 5, 7, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Barrier Control (server) */ \ { \ - 0x0200, ZAP_ATTRIBUTE_INDEX(66), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0200, ZAP_ATTRIBUTE_INDEX(84), 8, 13, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { \ - 0x0201, ZAP_ATTRIBUTE_INDEX(74), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0201, ZAP_ATTRIBUTE_INDEX(92), 6, 10, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Thermostat (server) */ \ { 0x0300, \ - ZAP_ATTRIBUTE_INDEX(80), \ + ZAP_ATTRIBUTE_INDEX(98), \ 51, \ 336, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ chipFuncArrayColorControlServer }, /* Endpoint: 1, Cluster: Color Control (server) */ \ { \ - 0x0402, ZAP_ATTRIBUTE_INDEX(131), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0402, ZAP_ATTRIBUTE_INDEX(149), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ { 0x0500, \ - ZAP_ATTRIBUTE_INDEX(135), \ + ZAP_ATTRIBUTE_INDEX(153), \ 6, \ 16, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION) | \ ZAP_CLUSTER_MASK(MESSAGE_SENT_FUNCTION), \ chipFuncArrayIasZoneServer }, /* Endpoint: 1, Cluster: IAS Zone (server) */ \ { \ - 0x0508, ZAP_ATTRIBUTE_INDEX(141), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x0508, ZAP_ATTRIBUTE_INDEX(159), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Low Power (server) */ \ { \ - 0x050D, ZAP_ATTRIBUTE_INDEX(142), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050D, ZAP_ATTRIBUTE_INDEX(160), 8, 105, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (server) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(150), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(168), 18, 71, ZAP_CLUSTER_MASK(SERVER), NULL \ + }, /* Endpoint: 1, Cluster: Test Cluster (server) */ \ + { \ + 0xF000, ZAP_ATTRIBUTE_INDEX(186), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL \ }, /* Endpoint: 1, Cluster: Binding (server) */ \ { 0x0006, \ - ZAP_ATTRIBUTE_INDEX(151), \ + ZAP_ATTRIBUTE_INDEX(187), \ 2, \ 3, \ ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -1057,7 +1209,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 7, 2681 }, { ZAP_CLUSTER_INDEX(7), 19, 1551 }, { ZAP_CLUSTER_INDEX(26), 1, 3 }, \ + { ZAP_CLUSTER_INDEX(0), 8, 2752 }, { ZAP_CLUSTER_INDEX(8), 20, 1622 }, { ZAP_CLUSTER_INDEX(28), 1, 3 }, \ } // Largest attribute size is needed for various buffers @@ -1067,7 +1219,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (875) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (4235) +#define ATTRIBUTE_MAX_SIZE (4377) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (3) @@ -1111,7 +1263,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (133) +#define EMBER_AF_GENERATED_COMMAND_COUNT (140) #define GENERATED_COMMANDS \ { \ \ @@ -1155,6 +1307,12 @@ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ \ + /* Endpoint: 0, Cluster: Test Cluster (server) */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ + { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ + { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ + \ /* Endpoint: 0, Cluster: Binding (server) */ \ { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ @@ -1280,6 +1438,11 @@ /* Endpoint: 1, Cluster: Low Power (server) */ \ { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ \ + /* Endpoint: 1, Cluster: Test Cluster (server) */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ + { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ + \ /* Endpoint: 1, Cluster: Binding (server) */ \ { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ diff --git a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h index f59fcfcfc398b0..bb79ede1af6ee5 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/gen_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/gen_config.h @@ -52,6 +52,7 @@ #define EMBER_AF_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_SWITCH_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) +#define EMBER_AF_TEST_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define EMBER_AF_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -183,6 +184,11 @@ #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_SERVER #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT +// Use this macro to check if the server side of the Test Cluster cluster is included +#define ZCL_USING_TEST_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_TEST_CLUSTER_SERVER +#define EMBER_AF_PLUGIN_TEST_CLUSTER + // Use this macro to check if the server side of the Thermostat cluster is included #define ZCL_USING_THERMOSTAT_CLUSTER_SERVER #define EMBER_AF_PLUGIN_THERMOSTAT_SERVER diff --git a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h +++ b/examples/all-clusters-app/all-clusters-common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 3931a2d997b03f..221d2ddc6221e0 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -27,6 +27,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/gen" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" diff --git a/examples/all-clusters-app/esp32/main/component.mk b/examples/all-clusters-app/esp32/main/component.mk index db198b612ffac1..8e1715785e8bb8 100644 --- a/examples/all-clusters-app/esp32/main/component.mk +++ b/examples/all-clusters-app/esp32/main/component.mk @@ -27,6 +27,7 @@ COMPONENT_SRCDIRS := ../third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/gen \ ../third_party/connectedhomeip/src/app/server \ ../third_party/connectedhomeip/src/app/util \ + ../third_party/connectedhomeip/src/app/clusters/test-cluster-server \ ../third_party/connectedhomeip/src/app/clusters/descriptor \ ../third_party/connectedhomeip/src/app/clusters/on-off-server \ ../third_party/connectedhomeip/src/app/clusters/level-control \ diff --git a/examples/bridge-app/bridge-common/gen/attribute-id.h b/examples/bridge-app/bridge-common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/bridge-app/bridge-common/gen/attribute-id.h +++ b/examples/bridge-app/bridge-common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/bridge-app/bridge-common/gen/client-command-macro.h b/examples/bridge-app/bridge-common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/bridge-app/bridge-common/gen/client-command-macro.h +++ b/examples/bridge-app/bridge-common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/bridge-app/bridge-common/gen/cluster-id.h b/examples/bridge-app/bridge-common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/bridge-app/bridge-common/gen/cluster-id.h +++ b/examples/bridge-app/bridge-common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/bridge-app/bridge-common/gen/command-id.h b/examples/bridge-app/bridge-common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/bridge-app/bridge-common/gen/command-id.h +++ b/examples/bridge-app/bridge-common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/bridge-app/bridge-common/gen/print-cluster.h b/examples/bridge-app/bridge-common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/bridge-app/bridge-common/gen/print-cluster.h +++ b/examples/bridge-app/bridge-common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/chip-tool/chip-tool.zap b/examples/chip-tool/chip-tool.zap index 226434a2a82c4a..db6a262eca390d 100644 --- a/examples/chip-tool/chip-tool.zap +++ b/examples/chip-tool/chip-tool.zap @@ -1,5 +1,5 @@ { - "featureLevel": 26, + "featureLevel": 29, "creator": "zap", "keyValuePairs": [ { @@ -5526,6 +5526,347 @@ } ] }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "TestSpecificResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "boolean", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap8", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap16", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap32", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap64", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8u", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16u", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32u", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64u", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8s", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16s", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32s", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64s", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum8", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Binding", "code": 61440, @@ -5686,8 +6027,10 @@ "endpointTypeIndex": 0, "profileId": "0x0103", "endpointId": 1, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index f330eb0333fdfe..7686346bdd8cac 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -82,6 +82,14 @@ static void OnInt64uAttributeResponse(void * context, uint64_t value) command->SetCommandExitStatus(true); } +static void OnInt8sAttributeResponse(void * context, int8_t value) +{ + ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + static void OnInt16sAttributeResponse(void * context, int16_t value) { ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value); @@ -90,6 +98,22 @@ static void OnInt16sAttributeResponse(void * context, int16_t value) command->SetCommandExitStatus(true); } +static void OnInt32sAttributeResponse(void * context, int32_t value) +{ + ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + +static void OnInt64sAttributeResponse(void * context, int64_t value) +{ + ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + static void OnStringAttributeResponse(void * context, const chip::ByteSpan value) { char * str = (char *) malloc(value.size() * sizeof(char)); @@ -628,6 +652,14 @@ static void OnTargetNavigatorClusterNavigateTargetResponse(void * context, uint8 command->SetCommandExitStatus(true); } +static void OnTestClusterClusterTestSpecificResponse(void * context, uint8_t returnValue) +{ + ChipLogProgress(chipTool, "TestClusterClusterTestSpecificResponse"); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries) { ChipLogProgress(chipTool, "OnDescriptorDeviceListListAttributeResponse: %lu entries", count); @@ -733,6 +765,19 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse(void * cont command->SetCommandExitStatus(true); } +static void OnTestClusterListInt8uListAttributeResponse(void * context, uint16_t count, uint8_t * entries) +{ + ChipLogProgress(chipTool, "OnTestClusterListInt8uListAttributeResponse: %lu entries", count); + + for (uint16_t i = 0; i < count; i++) + { + ChipLogProgress(chipTool, "INT8U[%lu]: %" PRIu8 "", i, entries[i]); + } + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + /*----------------------------------------------------------------------------*\ | Cluster Name | ID | |---------------------------------------------------------------------+--------| @@ -765,6 +810,7 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse(void * cont | TvChannel | 0x0504 | | TargetNavigator | 0x0505 | | TemperatureMeasurement | 0x0402 | +| TestCluster | 0x050F | | Thermostat | 0x0201 | | WakeOnLan | 0x0503 | \*----------------------------------------------------------------------------*/ @@ -798,6 +844,7 @@ constexpr chip::ClusterId kSwitchClusterId = 0x003B; constexpr chip::ClusterId kTvChannelClusterId = 0x0504; constexpr chip::ClusterId kTargetNavigatorClusterId = 0x0505; constexpr chip::ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr chip::ClusterId kTestClusterClusterId = 0x050F; constexpr chip::ClusterId kThermostatClusterId = 0x0201; constexpr chip::ClusterId kWakeOnLanClusterId = 0x0503; @@ -12431,32 +12478,42 @@ class ReadTemperatureMeasurementClusterRevision : public ModelCommand }; /*----------------------------------------------------------------------------*\ -| Cluster Thermostat | 0x0201 | +| Cluster TestCluster | 0x050F | |------------------------------------------------------------------------------| | Commands: | | -| * ClearWeeklySchedule | 0x03 | -| * GetRelayStatusLog | 0x04 | -| * GetWeeklySchedule | 0x02 | -| * SetWeeklySchedule | 0x01 | -| * SetpointRaiseLower | 0x00 | +| * Test | 0x00 | +| * TestNotHandled | 0x01 | +| * TestSpecific | 0x02 | |------------------------------------------------------------------------------| | Attributes: | | -| * LocalTemperature | 0x0000 | -| * OccupiedCoolingSetpoint | 0x0011 | -| * OccupiedHeatingSetpoint | 0x0012 | -| * ControlSequenceOfOperation | 0x001B | -| * SystemMode | 0x001C | +| * Boolean | 0x0000 | +| * Bitmap8 | 0x0001 | +| * Bitmap16 | 0x0002 | +| * Bitmap32 | 0x0003 | +| * Bitmap64 | 0x0004 | +| * Int8u | 0x0005 | +| * Int16u | 0x0006 | +| * Int32u | 0x0008 | +| * Int64u | 0x000C | +| * Int8s | 0x000D | +| * Int16s | 0x000E | +| * Int32s | 0x0010 | +| * Int64s | 0x0014 | +| * Enum8 | 0x0015 | +| * Enum16 | 0x0016 | +| * OctetString | 0x0019 | +| * ListInt8u | 0x001A | | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ /* - * Command ClearWeeklySchedule + * Command Test */ -class ThermostatClearWeeklySchedule : public ModelCommand +class TestClusterTest : public ModelCommand { public: - ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); } - ~ThermostatClearWeeklySchedule() + TestClusterTest() : ModelCommand("test") { ModelCommand::AddArguments(); } + ~TestClusterTest() { delete onSuccessCallback; delete onFailureCallback; @@ -12464,11 +12521,11 @@ class ThermostatClearWeeklySchedule : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x03) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ClearWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.Test(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -12479,13 +12536,13 @@ class ThermostatClearWeeklySchedule : public ModelCommand }; /* - * Command GetRelayStatusLog + * Command TestNotHandled */ -class ThermostatGetRelayStatusLog : public ModelCommand +class TestClusterTestNotHandled : public ModelCommand { public: - ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); } - ~ThermostatGetRelayStatusLog() + TestClusterTestNotHandled() : ModelCommand("test-not-handled") { ModelCommand::AddArguments(); } + ~TestClusterTestNotHandled() { delete onSuccessCallback; delete onFailureCallback; @@ -12493,11 +12550,11 @@ class ThermostatGetRelayStatusLog : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x04) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.GetRelayStatusLog(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.TestNotHandled(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -12508,18 +12565,13 @@ class ThermostatGetRelayStatusLog : public ModelCommand }; /* - * Command GetWeeklySchedule + * Command TestSpecific */ -class ThermostatGetWeeklySchedule : public ModelCommand +class TestClusterTestSpecific : public ModelCommand { public: - ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule") - { - AddArgument("daysToReturn", 0, UINT8_MAX, &mDaysToReturn); - AddArgument("modeToReturn", 0, UINT8_MAX, &mModeToReturn); - ModelCommand::AddArguments(); - } - ~ThermostatGetWeeklySchedule() + TestClusterTestSpecific() : ModelCommand("test-specific") { ModelCommand::AddArguments(); } + ~TestClusterTestSpecific() { delete onSuccessCallback; delete onFailureCallback; @@ -12527,37 +12579,30 @@ class ThermostatGetWeeklySchedule : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x02) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x02) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.GetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDaysToReturn, mModeToReturn); + return cluster.TestSpecific(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnTestClusterClusterTestSpecificResponse, + this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - uint8_t mDaysToReturn; - uint8_t mModeToReturn; }; /* - * Command SetWeeklySchedule + * Discover Attributes */ -class ThermostatSetWeeklySchedule : public ModelCommand +class DiscoverTestClusterAttributes : public ModelCommand { public: - ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule") - { - AddArgument("numberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); - AddArgument("dayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); - AddArgument("modeForSequence", 0, UINT8_MAX, &mModeForSequence); - AddArgument("payload", 0, UINT8_MAX, &mPayload); - ModelCommand::AddArguments(); - } - ~ThermostatSetWeeklySchedule() + DiscoverTestClusterAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + + ~DiscoverTestClusterAttributes() { delete onSuccessCallback; delete onFailureCallback; @@ -12565,12 +12610,11 @@ class ThermostatSetWeeklySchedule : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.SetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNumberOfTransitionsForSequence, - mDayOfWeekForSequence, mModeForSequence, mPayload); + return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -12578,25 +12622,21 @@ class ThermostatSetWeeklySchedule : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - uint8_t mNumberOfTransitionsForSequence; - uint8_t mDayOfWeekForSequence; - uint8_t mModeForSequence; - uint8_t mPayload; }; /* - * Command SetpointRaiseLower + * Attribute Boolean */ -class ThermostatSetpointRaiseLower : public ModelCommand +class ReadTestClusterBoolean : public ModelCommand { public: - ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower") + ReadTestClusterBoolean() : ModelCommand("read") { - AddArgument("mode", 0, UINT8_MAX, &mMode); - AddArgument("amount", INT8_MIN, INT8_MAX, &mAmount); + AddArgument("attr-name", "boolean"); ModelCommand::AddArguments(); } - ~ThermostatSetpointRaiseLower() + + ~ReadTestClusterBoolean() { delete onSuccessCallback; delete onFailureCallback; @@ -12604,31 +12644,31 @@ class ThermostatSetpointRaiseLower : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.SetpointRaiseLower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMode, mAmount); + return cluster.ReadAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnBooleanAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - uint8_t mMode; - int8_t mAmount; }; -/* - * Discover Attributes - */ -class DiscoverThermostatAttributes : public ModelCommand +class WriteTestClusterBoolean : public ModelCommand { public: - DiscoverThermostatAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + WriteTestClusterBoolean() : ModelCommand("write") + { + AddArgument("attr-name", "boolean"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } - ~DiscoverThermostatAttributes() + ~WriteTestClusterBoolean() { delete onSuccessCallback; delete onFailureCallback; @@ -12636,11 +12676,11 @@ class DiscoverThermostatAttributes : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.WriteAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -12648,21 +12688,22 @@ class DiscoverThermostatAttributes : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; }; /* - * Attribute LocalTemperature + * Attribute Bitmap8 */ -class ReadThermostatLocalTemperature : public ModelCommand +class ReadTestClusterBitmap8 : public ModelCommand { public: - ReadThermostatLocalTemperature() : ModelCommand("read") + ReadTestClusterBitmap8() : ModelCommand("read") { - AddArgument("attr-name", "local-temperature"); + AddArgument("attr-name", "bitmap8"); ModelCommand::AddArguments(); } - ~ReadThermostatLocalTemperature() + ~ReadTestClusterBitmap8() { delete onSuccessCallback; delete onFailureCallback; @@ -12670,54 +12711,43 @@ class ReadThermostatLocalTemperature : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class ReportThermostatLocalTemperature : public ModelCommand +class WriteTestClusterBitmap8 : public ModelCommand { public: - ReportThermostatLocalTemperature() : ModelCommand("report") + WriteTestClusterBitmap8() : ModelCommand("write") { - AddArgument("attr-name", "local-temperature"); - AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); - AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); - AddArgument("change", INT16_MIN, INT16_MAX, &mChange); + AddArgument("attr-name", "bitmap8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); ModelCommand::AddArguments(); } - ~ReportThermostatLocalTemperature() + ~WriteTestClusterBitmap8() { delete onSuccessCallback; delete onFailureCallback; - delete onReportCallback; } CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x06) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - - CHIP_ERROR err = cluster.ReportAttributeLocalTemperature(onReportCallback->Cancel()); - if (err != CHIP_NO_ERROR) - { - return err; - } - - return cluster.ConfigureAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, - mMaxInterval, mChange); + return cluster.WriteAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -12725,26 +12755,22 @@ class ReportThermostatLocalTemperature : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::Callback::Callback * onReportCallback = - new chip::Callback::Callback(OnInt16sAttributeResponse, this); - uint16_t mMinInterval; - uint16_t mMaxInterval; - int16_t mChange; + uint8_t mValue; }; /* - * Attribute OccupiedCoolingSetpoint + * Attribute Bitmap16 */ -class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand +class ReadTestClusterBitmap16 : public ModelCommand { public: - ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read") + ReadTestClusterBitmap16() : ModelCommand("read") { - AddArgument("attr-name", "occupied-cooling-setpoint"); + AddArgument("attr-name", "bitmap16"); ModelCommand::AddArguments(); } - ~ReadThermostatOccupiedCoolingSetpoint() + ~ReadTestClusterBitmap16() { delete onSuccessCallback; delete onFailureCallback; @@ -12752,31 +12778,31 @@ class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand +class WriteTestClusterBitmap16 : public ModelCommand { public: - WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write") + WriteTestClusterBitmap16() : ModelCommand("write") { - AddArgument("attr-name", "occupied-cooling-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "bitmap16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); ModelCommand::AddArguments(); } - ~WriteThermostatOccupiedCoolingSetpoint() + ~WriteTestClusterBitmap16() { delete onSuccessCallback; delete onFailureCallback; @@ -12784,11 +12810,11 @@ class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.WriteAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + return cluster.WriteAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -12796,22 +12822,22 @@ class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - int16_t mValue; + uint16_t mValue; }; /* - * Attribute OccupiedHeatingSetpoint + * Attribute Bitmap32 */ -class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand +class ReadTestClusterBitmap32 : public ModelCommand { public: - ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read") + ReadTestClusterBitmap32() : ModelCommand("read") { - AddArgument("attr-name", "occupied-heating-setpoint"); + AddArgument("attr-name", "bitmap32"); ModelCommand::AddArguments(); } - ~ReadThermostatOccupiedHeatingSetpoint() + ~ReadTestClusterBitmap32() { delete onSuccessCallback; delete onFailureCallback; @@ -12819,31 +12845,31 @@ class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand +class WriteTestClusterBitmap32 : public ModelCommand { public: - WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write") + WriteTestClusterBitmap32() : ModelCommand("write") { - AddArgument("attr-name", "occupied-heating-setpoint"); - AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + AddArgument("attr-name", "bitmap32"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); ModelCommand::AddArguments(); } - ~WriteThermostatOccupiedHeatingSetpoint() + ~WriteTestClusterBitmap32() { delete onSuccessCallback; delete onFailureCallback; @@ -12851,11 +12877,11 @@ class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.WriteAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + return cluster.WriteAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -12863,22 +12889,22 @@ class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - int16_t mValue; + uint32_t mValue; }; /* - * Attribute ControlSequenceOfOperation + * Attribute Bitmap64 */ -class ReadThermostatControlSequenceOfOperation : public ModelCommand +class ReadTestClusterBitmap64 : public ModelCommand { public: - ReadThermostatControlSequenceOfOperation() : ModelCommand("read") + ReadTestClusterBitmap64() : ModelCommand("read") { - AddArgument("attr-name", "control-sequence-of-operation"); + AddArgument("attr-name", "bitmap64"); ModelCommand::AddArguments(); } - ~ReadThermostatControlSequenceOfOperation() + ~ReadTestClusterBitmap64() { delete onSuccessCallback; delete onFailureCallback; @@ -12886,31 +12912,31 @@ class ReadThermostatControlSequenceOfOperation : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64uAttributeResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class WriteThermostatControlSequenceOfOperation : public ModelCommand +class WriteTestClusterBitmap64 : public ModelCommand { public: - WriteThermostatControlSequenceOfOperation() : ModelCommand("write") + WriteTestClusterBitmap64() : ModelCommand("write") { - AddArgument("attr-name", "control-sequence-of-operation"); - AddArgument("attr-value", 0, UINT8_MAX, &mValue); + AddArgument("attr-name", "bitmap64"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); ModelCommand::AddArguments(); } - ~WriteThermostatControlSequenceOfOperation() + ~WriteTestClusterBitmap64() { delete onSuccessCallback; delete onFailureCallback; @@ -12918,11 +12944,11 @@ class WriteThermostatControlSequenceOfOperation : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.WriteAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + return cluster.WriteAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -12930,22 +12956,22 @@ class WriteThermostatControlSequenceOfOperation : public ModelCommand new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - uint8_t mValue; + uint64_t mValue; }; /* - * Attribute SystemMode + * Attribute Int8u */ -class ReadThermostatSystemMode : public ModelCommand +class ReadTestClusterInt8u : public ModelCommand { public: - ReadThermostatSystemMode() : ModelCommand("read") + ReadTestClusterInt8u() : ModelCommand("read") { - AddArgument("attr-name", "system-mode"); + AddArgument("attr-name", "int8u"); ModelCommand::AddArguments(); } - ~ReadThermostatSystemMode() + ~ReadTestClusterInt8u() { delete onSuccessCallback; delete onFailureCallback; @@ -12953,11 +12979,11 @@ class ReadThermostatSystemMode : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.ReadAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.ReadAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } private: @@ -12967,17 +12993,17 @@ class ReadThermostatSystemMode : public ModelCommand new chip::Callback::Callback(OnDefaultFailureResponse, this); }; -class WriteThermostatSystemMode : public ModelCommand +class WriteTestClusterInt8u : public ModelCommand { public: - WriteThermostatSystemMode() : ModelCommand("write") + WriteTestClusterInt8u() : ModelCommand("write") { - AddArgument("attr-name", "system-mode"); + AddArgument("attr-name", "int8u"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); ModelCommand::AddArguments(); } - ~WriteThermostatSystemMode() + ~WriteTestClusterInt8u() { delete onSuccessCallback; delete onFailureCallback; @@ -12985,11 +13011,11 @@ class WriteThermostatSystemMode : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; cluster.Associate(device, endpointId); - return cluster.WriteAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + return cluster.WriteAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); } private: @@ -13001,18 +13027,18 @@ class WriteThermostatSystemMode : public ModelCommand }; /* - * Attribute ClusterRevision + * Attribute Int16u */ -class ReadThermostatClusterRevision : public ModelCommand +class ReadTestClusterInt16u : public ModelCommand { public: - ReadThermostatClusterRevision() : ModelCommand("read") + ReadTestClusterInt16u() : ModelCommand("read") { - AddArgument("attr-name", "cluster-revision"); + AddArgument("attr-name", "int16u"); ModelCommand::AddArguments(); } - ~ReadThermostatClusterRevision() + ~ReadTestClusterInt16u() { delete onSuccessCallback; delete onFailureCallback; @@ -13020,9 +13046,1318 @@ class ReadThermostatClusterRevision : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); - chip::Controller::ThermostatCluster cluster; + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt16u : public ModelCommand +{ +public: + WriteTestClusterInt16u() : ModelCommand("write") + { + AddArgument("attr-name", "int16u"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt16u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint16_t mValue; +}; + +/* + * Attribute Int32u + */ +class ReadTestClusterInt32u : public ModelCommand +{ +public: + ReadTestClusterInt32u() : ModelCommand("read") + { + AddArgument("attr-name", "int32u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt32u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt32u : public ModelCommand +{ +public: + WriteTestClusterInt32u() : ModelCommand("write") + { + AddArgument("attr-name", "int32u"); + AddArgument("attr-value", 0, UINT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt32u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint32_t mValue; +}; + +/* + * Attribute Int64u + */ +class ReadTestClusterInt64u : public ModelCommand +{ +public: + ReadTestClusterInt64u() : ModelCommand("read") + { + AddArgument("attr-name", "int64u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt64u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt64u : public ModelCommand +{ +public: + WriteTestClusterInt64u() : ModelCommand("write") + { + AddArgument("attr-name", "int64u"); + AddArgument("attr-value", 0, UINT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt64u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint64_t mValue; +}; + +/* + * Attribute Int8s + */ +class ReadTestClusterInt8s : public ModelCommand +{ +public: + ReadTestClusterInt8s() : ModelCommand("read") + { + AddArgument("attr-name", "int8s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt8s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt8s : public ModelCommand +{ +public: + WriteTestClusterInt8s() : ModelCommand("write") + { + AddArgument("attr-name", "int8s"); + AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt8s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int8_t mValue; +}; + +/* + * Attribute Int16s + */ +class ReadTestClusterInt16s : public ModelCommand +{ +public: + ReadTestClusterInt16s() : ModelCommand("read") + { + AddArgument("attr-name", "int16s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt16s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt16s : public ModelCommand +{ +public: + WriteTestClusterInt16s() : ModelCommand("write") + { + AddArgument("attr-name", "int16s"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt16s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute Int32s + */ +class ReadTestClusterInt32s : public ModelCommand +{ +public: + ReadTestClusterInt32s() : ModelCommand("read") + { + AddArgument("attr-name", "int32s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt32s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt32sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt32s : public ModelCommand +{ +public: + WriteTestClusterInt32s() : ModelCommand("write") + { + AddArgument("attr-name", "int32s"); + AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt32s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int32_t mValue; +}; + +/* + * Attribute Int64s + */ +class ReadTestClusterInt64s : public ModelCommand +{ +public: + ReadTestClusterInt64s() : ModelCommand("read") + { + AddArgument("attr-name", "int64s"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterInt64s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt64sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterInt64s : public ModelCommand +{ +public: + WriteTestClusterInt64s() : ModelCommand("write") + { + AddArgument("attr-name", "int64s"); + AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterInt64s() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int64_t mValue; +}; + +/* + * Attribute Enum8 + */ +class ReadTestClusterEnum8 : public ModelCommand +{ +public: + ReadTestClusterEnum8() : ModelCommand("read") + { + AddArgument("attr-name", "enum8"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterEnum8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterEnum8 : public ModelCommand +{ +public: + WriteTestClusterEnum8() : ModelCommand("write") + { + AddArgument("attr-name", "enum8"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterEnum8() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute Enum16 + */ +class ReadTestClusterEnum16 : public ModelCommand +{ +public: + ReadTestClusterEnum16() : ModelCommand("read") + { + AddArgument("attr-name", "enum16"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterEnum16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterEnum16 : public ModelCommand +{ +public: + WriteTestClusterEnum16() : ModelCommand("write") + { + AddArgument("attr-name", "enum16"); + AddArgument("attr-value", 0, UINT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterEnum16() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint16_t mValue; +}; + +/* + * Attribute OctetString + */ +class ReadTestClusterOctetString : public ModelCommand +{ +public: + ReadTestClusterOctetString() : ModelCommand("read") + { + AddArgument("attr-name", "octet-string"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterOctetString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnStringAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteTestClusterOctetString : public ModelCommand +{ +public: + WriteTestClusterOctetString() : ModelCommand("write") + { + AddArgument("attr-name", "octet-string"); + AddArgument("attr-value", &mValue); + ModelCommand::AddArguments(); + } + + ~WriteTestClusterOctetString() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), + chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue))); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + char * mValue; +}; + +/* + * Attribute ListInt8u + */ +class ReadTestClusterListInt8u : public ModelCommand +{ +public: + ReadTestClusterListInt8u() : ModelCommand("read") + { + AddArgument("attr-name", "list-int8u"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterListInt8u() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeListInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnTestClusterListInt8uListAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute ClusterRevision + */ +class ReadTestClusterClusterRevision : public ModelCommand +{ +public: + ReadTestClusterClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadTestClusterClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/*----------------------------------------------------------------------------*\ +| Cluster Thermostat | 0x0201 | +|------------------------------------------------------------------------------| +| Commands: | | +| * ClearWeeklySchedule | 0x03 | +| * GetRelayStatusLog | 0x04 | +| * GetWeeklySchedule | 0x02 | +| * SetWeeklySchedule | 0x01 | +| * SetpointRaiseLower | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * LocalTemperature | 0x0000 | +| * OccupiedCoolingSetpoint | 0x0011 | +| * OccupiedHeatingSetpoint | 0x0012 | +| * ControlSequenceOfOperation | 0x001B | +| * SystemMode | 0x001C | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Command ClearWeeklySchedule + */ +class ThermostatClearWeeklySchedule : public ModelCommand +{ +public: + ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); } + ~ThermostatClearWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x03) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ClearWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Command GetRelayStatusLog + */ +class ThermostatGetRelayStatusLog : public ModelCommand +{ +public: + ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); } + ~ThermostatGetRelayStatusLog() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x04) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.GetRelayStatusLog(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Command GetWeeklySchedule + */ +class ThermostatGetWeeklySchedule : public ModelCommand +{ +public: + ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule") + { + AddArgument("daysToReturn", 0, UINT8_MAX, &mDaysToReturn); + AddArgument("modeToReturn", 0, UINT8_MAX, &mModeToReturn); + ModelCommand::AddArguments(); + } + ~ThermostatGetWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x02) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.GetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDaysToReturn, mModeToReturn); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mDaysToReturn; + uint8_t mModeToReturn; +}; + +/* + * Command SetWeeklySchedule + */ +class ThermostatSetWeeklySchedule : public ModelCommand +{ +public: + ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule") + { + AddArgument("numberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence); + AddArgument("dayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence); + AddArgument("modeForSequence", 0, UINT8_MAX, &mModeForSequence); + AddArgument("payload", 0, UINT8_MAX, &mPayload); + ModelCommand::AddArguments(); + } + ~ThermostatSetWeeklySchedule() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.SetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNumberOfTransitionsForSequence, + mDayOfWeekForSequence, mModeForSequence, mPayload); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mNumberOfTransitionsForSequence; + uint8_t mDayOfWeekForSequence; + uint8_t mModeForSequence; + uint8_t mPayload; +}; + +/* + * Command SetpointRaiseLower + */ +class ThermostatSetpointRaiseLower : public ModelCommand +{ +public: + ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower") + { + AddArgument("mode", 0, UINT8_MAX, &mMode); + AddArgument("amount", INT8_MIN, INT8_MAX, &mAmount); + ModelCommand::AddArguments(); + } + ~ThermostatSetpointRaiseLower() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.SetpointRaiseLower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMode, mAmount); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mMode; + int8_t mAmount; +}; + +/* + * Discover Attributes + */ +class DiscoverThermostatAttributes : public ModelCommand +{ +public: + DiscoverThermostatAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); } + + ~DiscoverThermostatAttributes() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +/* + * Attribute LocalTemperature + */ +class ReadThermostatLocalTemperature : public ModelCommand +{ +public: + ReadThermostatLocalTemperature() : ModelCommand("read") + { + AddArgument("attr-name", "local-temperature"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatLocalTemperature() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class ReportThermostatLocalTemperature : public ModelCommand +{ +public: + ReportThermostatLocalTemperature() : ModelCommand("report") + { + AddArgument("attr-name", "local-temperature"); + AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval); + AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval); + AddArgument("change", INT16_MIN, INT16_MAX, &mChange); + ModelCommand::AddArguments(); + } + + ~ReportThermostatLocalTemperature() + { + delete onSuccessCallback; + delete onFailureCallback; + delete onReportCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x06) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + + CHIP_ERROR err = cluster.ReportAttributeLocalTemperature(onReportCallback->Cancel()); + if (err != CHIP_NO_ERROR) + { + return err; + } + + return cluster.ConfigureAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval, + mMaxInterval, mChange); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::Callback::Callback * onReportCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + uint16_t mMinInterval; + uint16_t mMaxInterval; + int16_t mChange; +}; + +/* + * Attribute OccupiedCoolingSetpoint + */ +class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand +{ +public: + ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read") + { + AddArgument("attr-name", "occupied-cooling-setpoint"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatOccupiedCoolingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand +{ +public: + WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write") + { + AddArgument("attr-name", "occupied-cooling-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatOccupiedCoolingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute OccupiedHeatingSetpoint + */ +class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand +{ +public: + ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read") + { + AddArgument("attr-name", "occupied-heating-setpoint"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatOccupiedHeatingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt16sAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand +{ +public: + WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write") + { + AddArgument("attr-name", "occupied-heating-setpoint"); + AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatOccupiedHeatingSetpoint() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + int16_t mValue; +}; + +/* + * Attribute ControlSequenceOfOperation + */ +class ReadThermostatControlSequenceOfOperation : public ModelCommand +{ +public: + ReadThermostatControlSequenceOfOperation() : ModelCommand("read") + { + AddArgument("attr-name", "control-sequence-of-operation"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatControlSequenceOfOperation() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatControlSequenceOfOperation : public ModelCommand +{ +public: + WriteThermostatControlSequenceOfOperation() : ModelCommand("write") + { + AddArgument("attr-name", "control-sequence-of-operation"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatControlSequenceOfOperation() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute SystemMode + */ +class ReadThermostatSystemMode : public ModelCommand +{ +public: + ReadThermostatSystemMode() : ModelCommand("read") + { + AddArgument("attr-name", "system-mode"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatSystemMode() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.ReadAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnInt8uAttributeResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); +}; + +class WriteThermostatSystemMode : public ModelCommand +{ +public: + WriteThermostatSystemMode() : ModelCommand("write") + { + AddArgument("attr-name", "system-mode"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + ModelCommand::AddArguments(); + } + + ~WriteThermostatSystemMode() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; + cluster.Associate(device, endpointId); + return cluster.WriteAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue); + } + +private: + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onFailureCallback = + new chip::Callback::Callback(OnDefaultFailureResponse, this); + uint8_t mValue; +}; + +/* + * Attribute ClusterRevision + */ +class ReadThermostatClusterRevision : public ModelCommand +{ +public: + ReadThermostatClusterRevision() : ModelCommand("read") + { + AddArgument("attr-name", "cluster-revision"); + ModelCommand::AddArguments(); + } + + ~ReadThermostatClusterRevision() + { + delete onSuccessCallback; + delete onFailureCallback; + } + + CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override + { + ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId); + + chip::Controller::ThermostatCluster cluster; cluster.Associate(device, endpointId); return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); } @@ -13675,6 +15010,53 @@ void registerClusterTemperatureMeasurement(Commands & commands) commands.Register(clusterName, clusterCommands); } +void registerClusterTestCluster(Commands & commands) +{ + const char * clusterName = "TestCluster"; + + commands_list clusterCommands = { + 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(), + 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 registerClusterThermostat(Commands & commands) { const char * clusterName = "Thermostat"; @@ -13745,6 +15127,7 @@ void registerClusters(Commands & commands) registerClusterTvChannel(commands); registerClusterTargetNavigator(commands); registerClusterTemperatureMeasurement(commands); + registerClusterTestCluster(commands); registerClusterThermostat(commands); registerClusterWakeOnLan(commands); } diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.cpp b/examples/chip-tool/gen/CHIPClientCallbacks.cpp index 70a488cb90df99..84abd16b2426bb 100644 --- a/examples/chip-tool/gen/CHIPClientCallbacks.cpp +++ b/examples/chip-tool/gen/CHIPClientCallbacks.cpp @@ -506,6 +506,26 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag } } break; + case 0x050F: + switch (attributeId) + { + case 0x001A: // INT8U + { + uint8_t data[count]; + for (size_t i = 0; i < count; i++) + { + data[i] = emberAfGetInt8u(message, 0, messageLen); + message += 1; + CHECK_MESSAGE_LENGTH(1); + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, count, data); + break; + } + } + break; } break; } @@ -2052,6 +2072,19 @@ bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::app::Comm return true; } +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestSpecificResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_RESPONSE_CALLBACKS("TestClusterClusterTestSpecificResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) { ChipLogProgress(Zcl, "emberAfReportAttributeCallback:"); diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.h b/examples/chip-tool/gen/CHIPClientCallbacks.h index 8f56f0dbb498ab..79336b599e30af 100644 --- a/examples/chip-tool/gen/CHIPClientCallbacks.h +++ b/examples/chip-tool/gen/CHIPClientCallbacks.h @@ -125,6 +125,7 @@ typedef void (*TvChannelClusterChangeChannelResponseCallback)(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * ChannelMatch, uint8_t ErrorType); typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t * data); +typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); typedef void (*ThermostatClusterCurrentWeeklyScheduleCallback)(void * context, uint8_t numberOfTransitionsForSequence, uint8_t dayOfWeekForSequence, uint8_t modeForSequence, /* TYPE WARNING: array array defaults to */ uint8_t * payload); @@ -140,3 +141,4 @@ typedef void (*DescriptorPartsListListAttributeCallback)(void * context, uint16_ typedef void (*GroupKeyManagementGroupsListAttributeCallback)(void * context, uint16_t count, _GroupState * entries); typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)(void * context, uint16_t count, _GroupKey * entries); typedef void (*OperationalCredentialsFabricsListListAttributeCallback)(void * context, uint16_t count, _FabricDescriptor * entries); +typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, uint16_t count, uint8_t * entries); diff --git a/examples/chip-tool/gen/CHIPClusters.cpp b/examples/chip-tool/gen/CHIPClusters.cpp index bf5576722bee36..86146e3b8c8e58 100644 --- a/examples/chip-tool/gen/CHIPClusters.cpp +++ b/examples/chip-tool/gen/CHIPClusters.cpp @@ -5303,6 +5303,362 @@ CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback: return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } +// TestCluster Cluster Commands +CHIP_ERROR TestClusterCluster::Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestNotHandledCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestNotHandledCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestSpecificCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestSpecificCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +// TestCluster Cluster Attributes +CHIP_ERROR TestClusterCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR TestClusterCluster::ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBooleanAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBooleanAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap32Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap32Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap64Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap64Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadOctetStringAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteOctetStringAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadListInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + // Thermostat Cluster Commands CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) diff --git a/examples/chip-tool/gen/CHIPClusters.h b/examples/chip-tool/gen/CHIPClusters.h index aced89e986465a..33ab97783dcf0c 100644 --- a/examples/chip-tool/gen/CHIPClusters.h +++ b/examples/chip-tool/gen/CHIPClusters.h @@ -56,6 +56,7 @@ constexpr ClusterId kSwitchClusterId = 0x003B; constexpr ClusterId kTvChannelClusterId = 0x0504; constexpr ClusterId kTargetNavigatorClusterId = 0x0505; constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr ClusterId kTestClusterClusterId = 0x050F; constexpr ClusterId kThermostatClusterId = 0x0201; constexpr ClusterId kWakeOnLanClusterId = 0x0503; @@ -978,6 +979,76 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT TestClusterCluster : public ClusterBase +{ +public: + TestClusterCluster() : ClusterBase(kTestClusterClusterId) {} + ~TestClusterCluster() {} + + // Cluster Commands + CHIP_ERROR Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int8_t value); + CHIP_ERROR WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int16_t value); + CHIP_ERROR WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int32_t value); + CHIP_ERROR WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int64_t value); + CHIP_ERROR WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan value); + +private: + static constexpr CommandId kTestCommandId = 0x00; + static constexpr CommandId kTestNotHandledCommandId = 0x01; + static constexpr CommandId kTestSpecificCommandId = 0x02; +}; + class DLL_EXPORT ThermostatCluster : public ClusterBase { public: diff --git a/examples/chip-tool/gen/CHIPClustersObjc.h b/examples/chip-tool/gen/CHIPClustersObjc.h index d0170ef2e91fc4..b93a294f29bf1f 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.h +++ b/examples/chip-tool/gen/CHIPClustersObjc.h @@ -827,6 +827,53 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Test Cluster + * + */ +@interface CHIPTestCluster : CHIPCluster + +- (void)test:(ResponseHandler)completionHandler; +- (void)testNotHandled:(ResponseHandler)completionHandler; +- (void)testSpecific:(ResponseHandler)completionHandler; + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler; +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum8:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum16:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeOctetString:(ResponseHandler)completionHandler; +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + +@end + /** * Cluster Thermostat * diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm index ed80a36ca9e775..7e46e2467edef7 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.mm +++ b/examples/chip-tool/gen/CHIPClustersObjc.mm @@ -259,6 +259,38 @@ static void CallbackFn(void * context, uint16_t value) bool mKeepAlive; }; +class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt16sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int16_t value) + { + CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt32uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -291,6 +323,38 @@ static void CallbackFn(void * context, uint32_t value) bool mKeepAlive; }; +class CHIPInt32sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt32sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt32sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int32_t value) + { + CHIPInt32sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLong:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt64uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -323,24 +387,24 @@ static void CallbackFn(void * context, uint64_t value) bool mKeepAlive; }; -class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +class CHIPInt64sAttributeCallbackBridge : public Callback::Callback { public: - CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) - : Callback::Callback(CallbackFn, this) + CHIPInt64sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) , mKeepAlive(keepAlive) { } - ~CHIPInt16sAttributeCallbackBridge() {}; + ~CHIPInt64sAttributeCallbackBridge() {}; - static void CallbackFn(void * context, int16_t value) + static void CallbackFn(void * context, int64_t value) { - CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + CHIPInt64sAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ - callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLongLong:value] }); if (!callback->mKeepAlive) { callback->Cancel(); delete callback; @@ -2419,6 +2483,38 @@ static void CallbackFn(void * context, uint8_t * data) dispatch_queue_t mQueue; }; +class CHIPTestClusterClusterTestSpecificResponseCallbackBridge + : public Callback::Callback { +public: + CHIPTestClusterClusterTestSpecificResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterClusterTestSpecificResponseCallbackBridge() {}; + + static void CallbackFn(void * context, uint8_t returnValue) + { + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { + @"returnValue" : [NSNumber numberWithUnsignedChar:returnValue], + }); + callback->Cancel(); + delete callback; + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + class CHIPThermostatClusterCurrentWeeklyScheduleCallbackBridge : public Callback::Callback { public: @@ -2754,6 +2850,41 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri dispatch_queue_t mQueue; }; +class CHIPTestClusterListInt8uAttributeCallbackBridge : public Callback::Callback { +public: + CHIPTestClusterListInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterListInt8uAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, uint16_t count, uint8_t * entries) + { + CHIPTestClusterListInt8uAttributeCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + id values[count]; + for (uint16_t i = 0; i < count; i++) { + values[i] = [NSNumber numberWithUnsignedChar:entries[i]]; + } + + id array = [NSArray arrayWithObjects:values count:count]; + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : array }); + callback->Cancel(); + delete callback; + }); + } + } + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + @interface CHIPCluster () @property (readonly, nonatomic) dispatch_queue_t callbackQueue; @property (readonly, nonatomic) dispatch_queue_t chipWorkQueue; @@ -11507,6 +11638,1021 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler @end +@interface CHIPTestCluster () +@property (readonly) Controller::TestClusterCluster cppCluster; +@end + +@implementation CHIPTestCluster + +- (Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)test:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.Test(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testNotHandled:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestNotHandled(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testSpecific:(ResponseHandler)completionHandler +{ + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestSpecific(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler +{ + CHIPBooleanAttributeCallbackBridge * onSuccess + = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8u:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16u:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32u:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64u:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8s:(ResponseHandler)completionHandler +{ + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16s:(ResponseHandler)completionHandler +{ + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32s:(ResponseHandler)completionHandler +{ + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64s:(ResponseHandler)completionHandler +{ + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeOctetString:(ResponseHandler)completionHandler +{ + CHIPStringAttributeCallbackBridge * onSuccess + = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeOctetString( + onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) value.bytes, value.length)); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +{ + CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess + = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeListInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +@end + @interface CHIPThermostat () @property (readonly) Controller::ThermostatCluster cppCluster; @end diff --git a/examples/chip-tool/gen/IMClusterCommandHandler.cpp b/examples/chip-tool/gen/IMClusterCommandHandler.cpp index 1d6fcffd5c1921..d520e72d3b2a88 100644 --- a/examples/chip-tool/gen/IMClusterCommandHandler.cpp +++ b/examples/chip-tool/gen/IMClusterCommandHandler.cpp @@ -5744,6 +5744,93 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace TargetNavigator +namespace TestCluster { + +void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint8_t returnValue; + bool returnValueExists = false; + uint32_t validArgumentCount = 0; + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (returnValueExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(returnValue); + if (CHIP_NO_ERROR == TLVUnpackError) + { + returnValueExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } + + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestSpecificResponseCallback(apCommandObj, returnValue); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 1, validArgumentCount, TLVError, TLVUnpackError); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TEST_CLUSTER_ID); + break; + } + } + } +} + +} // namespace TestCluster + namespace Thermostat { void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) diff --git a/examples/chip-tool/gen/attribute-id.h b/examples/chip-tool/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/chip-tool/gen/attribute-id.h +++ b/examples/chip-tool/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/chip-tool/gen/call-command-handler.cpp b/examples/chip-tool/gen/call-command-handler.cpp index 92e652ab2e04cf..ab8338acef7b77 100644 --- a/examples/chip-tool/gen/call-command-handler.cpp +++ b/examples/chip-tool/gen/call-command-handler.cpp @@ -57,6 +57,7 @@ EmberAfStatus emberAfSwitchClusterClientCommandParse(EmberAfClusterCommand * cmd EmberAfStatus emberAfTvChannelClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTargetNavigatorClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThermostatClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfWakeOnLanClusterClientCommandParse(EmberAfClusterCommand * cmd); @@ -191,6 +192,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Temperature Measurement result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEST_CLUSTER_ID: + result = emberAfTestClusterClusterClientCommandParse(cmd); + break; case ZCL_THERMOSTAT_CLUSTER_ID: result = emberAfThermostatClusterClientCommandParse(cmd); break; @@ -1766,6 +1770,35 @@ EmberAfStatus emberAfTargetNavigatorClusterClientCommandParse(EmberAfClusterComm } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t returnValue; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + returnValue = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTestClusterClusterTestSpecificResponseCallback(nullptr, returnValue); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} EmberAfStatus emberAfThermostatClusterClientCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; diff --git a/examples/chip-tool/gen/callback-stub.cpp b/examples/chip-tool/gen/callback-stub.cpp index 3f1208e57cdb23..f37741eec41dcb 100644 --- a/examples/chip-tool/gen/callback-stub.cpp +++ b/examples/chip-tool/gen/callback-stub.cpp @@ -116,6 +116,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; + case ZCL_TEST_CLUSTER_ID: + emberAfTestClusterClusterInitCallback(endpoint); + break; case ZCL_THERMOSTAT_CLUSTER_ID: emberAfThermostatClusterInitCallback(endpoint); break; @@ -273,6 +276,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfTestClusterClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/examples/chip-tool/gen/callback.h b/examples/chip-tool/gen/callback.h index d7cf625829ce43..68ef71ef130dcc 100644 --- a/examples/chip-tool/gen/callback.h +++ b/examples/chip-tool/gen/callback.h @@ -272,6 +272,14 @@ void emberAfTargetNavigatorClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Test Cluster Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thermostat Cluster Init * * Cluster Init @@ -2327,6 +2335,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallb */ void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId endpoint); +// +// Test Cluster Cluster client +// + +/** @brief Test Cluster Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Test Cluster Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTestClusterClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Test Cluster Cluster Client Manufacturer Specific Attribute Changed + * + * Client Manufacturer Specific Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + * @param manufacturerCode Manufacturer Code of the attribute that changed + */ +void emberAfTestClusterClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Test Cluster Cluster Client Message Sent + * + * Client Message Sent + * + * @param type The type of message sent + * @param indexOrDestination The destination or address to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Test Cluster Cluster Client Pre Attribute Changed + * + * client Pre Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); + +/** @brief Test Cluster Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTestClusterClusterClientTickCallback(chip::EndpointId endpoint); + // // Thermostat Cluster client // @@ -3020,6 +3098,13 @@ bool emberAfTvChannelClusterChangeChannelResponseCallback(chip::app::Command * c bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::app::Command * commandObj, uint8_t status, uint8_t * data); +/** + * @brief Test Cluster Cluster TestSpecificResponse Command callback + * @param returnValue + */ + +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue); + /** * @brief Thermostat Cluster CurrentWeeklySchedule Command callback * @param numberOfTransitionsForSequence diff --git a/examples/chip-tool/gen/client-command-macro.h b/examples/chip-tool/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/chip-tool/gen/client-command-macro.h +++ b/examples/chip-tool/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/chip-tool/gen/cluster-id.h b/examples/chip-tool/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/chip-tool/gen/cluster-id.h +++ b/examples/chip-tool/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/chip-tool/gen/command-id.h b/examples/chip-tool/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/chip-tool/gen/command-id.h +++ b/examples/chip-tool/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/chip-tool/gen/endpoint_config.h b/examples/chip-tool/gen/endpoint_config.h index 6f7149a6451d71..6599ceb17d6cc9 100644 --- a/examples/chip-tool/gen/endpoint_config.h +++ b/examples/chip-tool/gen/endpoint_config.h @@ -63,7 +63,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 31 +#define GENERATED_ATTRIBUTE_COUNT 32 #define GENERATED_ATTRIBUTES \ { \ \ @@ -153,6 +153,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Account Login (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Binding (client) */ \ @@ -169,7 +172,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 31 +#define GENERATED_CLUSTER_COUNT 32 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -248,10 +251,13 @@ 0x050E, ZAP_ATTRIBUTE_INDEX(28), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { \ + 0xF000, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -260,7 +266,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 31, 62 }, \ + { ZAP_CLUSTER_INDEX(0), 32, 64 }, \ } // Largest attribute size is needed for various buffers @@ -270,7 +276,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (2) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (62) +#define ATTRIBUTE_MAX_SIZE (64) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) @@ -314,7 +320,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (187) +#define EMBER_AF_GENERATED_COMMAND_COUNT (191) #define GENERATED_COMMANDS \ { \ \ @@ -560,6 +566,12 @@ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ + { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ + { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ + \ /* Endpoint: 1, Cluster: Binding (client) */ \ { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ diff --git a/examples/chip-tool/gen/gen_config.h b/examples/chip-tool/gen/gen_config.h index 8c614ed0219acd..a7e91667586ee9 100644 --- a/examples/chip-tool/gen/gen_config.h +++ b/examples/chip-tool/gen/gen_config.h @@ -58,6 +58,7 @@ #define EMBER_AF_TV_CHANNEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_TEST_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_WAKE_ON_LAN_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -179,6 +180,10 @@ #define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_CLIENT +// Use this macro to check if the client side of the Test Cluster cluster is included +#define ZCL_USING_TEST_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TEST_CLUSTER_CLIENT + // Use this macro to check if the client side of the Thermostat cluster is included #define ZCL_USING_THERMOSTAT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_THERMOSTAT_CLIENT diff --git a/examples/chip-tool/gen/print-cluster.h b/examples/chip-tool/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/chip-tool/gen/print-cluster.h +++ b/examples/chip-tool/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/chip-tool/templates/commands.zapt b/examples/chip-tool/templates/commands.zapt index 065349a30fe0a5..c053e55a804992 100644 --- a/examples/chip-tool/templates/commands.zapt +++ b/examples/chip-tool/templates/commands.zapt @@ -65,6 +65,14 @@ static void OnInt64uAttributeResponse(void * context, uint64_t value) command->SetCommandExitStatus(true); } +static void OnInt8sAttributeResponse(void * context, int8_t value) +{ + ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + static void OnInt16sAttributeResponse(void * context, int16_t value) { ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value); @@ -73,6 +81,22 @@ static void OnInt16sAttributeResponse(void * context, int16_t value) command->SetCommandExitStatus(true); } +static void OnInt32sAttributeResponse(void * context, int32_t value) +{ + ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + +static void OnInt64sAttributeResponse(void * context, int64_t value) +{ + ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value); + + ModelCommand * command = reinterpret_cast(context); + command->SetCommandExitStatus(true); +} + static void OnStringAttributeResponse(void * context, const chip::ByteSpan value) { char * str = (char *)malloc(value.size() * sizeof(char)); diff --git a/examples/lighting-app/lighting-common/gen/attribute-id.h b/examples/lighting-app/lighting-common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/lighting-app/lighting-common/gen/attribute-id.h +++ b/examples/lighting-app/lighting-common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/lighting-app/lighting-common/gen/client-command-macro.h b/examples/lighting-app/lighting-common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/lighting-app/lighting-common/gen/client-command-macro.h +++ b/examples/lighting-app/lighting-common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/lighting-app/lighting-common/gen/cluster-id.h b/examples/lighting-app/lighting-common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/lighting-app/lighting-common/gen/cluster-id.h +++ b/examples/lighting-app/lighting-common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/lighting-app/lighting-common/gen/command-id.h b/examples/lighting-app/lighting-common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/lighting-app/lighting-common/gen/command-id.h +++ b/examples/lighting-app/lighting-common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/lighting-app/lighting-common/gen/print-cluster.h b/examples/lighting-app/lighting-common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/lighting-app/lighting-common/gen/print-cluster.h +++ b/examples/lighting-app/lighting-common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/lock-app/lock-common/gen/attribute-id.h b/examples/lock-app/lock-common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/lock-app/lock-common/gen/attribute-id.h +++ b/examples/lock-app/lock-common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/lock-app/lock-common/gen/client-command-macro.h b/examples/lock-app/lock-common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/lock-app/lock-common/gen/client-command-macro.h +++ b/examples/lock-app/lock-common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/lock-app/lock-common/gen/cluster-id.h b/examples/lock-app/lock-common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/lock-app/lock-common/gen/cluster-id.h +++ b/examples/lock-app/lock-common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/lock-app/lock-common/gen/command-id.h b/examples/lock-app/lock-common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/lock-app/lock-common/gen/command-id.h +++ b/examples/lock-app/lock-common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/lock-app/lock-common/gen/print-cluster.h b/examples/lock-app/lock-common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/lock-app/lock-common/gen/print-cluster.h +++ b/examples/lock-app/lock-common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h +++ b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/temperature-measurement-app/esp32/main/gen/command-id.h b/examples/temperature-measurement-app/esp32/main/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/command-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h +++ b/examples/temperature-measurement-app/esp32/main/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/tv-app/tv-common/gen/attribute-id.h b/examples/tv-app/tv-common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/tv-app/tv-common/gen/attribute-id.h +++ b/examples/tv-app/tv-common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/tv-app/tv-common/gen/client-command-macro.h b/examples/tv-app/tv-common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/tv-app/tv-common/gen/client-command-macro.h +++ b/examples/tv-app/tv-common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/tv-app/tv-common/gen/cluster-id.h b/examples/tv-app/tv-common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/tv-app/tv-common/gen/cluster-id.h +++ b/examples/tv-app/tv-common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/tv-app/tv-common/gen/command-id.h b/examples/tv-app/tv-common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/tv-app/tv-common/gen/command-id.h +++ b/examples/tv-app/tv-common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/tv-app/tv-common/gen/print-cluster.h b/examples/tv-app/tv-common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/tv-app/tv-common/gen/print-cluster.h +++ b/examples/tv-app/tv-common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/examples/window-app/common/gen/attribute-id.h b/examples/window-app/common/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/examples/window-app/common/gen/attribute-id.h +++ b/examples/window-app/common/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/examples/window-app/common/gen/client-command-macro.h b/examples/window-app/common/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/examples/window-app/common/gen/client-command-macro.h +++ b/examples/window-app/common/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/examples/window-app/common/gen/cluster-id.h b/examples/window-app/common/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/examples/window-app/common/gen/cluster-id.h +++ b/examples/window-app/common/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/examples/window-app/common/gen/command-id.h b/examples/window-app/common/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/examples/window-app/common/gen/command-id.h +++ b/examples/window-app/common/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/examples/window-app/common/gen/print-cluster.h b/examples/window-app/common/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/examples/window-app/common/gen/print-cluster.h +++ b/examples/window-app/common/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/src/app/chip-zcl-zpro-codec-api.h b/src/app/chip-zcl-zpro-codec-api.h index e433f32cec7a2d..77871bbf9e49b8 100644 --- a/src/app/chip-zcl-zpro-codec-api.h +++ b/src/app/chip-zcl-zpro-codec-api.h @@ -57,6 +57,7 @@ | TvChannel | 0x0504 | | TargetNavigator | 0x0505 | | TemperatureMeasurement | 0x0402 | +| TestCluster | 0x050F | | Thermostat | 0x0201 | | WakeOnLan | 0x0503 | | WindowCovering | 0x0102 | @@ -2845,6 +2846,286 @@ encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, chip::System::PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); +/*----------------------------------------------------------------------------*\ +| Cluster TestCluster | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * Test | 0x00 | +| * TestNotHandled | 0x01 | +| * TestSpecific | 0x02 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Boolean | 0x0000 | +| * Bitmap8 | 0x0001 | +| * Bitmap16 | 0x0002 | +| * Bitmap32 | 0x0003 | +| * Bitmap64 | 0x0004 | +| * Int8u | 0x0005 | +| * Int16u | 0x0006 | +| * Int32u | 0x0008 | +| * Int64u | 0x000C | +| * Int8s | 0x000D | +| * Int16s | 0x000E | +| * Int32s | 0x0010 | +| * Int64s | 0x0014 | +| * Enum8 | 0x0015 | +| * Enum16 | 0x0016 | +| * OctetString | 0x0019 | +| * ListInt8u | 0x001A | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/** + * @brief + * Encode an Test command for Test Cluster server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterTestCommand(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode an TestNotHandled command for Test Cluster server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterTestNotHandledCommand(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode an TestSpecific command for Test Cluster server into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterTestSpecificCommand(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server discover command into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterDiscoverAttributes(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server read command for the boolean attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadBooleanAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the boolean attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteBooleanAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint8_t boolean); + +/** + * @brief + * Encode a Test Cluster server read command for the bitmap8 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadBitmap8Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the bitmap8 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteBitmap8Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint8_t bitmap8); + +/** + * @brief + * Encode a Test Cluster server read command for the bitmap16 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadBitmap16Attribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the bitmap16 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTestClusterClusterWriteBitmap16Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint16_t bitmap16); + +/** + * @brief + * Encode a Test Cluster server read command for the bitmap32 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadBitmap32Attribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the bitmap32 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTestClusterClusterWriteBitmap32Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint32_t bitmap32); + +/** + * @brief + * Encode a Test Cluster server read command for the bitmap64 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadBitmap64Attribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the bitmap64 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTestClusterClusterWriteBitmap64Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint64_t bitmap64); + +/** + * @brief + * Encode a Test Cluster server read command for the int8u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt8uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int8u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt8uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint8_t int8u); + +/** + * @brief + * Encode a Test Cluster server read command for the int16u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt16uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int16u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt16uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint16_t int16u); + +/** + * @brief + * Encode a Test Cluster server read command for the int32u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt32uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int32u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt32uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint32_t int32u); + +/** + * @brief + * Encode a Test Cluster server read command for the int64u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt64uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int64u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt64uAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint64_t int64u); + +/** + * @brief + * Encode a Test Cluster server read command for the int8s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt8sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int8s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt8sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + int8_t int8s); + +/** + * @brief + * Encode a Test Cluster server read command for the int16s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt16sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int16s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt16sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + int16_t int16s); + +/** + * @brief + * Encode a Test Cluster server read command for the int32s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt32sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int32s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt32sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + int32_t int32s); + +/** + * @brief + * Encode a Test Cluster server read command for the int64s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadInt64sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the int64s attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteInt64sAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + int64_t int64s); + +/** + * @brief + * Encode a Test Cluster server read command for the enum8 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadEnum8Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the enum8 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteEnum8Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint8_t enum8); + +/** + * @brief + * Encode a Test Cluster server read command for the enum16 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadEnum16Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the enum16 attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterWriteEnum16Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, + uint16_t enum16); + +/** + * @brief + * Encode a Test Cluster server read command for the octet_string attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadOctetStringAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server write command for the octet_string attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeTestClusterClusterWriteOctetStringAttribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, chip::ByteSpan octetString); + +/** + * @brief + * Encode a Test Cluster server read command for the list_int8u attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadListInt8uAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + +/** + * @brief + * Encode a Test Cluster server read command for the cluster revision attribute into buffer including the APS frame + */ +chip::System::PacketBufferHandle encodeTestClusterClusterReadClusterRevisionAttribute(uint8_t seqNum, + chip::EndpointId destinationEndpoint); + /*----------------------------------------------------------------------------*\ | Cluster Thermostat | 0x0201 | |------------------------------------------------------------------------------| diff --git a/src/app/clusters/test-cluster-server/test-cluster-server.cpp b/src/app/clusters/test-cluster-server/test-cluster-server.cpp new file mode 100644 index 00000000000000..9e657730b58aeb --- /dev/null +++ b/src/app/clusters/test-cluster-server/test-cluster-server.cpp @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/**************************************************************************** + * @file + * @brief Implementation for the Test Server Cluster + ***************************************************************************/ + +#include +#include +#include +#include +#include + +#include "gen/af-structs.h" +#include "gen/attribute-id.h" +#include "gen/attribute-type.h" +#include "gen/cluster-id.h" +#include "gen/command-id.h" + +using namespace chip; + +void emberAfPluginTestClusterServerInitCallback(void) {} + +bool emberAfTestClusterClusterTestCallback(chip::app::Command *) +{ + emberAfSendImmediateDefaultResponse(EMBER_ZCL_STATUS_SUCCESS); + return true; +} + +bool emberAfTestClusterClusterTestSpecificCallback(chip::app::Command *) +{ + uint8_t returnValue = 7; + emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), ZCL_TEST_CLUSTER_ID, + ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID, "u", returnValue); + + EmberStatus sendStatus = emberAfSendResponse(); + if (EMBER_SUCCESS != sendStatus) + { + ChipLogError(Zcl, "Test Cluster: failed to send TestSpecific response: 0x%x", sendStatus); + } + + return true; +} + +bool emberAfTestClusterClusterTestNotHandledCallback(chip::app::Command *) +{ + return false; +} diff --git a/src/app/encoder.cpp b/src/app/encoder.cpp index 3358a6b1caf6d3..57a0d534c3160a 100644 --- a/src/app/encoder.cpp +++ b/src/app/encoder.cpp @@ -128,6 +128,7 @@ uint16_t encodeApsFrame(uint8_t * buffer, uint16_t buf_length, EmberApsFrame * a | TvChannel | 0x0504 | | TargetNavigator | 0x0505 | | TemperatureMeasurement | 0x0402 | +| TestCluster | 0x050F | | Thermostat | 0x0201 | | WakeOnLan | 0x0503 | | WindowCovering | 0x0102 | @@ -328,6 +329,11 @@ uint16_t encodeApsFrame(uint8_t * buffer, uint16_t buf_length, EmberApsFrame * a #define TEMP_MEASUREMENT_CLUSTER_ID 0x0402 +#define TEST_CLUSTER_ID 0x050F +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + #define THERMOSTAT_CLUSTER_ID 0x0201 #define ZCL_CLEAR_WEEKLY_SCHEDULE_COMMAND_ID (0x03) #define ZCL_GET_RELAY_STATUS_LOG_COMMAND_ID (0x04) @@ -4867,6 +4873,453 @@ PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribu COMMAND_FOOTER(); } +/*----------------------------------------------------------------------------*\ +| Cluster TestCluster | 0x050F | +|------------------------------------------------------------------------------| +| Commands: | | +| * Test | 0x00 | +| * TestNotHandled | 0x01 | +| * TestSpecific | 0x02 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * Boolean | 0x0000 | +| * Bitmap8 | 0x0001 | +| * Bitmap16 | 0x0002 | +| * Bitmap32 | 0x0003 | +| * Bitmap64 | 0x0004 | +| * Int8u | 0x0005 | +| * Int16u | 0x0006 | +| * Int32u | 0x0008 | +| * Int64u | 0x000C | +| * Int8s | 0x000D | +| * Int16s | 0x000E | +| * Int32s | 0x0010 | +| * Int64s | 0x0014 | +| * Enum8 | 0x0015 | +| * Enum16 | 0x0016 | +| * OctetString | 0x0019 | +| * ListInt8u | 0x001A | +| * ClusterRevision | 0xFFFD | +\*----------------------------------------------------------------------------*/ + +/* + * Command Test + */ +PacketBufferHandle encodeTestClusterClusterTestCommand(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("Test", TEST_CLUSTER_ID); + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_TEST_COMMAND_ID); + COMMAND_FOOTER(); +} + +/* + * Command TestNotHandled + */ +PacketBufferHandle encodeTestClusterClusterTestNotHandledCommand(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("TestNotHandled", TEST_CLUSTER_ID); + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_TEST_NOT_HANDLED_COMMAND_ID); + COMMAND_FOOTER(); +} + +/* + * Command TestSpecific + */ +PacketBufferHandle encodeTestClusterClusterTestSpecificCommand(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("TestSpecific", TEST_CLUSTER_ID); + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_TEST_SPECIFIC_COMMAND_ID); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("DiscoverTestClusterAttributes", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_DISCOVER_ATTRIBUTES_COMMAND_ID).Put16(0x0000).Put8(0xFF); + COMMAND_FOOTER(); +} + +/* + * Attribute Boolean + */ +PacketBufferHandle encodeTestClusterClusterReadBooleanAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterBoolean", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0000); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteBooleanAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t boolean) +{ + COMMAND_HEADER("WriteTestClusterBoolean", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0000) + .Put8(16) + .Put8(static_cast(boolean)); + COMMAND_FOOTER(); +} + +/* + * Attribute Bitmap8 + */ +PacketBufferHandle encodeTestClusterClusterReadBitmap8Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterBitmap8", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0001); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteBitmap8Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t bitmap8) +{ + COMMAND_HEADER("WriteTestClusterBitmap8", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0001) + .Put8(24) + .Put8(static_cast(bitmap8)); + COMMAND_FOOTER(); +} + +/* + * Attribute Bitmap16 + */ +PacketBufferHandle encodeTestClusterClusterReadBitmap16Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterBitmap16", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0002); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteBitmap16Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t bitmap16) +{ + COMMAND_HEADER("WriteTestClusterBitmap16", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0002) + .Put8(25) + .Put16(static_cast(bitmap16)); + COMMAND_FOOTER(); +} + +/* + * Attribute Bitmap32 + */ +PacketBufferHandle encodeTestClusterClusterReadBitmap32Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterBitmap32", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0003); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteBitmap32Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint32_t bitmap32) +{ + COMMAND_HEADER("WriteTestClusterBitmap32", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0003) + .Put8(27) + .Put32(static_cast(bitmap32)); + COMMAND_FOOTER(); +} + +/* + * Attribute Bitmap64 + */ +PacketBufferHandle encodeTestClusterClusterReadBitmap64Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterBitmap64", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0004); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteBitmap64Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint64_t bitmap64) +{ + COMMAND_HEADER("WriteTestClusterBitmap64", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0004) + .Put8(31) + .Put64(static_cast(bitmap64)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int8u + */ +PacketBufferHandle encodeTestClusterClusterReadInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt8u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0005); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t int8u) +{ + COMMAND_HEADER("WriteTestClusterInt8u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0005) + .Put8(32) + .Put8(static_cast(int8u)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int16u + */ +PacketBufferHandle encodeTestClusterClusterReadInt16uAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt16u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0006); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt16uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t int16u) +{ + COMMAND_HEADER("WriteTestClusterInt16u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0006) + .Put8(33) + .Put16(static_cast(int16u)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int32u + */ +PacketBufferHandle encodeTestClusterClusterReadInt32uAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt32u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0008); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt32uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint32_t int32u) +{ + COMMAND_HEADER("WriteTestClusterInt32u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0008) + .Put8(35) + .Put32(static_cast(int32u)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int64u + */ +PacketBufferHandle encodeTestClusterClusterReadInt64uAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt64u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x000C); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt64uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint64_t int64u) +{ + COMMAND_HEADER("WriteTestClusterInt64u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x000C) + .Put8(39) + .Put64(static_cast(int64u)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int8s + */ +PacketBufferHandle encodeTestClusterClusterReadInt8sAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt8s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x000D); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt8sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int8_t int8s) +{ + COMMAND_HEADER("WriteTestClusterInt8s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x000D) + .Put8(40) + .Put8(static_cast(int8s)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int16s + */ +PacketBufferHandle encodeTestClusterClusterReadInt16sAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt16s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x000E); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt16sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int16_t int16s) +{ + COMMAND_HEADER("WriteTestClusterInt16s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x000E) + .Put8(41) + .Put16(static_cast(int16s)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int32s + */ +PacketBufferHandle encodeTestClusterClusterReadInt32sAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt32s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0010); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt32sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int32_t int32s) +{ + COMMAND_HEADER("WriteTestClusterInt32s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0010) + .Put8(43) + .Put32(static_cast(int32s)); + COMMAND_FOOTER(); +} + +/* + * Attribute Int64s + */ +PacketBufferHandle encodeTestClusterClusterReadInt64sAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterInt64s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0014); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteInt64sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int64_t int64s) +{ + COMMAND_HEADER("WriteTestClusterInt64s", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0014) + .Put8(47) + .Put64(static_cast(int64s)); + COMMAND_FOOTER(); +} + +/* + * Attribute Enum8 + */ +PacketBufferHandle encodeTestClusterClusterReadEnum8Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterEnum8", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0015); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteEnum8Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t enum8) +{ + COMMAND_HEADER("WriteTestClusterEnum8", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0015) + .Put8(48) + .Put8(static_cast(enum8)); + COMMAND_FOOTER(); +} + +/* + * Attribute Enum16 + */ +PacketBufferHandle encodeTestClusterClusterReadEnum16Attribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterEnum16", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0016); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteEnum16Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t enum16) +{ + COMMAND_HEADER("WriteTestClusterEnum16", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0016) + .Put8(49) + .Put16(static_cast(enum16)); + COMMAND_FOOTER(); +} + +/* + * Attribute OctetString + */ +PacketBufferHandle encodeTestClusterClusterReadOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterOctetString", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x0019); + COMMAND_FOOTER(); +} + +PacketBufferHandle encodeTestClusterClusterWriteOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint, + chip::ByteSpan octetString) +{ + COMMAND_HEADER("WriteTestClusterOctetString", TEST_CLUSTER_ID); + size_t octetStringStrLen = octetString.size(); + if (!CanCastTo(octetStringStrLen)) + { + ChipLogError(Zcl, "Error encoding %s command. String too long: %d", kName, octetStringStrLen); + return PacketBufferHandle(); + } + + buf.Put8(kFrameControlGlobalCommand) + .Put8(seqNum) + .Put8(ZCL_WRITE_ATTRIBUTES_COMMAND_ID) + .Put16(0x0019) + .Put8(65) + .Put(static_cast(octetStringStrLen)) + .Put(octetString.data(), octetStringStrLen); + COMMAND_FOOTER(); +} + +/* + * Attribute ListInt8u + */ +PacketBufferHandle encodeTestClusterClusterReadListInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterListInt8u", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0x001A); + COMMAND_FOOTER(); +} + +/* + * Attribute ClusterRevision + */ +PacketBufferHandle encodeTestClusterClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint) +{ + COMMAND_HEADER("ReadTestClusterClusterRevision", TEST_CLUSTER_ID); + buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put8(ZCL_READ_ATTRIBUTES_COMMAND_ID).Put16(0xFFFD); + COMMAND_FOOTER(); +} + /*----------------------------------------------------------------------------*\ | Cluster Thermostat | 0x0201 | |------------------------------------------------------------------------------| diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index a32f29dc50163e..9f7477a4eeb1f2 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -145,6 +145,9 @@ void emberAfPluginDoorLockServerInitCallback(void); #ifdef ZCL_USING_DESCRIPTOR_CLUSTER_SERVER void emberAfPluginDescriptorServerInitCallback(void); #endif +#ifdef ZCL_USING_TEST_CLUSTER_SERVER +void emberAfPluginTestClusterServerInitCallback(void); +#endif #ifdef EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS @@ -309,6 +312,9 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr) #ifdef ZCL_USING_DESCRIPTOR_CLUSTER_SERVER emberAfPluginDescriptorServerInitCallback(); #endif +#ifdef ZCL_USING_TEST_CLUSTER_SERVER + emberAfPluginTestClusterServerInitCallback(); +#endif emAfCallInits(); } diff --git a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt index 8bc8e0aed4a014..d508ef872ebc67 100644 --- a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt @@ -251,6 +251,39 @@ private: bool mKeepAlive; }; +class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt16sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int16_t value) + { + CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @{ @"value": [NSNumber numberWithShort:value] }); + if (!callback->mKeepAlive) + { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt32uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -284,6 +317,39 @@ private: bool mKeepAlive; }; +class CHIPInt32sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt32sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt32sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int32_t value) + { + CHIPInt32sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @{ @"value": [NSNumber numberWithLong:value] }); + if (!callback->mKeepAlive) + { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt64uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -317,24 +383,24 @@ private: bool mKeepAlive; }; -class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +class CHIPInt64sAttributeCallbackBridge : public Callback::Callback { public: - CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) - : Callback::Callback(CallbackFn, this) + CHIPInt64sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) , mKeepAlive(keepAlive) { } - ~CHIPInt16sAttributeCallbackBridge() {}; + ~CHIPInt64sAttributeCallbackBridge() {}; - static void CallbackFn(void * context, int16_t value) + static void CallbackFn(void * context, int64_t value) { - CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + CHIPInt64sAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ - callback->mHandler(nil, @{ @"value": [NSNumber numberWithShort:value] }); + callback->mHandler(nil, @{ @"value": [NSNumber numberWithLongLong:value] }); if (!callback->mKeepAlive) { callback->Cancel(); diff --git a/src/app/zap-templates/zcl/test-cluster.xml b/src/app/zap-templates/zcl/test-cluster.xml new file mode 100644 index 00000000000000..3d187797f57a69 --- /dev/null +++ b/src/app/zap-templates/zcl/test-cluster.xml @@ -0,0 +1,82 @@ + + + + + + CHIP + Test Cluster + 0x050F + TEST_CLUSTER + The Test Cluster is meant to validate the generated code + + boolean + bitmap8 + bitmap16 + bitmap32 + bitmap64 + int8u + int16u + + int32u + + + + int64u + int8s + int16s + + int32s + + + + int64s + enum8 + enum16 + + + octet_string + list_int8u + + + + + + Simple command without any parameters and without a specific response + + + + + + Simple command without any parameters and without a specific response not handled by the server + + + + + + Simple command without any parameters and with a specific response + + + + + + Simple response for TestWithResponse with a simple return value + + + + + + diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 8cca8614ef1eaa..034ebf849b158f 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -2,6 +2,7 @@ "version": "ZCL Test Data", "xmlRoot": [".", "./data-model/silabs/"], "xmlFile": [ + "test-cluster.xml", "account-login-cluster.xml", "application-launcher-cluster.xml", "audio-output-cluster.xml", diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index cf0e31cafacd2c..f0c49b7ccd26ee 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -46,6 +46,7 @@ 'SWITCH_CLUSTER': [], 'TARGET_NAVIGATOR_CLUSTER': ['target-navigator-server'], 'TEMP_MEASUREMENT_CLUSTER': ['temperature-measurement-server'], + 'TEST_CLUSTER': ['test-cluster-server'], 'TV_CHANNEL_CLUSTER': ['tv-channel-server'], 'THERMOSTAT_CLUSTER': [], 'WINDOW_COVERING_CLUSTER': [], @@ -92,6 +93,7 @@ 'SWITCH_CLUSTER': [], 'TARGET_NAVIGATOR_CLUSTER': [], 'TEMP_MEASUREMENT_CLUSTER': [], + 'TEST_CLUSTER': [], 'TV_CHANNEL_CLUSTER': [], 'THERMOSTAT_CLUSTER': ['thermostat-client'], 'WINDOW_COVERING_CLUSTER': [], diff --git a/src/controller/controller-clusters.zap b/src/controller/controller-clusters.zap index ab732451451b3f..ea6130657d280f 100644 --- a/src/controller/controller-clusters.zap +++ b/src/controller/controller-clusters.zap @@ -5616,6 +5616,347 @@ } ] }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestSpecificResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "boolean", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap8", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap16", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap32", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap64", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8u", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16u", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32u", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64u", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8s", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16s", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32s", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64s", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum8", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Binding", "code": 61440, @@ -8653,4 +8994,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index 5ad212116dabd0..bb4f98bafe8304 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -2612,6 +2612,186 @@ CHIP_ERROR chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(chip::C } // End of Cluster TemperatureMeasurement +// Cluster TestCluster + +CHIP_ERROR chip_ime_AppendCommand_TestCluster_Test(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.Test(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_AppendCommand_TestCluster_TestNotHandled(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.TestNotHandled(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} +CHIP_ERROR chip_ime_AppendCommand_TestCluster_TestSpecific(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.TestSpecific(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Boolean(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBoolean(gBooleanAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap32(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap32(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Bitmap64(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeBitmap64(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int8u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt8u(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int16u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt16u(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int32u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt32u(gInt32uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int64u(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt64u(gInt64uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int8s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt8s(gInt8sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int16s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt16s(gInt16sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int32s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt32s(gInt32sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Int64s(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeInt64s(gInt64sAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Enum8(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnum8(gInt8uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_Enum16(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeEnum16(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_OctetString(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeOctetString(gStringAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +CHIP_ERROR chip_ime_ReadAttribute_TestCluster_ClusterRevision(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, + chip::GroupId /* ZCLgroupId */) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::TestClusterCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.ReadAttributeClusterRevision(gInt16uAttributeCallback.Cancel(), gDefaultFailureCallback.Cancel()); +} + +// End of Cluster TestCluster // Cluster Thermostat CHIP_ERROR chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index b05b05929ff321..98261141946fe9 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -550,6 +550,14 @@ def ListClusterCommands(self): }, "TemperatureMeasurement": { }, + "TestCluster": { + "Test": { + }, + "TestNotHandled": { + }, + "TestSpecific": { + }, + }, "Thermostat": { "ClearWeeklySchedule": { }, @@ -796,6 +804,25 @@ def ListClusterAttributes(self): "MaxMeasuredValue", "ClusterRevision", ], + "TestCluster": [ + "Boolean", + "Bitmap8", + "Bitmap16", + "Bitmap32", + "Bitmap64", + "Int8u", + "Int16u", + "Int32u", + "Int64u", + "Int8s", + "Int16s", + "Int32s", + "Int64s", + "Enum8", + "Enum16", + "OctetString", + "ClusterRevision", + ], "Thermostat": [ "LocalTemperature", "OccupiedCoolingSetpoint", @@ -1311,6 +1338,18 @@ def ClusterTargetNavigator_CommandNavigateTarget(self, device: ctypes.c_void_p, return self._chipLib.chip_ime_AppendCommand_TargetNavigator_NavigateTarget( device, ZCLendpoint, ZCLgroupid, target, data, len(data) ) + def ClusterTestCluster_CommandTest(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_AppendCommand_TestCluster_Test( + device, ZCLendpoint, ZCLgroupid + ) + def ClusterTestCluster_CommandTestNotHandled(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_AppendCommand_TestCluster_TestNotHandled( + device, ZCLendpoint, ZCLgroupid + ) + def ClusterTestCluster_CommandTestSpecific(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_AppendCommand_TestCluster_TestSpecific( + device, ZCLendpoint, ZCLgroupid + ) def ClusterThermostat_CommandClearWeeklySchedule(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule( device, ZCLendpoint, ZCLgroupid @@ -1668,6 +1707,40 @@ def ClusterTemperatureMeasurement_ReadAttributeMaxMeasuredValue(self, device: ct return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_MaxMeasuredValue(device, ZCLendpoint, ZCLgroupid) def ClusterTemperatureMeasurement_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeBoolean(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Boolean(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeBitmap8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap8(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeBitmap16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap16(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeBitmap32(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap32(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeBitmap64(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap64(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt8u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8u(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt16u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16u(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt32u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32u(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt64u(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64u(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt8s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8s(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt16s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16s(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt32s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32s(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeInt64s(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64s(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeEnum8(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum8(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeEnum16(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum16(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeOctetString(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_OctetString(device, ZCLendpoint, ZCLgroupid) + def ClusterTestCluster_ReadAttributeClusterRevision(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): + return self._chipLib.chip_ime_ReadAttribute_TestCluster_ClusterRevision(device, ZCLendpoint, ZCLgroupid) def ClusterThermostat_ReadAttributeLocalTemperature(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): return self._chipLib.chip_ime_ReadAttribute_Thermostat_LocalTemperature(device, ZCLendpoint, ZCLgroupid) def ClusterThermostat_ConfigureAttributeLocalTemperature(self, device: ctypes.c_void_p, ZCLendpoint: int, minInterval: int, maxInterval: int, change: int): @@ -2545,6 +2618,67 @@ def InitLib(self, chipLib): # Cluster TemperatureMeasurement ReadAttribute ClusterRevision self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_TemperatureMeasurement_ClusterRevision.restype = ctypes.c_uint32 + # Cluster TestCluster + # Cluster TestCluster Command Test + self._chipLib.chip_ime_AppendCommand_TestCluster_Test.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_TestCluster_Test.restype = ctypes.c_uint32 + # Cluster TestCluster Command TestNotHandled + self._chipLib.chip_ime_AppendCommand_TestCluster_TestNotHandled.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_TestCluster_TestNotHandled.restype = ctypes.c_uint32 + # Cluster TestCluster Command TestSpecific + self._chipLib.chip_ime_AppendCommand_TestCluster_TestSpecific.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_TestCluster_TestSpecific.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Boolean + self._chipLib.chip_ime_ReadAttribute_TestCluster_Boolean.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Boolean.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Bitmap8 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap8.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap8.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Bitmap16 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap16.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap16.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Bitmap32 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap32.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap32.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Bitmap64 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap64.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Bitmap64.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int8u + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8u.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int16u + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16u.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int32u + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32u.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int64u + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64u.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64u.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int8s + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8s.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int8s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int16s + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16s.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int16s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int32s + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32s.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int32s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Int64s + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64s.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Int64s.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Enum8 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum8.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum8.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute Enum16 + self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum16.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_Enum16.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute OctetString + self._chipLib.chip_ime_ReadAttribute_TestCluster_OctetString.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_OctetString.restype = ctypes.c_uint32 + # Cluster TestCluster ReadAttribute ClusterRevision + self._chipLib.chip_ime_ReadAttribute_TestCluster_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] + self._chipLib.chip_ime_ReadAttribute_TestCluster_ClusterRevision.restype = ctypes.c_uint32 # Cluster Thermostat # Cluster Thermostat Command ClearWeeklySchedule self._chipLib.chip_ime_AppendCommand_Thermostat_ClearWeeklySchedule.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] diff --git a/src/controller/python/gen/CHIPClientCallbacks.cpp b/src/controller/python/gen/CHIPClientCallbacks.cpp index 70a488cb90df99..84abd16b2426bb 100644 --- a/src/controller/python/gen/CHIPClientCallbacks.cpp +++ b/src/controller/python/gen/CHIPClientCallbacks.cpp @@ -506,6 +506,26 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag } } break; + case 0x050F: + switch (attributeId) + { + case 0x001A: // INT8U + { + uint8_t data[count]; + for (size_t i = 0; i < count; i++) + { + data[i] = emberAfGetInt8u(message, 0, messageLen); + message += 1; + CHECK_MESSAGE_LENGTH(1); + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, count, data); + break; + } + } + break; } break; } @@ -2052,6 +2072,19 @@ bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::app::Comm return true; } +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestSpecificResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_RESPONSE_CALLBACKS("TestClusterClusterTestSpecificResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) { ChipLogProgress(Zcl, "emberAfReportAttributeCallback:"); diff --git a/src/controller/python/gen/CHIPClientCallbacks.h b/src/controller/python/gen/CHIPClientCallbacks.h index b06c6463af03ed..72855168d14220 100644 --- a/src/controller/python/gen/CHIPClientCallbacks.h +++ b/src/controller/python/gen/CHIPClientCallbacks.h @@ -125,6 +125,7 @@ typedef void (*TvChannelClusterChangeChannelResponseCallback)(void * context, /* TYPE WARNING: array array defaults to */ uint8_t * ChannelMatch, uint8_t ErrorType); typedef void (*TargetNavigatorClusterNavigateTargetResponseCallback)(void * context, uint8_t * data); +typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); // List specific responses typedef void (*DescriptorDeviceListListAttributeCallback)(void * context, uint16_t count, _DeviceType * entries); @@ -134,3 +135,4 @@ typedef void (*DescriptorPartsListListAttributeCallback)(void * context, uint16_ typedef void (*GroupKeyManagementGroupsListAttributeCallback)(void * context, uint16_t count, _GroupState * entries); typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)(void * context, uint16_t count, _GroupKey * entries); typedef void (*OperationalCredentialsFabricsListListAttributeCallback)(void * context, uint16_t count, _FabricDescriptor * entries); +typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, uint16_t count, uint8_t * entries); diff --git a/src/controller/python/gen/CHIPClusters.cpp b/src/controller/python/gen/CHIPClusters.cpp index 1f7a7bc15002dc..0edde18b28d8d6 100644 --- a/src/controller/python/gen/CHIPClusters.cpp +++ b/src/controller/python/gen/CHIPClusters.cpp @@ -5303,6 +5303,362 @@ CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback: return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } +// TestCluster Cluster Commands +CHIP_ERROR TestClusterCluster::Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestNotHandledCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestNotHandledCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestSpecificCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestSpecificCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +// TestCluster Cluster Attributes +CHIP_ERROR TestClusterCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR TestClusterCluster::ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBooleanAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBooleanAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap32Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap32Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap64Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap64Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadOctetStringAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteOctetStringAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadListInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + // Thermostat Cluster Commands CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) diff --git a/src/controller/python/gen/CHIPClusters.h b/src/controller/python/gen/CHIPClusters.h index 8b9bbc2de89127..0639794a52d6cc 100644 --- a/src/controller/python/gen/CHIPClusters.h +++ b/src/controller/python/gen/CHIPClusters.h @@ -56,6 +56,7 @@ constexpr ClusterId kSwitchClusterId = 0x003B; constexpr ClusterId kTvChannelClusterId = 0x0504; constexpr ClusterId kTargetNavigatorClusterId = 0x0505; constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr ClusterId kTestClusterClusterId = 0x050F; constexpr ClusterId kThermostatClusterId = 0x0201; constexpr ClusterId kWakeOnLanClusterId = 0x0503; constexpr ClusterId kWindowCoveringClusterId = 0x0102; @@ -979,6 +980,76 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT TestClusterCluster : public ClusterBase +{ +public: + TestClusterCluster() : ClusterBase(kTestClusterClusterId) {} + ~TestClusterCluster() {} + + // Cluster Commands + CHIP_ERROR Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int8_t value); + CHIP_ERROR WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int16_t value); + CHIP_ERROR WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int32_t value); + CHIP_ERROR WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int64_t value); + CHIP_ERROR WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan value); + +private: + static constexpr CommandId kTestCommandId = 0x00; + static constexpr CommandId kTestNotHandledCommandId = 0x01; + static constexpr CommandId kTestSpecificCommandId = 0x02; +}; + class DLL_EXPORT ThermostatCluster : public ClusterBase { public: diff --git a/src/controller/python/gen/CHIPClustersObjc.h b/src/controller/python/gen/CHIPClustersObjc.h index f8f112a2baa762..e099d7c65f431a 100644 --- a/src/controller/python/gen/CHIPClustersObjc.h +++ b/src/controller/python/gen/CHIPClustersObjc.h @@ -827,6 +827,53 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Test Cluster + * + */ +@interface CHIPTestCluster : CHIPCluster + +- (void)test:(ResponseHandler)completionHandler; +- (void)testNotHandled:(ResponseHandler)completionHandler; +- (void)testSpecific:(ResponseHandler)completionHandler; + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler; +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum8:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum16:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeOctetString:(ResponseHandler)completionHandler; +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + +@end + /** * Cluster Thermostat * diff --git a/src/controller/python/gen/CHIPClustersObjc.mm b/src/controller/python/gen/CHIPClustersObjc.mm index b3cb96342b06a7..131bc5900f3a16 100644 --- a/src/controller/python/gen/CHIPClustersObjc.mm +++ b/src/controller/python/gen/CHIPClustersObjc.mm @@ -259,6 +259,38 @@ static void CallbackFn(void * context, uint16_t value) bool mKeepAlive; }; +class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt16sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int16_t value) + { + CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt32uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -291,6 +323,38 @@ static void CallbackFn(void * context, uint32_t value) bool mKeepAlive; }; +class CHIPInt32sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt32sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt32sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int32_t value) + { + CHIPInt32sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLong:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt64uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -323,24 +387,24 @@ static void CallbackFn(void * context, uint64_t value) bool mKeepAlive; }; -class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +class CHIPInt64sAttributeCallbackBridge : public Callback::Callback { public: - CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) - : Callback::Callback(CallbackFn, this) + CHIPInt64sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) , mKeepAlive(keepAlive) { } - ~CHIPInt16sAttributeCallbackBridge() {}; + ~CHIPInt64sAttributeCallbackBridge() {}; - static void CallbackFn(void * context, int16_t value) + static void CallbackFn(void * context, int64_t value) { - CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + CHIPInt64sAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ - callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLongLong:value] }); if (!callback->mKeepAlive) { callback->Cancel(); delete callback; @@ -2419,6 +2483,38 @@ static void CallbackFn(void * context, uint8_t * data) dispatch_queue_t mQueue; }; +class CHIPTestClusterClusterTestSpecificResponseCallbackBridge + : public Callback::Callback { +public: + CHIPTestClusterClusterTestSpecificResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterClusterTestSpecificResponseCallbackBridge() {}; + + static void CallbackFn(void * context, uint8_t returnValue) + { + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { + @"returnValue" : [NSNumber numberWithUnsignedChar:returnValue], + }); + callback->Cancel(); + delete callback; + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + class CHIPDescriptorDeviceListAttributeCallbackBridge : public Callback::Callback { public: CHIPDescriptorDeviceListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) @@ -2680,6 +2776,41 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri dispatch_queue_t mQueue; }; +class CHIPTestClusterListInt8uAttributeCallbackBridge : public Callback::Callback { +public: + CHIPTestClusterListInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterListInt8uAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, uint16_t count, uint8_t * entries) + { + CHIPTestClusterListInt8uAttributeCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + id values[count]; + for (uint16_t i = 0; i < count; i++) { + values[i] = [NSNumber numberWithUnsignedChar:entries[i]]; + } + + id array = [NSArray arrayWithObjects:values count:count]; + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : array }); + callback->Cancel(); + delete callback; + }); + } + } + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + @interface CHIPCluster () @property (readonly, nonatomic) dispatch_queue_t callbackQueue; @property (readonly, nonatomic) dispatch_queue_t chipWorkQueue; @@ -11433,6 +11564,1021 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler @end +@interface CHIPTestCluster () +@property (readonly) Controller::TestClusterCluster cppCluster; +@end + +@implementation CHIPTestCluster + +- (Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)test:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.Test(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testNotHandled:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestNotHandled(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testSpecific:(ResponseHandler)completionHandler +{ + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestSpecific(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler +{ + CHIPBooleanAttributeCallbackBridge * onSuccess + = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8u:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16u:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32u:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64u:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8s:(ResponseHandler)completionHandler +{ + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16s:(ResponseHandler)completionHandler +{ + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32s:(ResponseHandler)completionHandler +{ + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64s:(ResponseHandler)completionHandler +{ + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeOctetString:(ResponseHandler)completionHandler +{ + CHIPStringAttributeCallbackBridge * onSuccess + = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeOctetString( + onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) value.bytes, value.length)); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +{ + CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess + = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeListInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +@end + @interface CHIPThermostat () @property (readonly) Controller::ThermostatCluster cppCluster; @end diff --git a/src/controller/python/gen/IMClusterCommandHandler.cpp b/src/controller/python/gen/IMClusterCommandHandler.cpp index 67a1ba05e47c91..5e52280a1eba6e 100644 --- a/src/controller/python/gen/IMClusterCommandHandler.cpp +++ b/src/controller/python/gen/IMClusterCommandHandler.cpp @@ -5744,6 +5744,93 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace TargetNavigator +namespace TestCluster { + +void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint8_t returnValue; + bool returnValueExists = false; + uint32_t validArgumentCount = 0; + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (returnValueExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(returnValue); + if (CHIP_NO_ERROR == TLVUnpackError) + { + returnValueExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } + + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestSpecificResponseCallback(apCommandObj, returnValue); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 1, validArgumentCount, TLVError, TLVUnpackError); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TEST_CLUSTER_ID); + break; + } + } + } +} + +} // namespace TestCluster + } // namespace clusters void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, diff --git a/src/controller/python/gen/attribute-id.h b/src/controller/python/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/src/controller/python/gen/attribute-id.h +++ b/src/controller/python/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/src/controller/python/gen/call-command-handler.cpp b/src/controller/python/gen/call-command-handler.cpp index 73e9df19068857..9f4438c1700029 100644 --- a/src/controller/python/gen/call-command-handler.cpp +++ b/src/controller/python/gen/call-command-handler.cpp @@ -57,6 +57,7 @@ EmberAfStatus emberAfSwitchClusterClientCommandParse(EmberAfClusterCommand * cmd EmberAfStatus emberAfTvChannelClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTargetNavigatorClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThermostatClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfWakeOnLanClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfWindowCoveringClusterClientCommandParse(EmberAfClusterCommand * cmd); @@ -192,6 +193,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Temperature Measurement result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEST_CLUSTER_ID: + result = emberAfTestClusterClusterClientCommandParse(cmd); + break; case ZCL_THERMOSTAT_CLUSTER_ID: // No commands are enabled for cluster Thermostat result = status(false, true, cmd->mfgSpecific); @@ -1772,3 +1776,32 @@ EmberAfStatus emberAfTargetNavigatorClusterClientCommandParse(EmberAfClusterComm } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t returnValue; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + returnValue = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTestClusterClusterTestSpecificResponseCallback(nullptr, returnValue); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} diff --git a/src/controller/python/gen/callback-stub.cpp b/src/controller/python/gen/callback-stub.cpp index 9ebbcf0a7d606f..857fb342e54abf 100644 --- a/src/controller/python/gen/callback-stub.cpp +++ b/src/controller/python/gen/callback-stub.cpp @@ -116,6 +116,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; + case ZCL_TEST_CLUSTER_ID: + emberAfTestClusterClusterInitCallback(endpoint); + break; case ZCL_THERMOSTAT_CLUSTER_ID: emberAfThermostatClusterInitCallback(endpoint); break; @@ -276,6 +279,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfTestClusterClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/src/controller/python/gen/callback.h b/src/controller/python/gen/callback.h index 17c89be4d98fc7..5f3c5701391605 100644 --- a/src/controller/python/gen/callback.h +++ b/src/controller/python/gen/callback.h @@ -272,6 +272,14 @@ void emberAfTargetNavigatorClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Test Cluster Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thermostat Cluster Init * * Cluster Init @@ -2335,6 +2343,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallb */ void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId endpoint); +// +// Test Cluster Cluster client +// + +/** @brief Test Cluster Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Test Cluster Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTestClusterClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Test Cluster Cluster Client Manufacturer Specific Attribute Changed + * + * Client Manufacturer Specific Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + * @param manufacturerCode Manufacturer Code of the attribute that changed + */ +void emberAfTestClusterClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Test Cluster Cluster Client Message Sent + * + * Client Message Sent + * + * @param type The type of message sent + * @param indexOrDestination The destination or address to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Test Cluster Cluster Client Pre Attribute Changed + * + * client Pre Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); + +/** @brief Test Cluster Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTestClusterClusterClientTickCallback(chip::EndpointId endpoint); + // // Thermostat Cluster client // @@ -3099,6 +3177,13 @@ bool emberAfTvChannelClusterChangeChannelResponseCallback(chip::app::Command * c bool emberAfTargetNavigatorClusterNavigateTargetResponseCallback(chip::app::Command * commandObj, uint8_t status, uint8_t * data); +/** + * @brief Test Cluster Cluster TestSpecificResponse Command callback + * @param returnValue + */ + +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue); + // // Non-Cluster Related Callbacks // diff --git a/src/controller/python/gen/client-command-macro.h b/src/controller/python/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/src/controller/python/gen/client-command-macro.h +++ b/src/controller/python/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/src/controller/python/gen/cluster-id.h b/src/controller/python/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/src/controller/python/gen/cluster-id.h +++ b/src/controller/python/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/src/controller/python/gen/command-id.h b/src/controller/python/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/src/controller/python/gen/command-id.h +++ b/src/controller/python/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/src/controller/python/gen/endpoint_config.h b/src/controller/python/gen/endpoint_config.h index 57dd0d20ae339f..79ba2a6aca84ac 100644 --- a/src/controller/python/gen/endpoint_config.h +++ b/src/controller/python/gen/endpoint_config.h @@ -63,7 +63,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 32 +#define GENERATED_ATTRIBUTE_COUNT 33 #define GENERATED_ATTRIBUTES \ { \ \ @@ -156,6 +156,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Account Login (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Binding (client) */ \ @@ -172,7 +175,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 32 +#define GENERATED_CLUSTER_COUNT 33 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -254,10 +257,13 @@ 0x050E, ZAP_ATTRIBUTE_INDEX(29), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Account Login (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(30), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { \ + 0xF000, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(31), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(32), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -266,7 +272,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 32, 64 }, \ + { ZAP_CLUSTER_INDEX(0), 33, 66 }, \ } // Largest attribute size is needed for various buffers @@ -276,7 +282,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (2) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (64) +#define ATTRIBUTE_MAX_SIZE (66) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) @@ -320,7 +326,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (194) +#define EMBER_AF_GENERATED_COMMAND_COUNT (198) #define GENERATED_COMMANDS \ { \ \ @@ -575,6 +581,12 @@ { 0x050E, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetSetupPINResponse */ \ { 0x050E, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Login */ \ \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ + { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ + { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ + \ /* Endpoint: 1, Cluster: Binding (client) */ \ { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ diff --git a/src/controller/python/gen/gen_config.h b/src/controller/python/gen/gen_config.h index ffc44e1bcc0f80..49990103d919cb 100644 --- a/src/controller/python/gen/gen_config.h +++ b/src/controller/python/gen/gen_config.h @@ -58,6 +58,7 @@ #define EMBER_AF_TV_CHANNEL_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_TEST_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_WAKE_ON_LAN_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_WINDOW_COVERING_CLUSTER_CLIENT_ENDPOINT_COUNT (1) @@ -180,6 +181,10 @@ #define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_CLIENT +// Use this macro to check if the client side of the Test Cluster cluster is included +#define ZCL_USING_TEST_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TEST_CLUSTER_CLIENT + // Use this macro to check if the client side of the Thermostat cluster is included #define ZCL_USING_THERMOSTAT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_THERMOSTAT_CLIENT diff --git a/src/controller/python/gen/print-cluster.h b/src/controller/python/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/src/controller/python/gen/print-cluster.h +++ b/src/controller/python/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/src/controller/python/local-clusters.zap b/src/controller/python/local-clusters.zap index 0b5717d0c4a3e5..0b072d62b5b24b 100644 --- a/src/controller/python/local-clusters.zap +++ b/src/controller/python/local-clusters.zap @@ -5770,6 +5770,347 @@ } ] }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "TestSpecificResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "boolean", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap8", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap16", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap32", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap64", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8u", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16u", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32u", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64u", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8s", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16s", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32s", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64s", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum8", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Binding", "code": 61440, @@ -5936,4 +6277,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/src/darwin/Framework/CHIP/chip-tool.zap b/src/darwin/Framework/CHIP/chip-tool.zap index 81a5a29338aeae..5b4977e1735510 100644 --- a/src/darwin/Framework/CHIP/chip-tool.zap +++ b/src/darwin/Framework/CHIP/chip-tool.zap @@ -1,5 +1,5 @@ { - "featureLevel": 26, + "featureLevel": 29, "creator": "zap", "keyValuePairs": [ { @@ -18,13 +18,13 @@ "package": [ { "pathRelativity": "relativeToZap", - "path": "../../src/app/zap-templates/zcl/zcl.json", + "path": "../../../app/zap-templates/zcl/zcl.json", "version": "ZCL Test Data", "type": "zcl-properties" }, { "pathRelativity": "relativeToZap", - "path": "../../src/app/zap-templates/app-templates.json", + "path": "../../../app/zap-templates/app-templates.json", "version": "chip-v1", "type": "gen-templates-json" } @@ -4480,6 +4480,347 @@ } ] }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Test", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestNotHandled", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "TestSpecific", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "client", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Test Cluster", + "code": 1295, + "mfgCode": null, + "define": "TEST_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "TestSpecificResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "boolean", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap8", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap16", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap32", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "bitmap64", + "code": 4, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8u", + "code": 5, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16u", + "code": 6, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32u", + "code": 8, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64u", + "code": 12, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int8s", + "code": 13, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int16s", + "code": 14, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int32s", + "code": 16, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "int64s", + "code": 20, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum8", + "code": 21, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "enum16", + "code": 22, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "octet_string", + "code": 25, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "list_int8u", + "code": 26, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "cluster revision", + "code": 65533, + "mfgCode": null, + "side": "server", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, { "name": "Binding", "code": 61440, @@ -4640,8 +4981,10 @@ "endpointTypeIndex": 0, "profileId": "0x0103", "endpointId": 1, - "networkId": 0 + "networkId": 0, + "endpointVersion": null, + "deviceIdentifier": null } ], "log": [] -} \ No newline at end of file +} diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp index 3e531c9fa498fc..64caca3e311ade 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp +++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp @@ -506,6 +506,26 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag } } break; + case 0x050F: + switch (attributeId) + { + case 0x001A: // INT8U + { + uint8_t data[count]; + for (size_t i = 0; i < count; i++) + { + data[i] = emberAfGetInt8u(message, 0, messageLen); + message += 1; + CHECK_MESSAGE_LENGTH(1); + } + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, count, data); + break; + } + } + break; } break; } @@ -1785,6 +1805,19 @@ bool emberAfScenesClusterViewSceneResponseCallback(chip::app::Command * commandO return true; } +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue) +{ + ChipLogProgress(Zcl, "TestSpecificResponse:"); + ChipLogProgress(Zcl, " returnValue: %" PRIu8 "", returnValue); + + GET_RESPONSE_CALLBACKS("TestClusterClusterTestSpecificResponseCallback"); + + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); + cb->mCall(cb->mContext, returnValue); + return true; +} + bool emberAfReportAttributesCallback(ClusterId clusterId, uint8_t * message, uint16_t messageLen) { ChipLogProgress(Zcl, "emberAfReportAttributeCallback:"); diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h index 8bb5691a5e5d10..d2c56fe3e0efee 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h @@ -105,6 +105,7 @@ typedef void (*ScenesClusterStoreSceneResponseCallback)(void * context, uint16_t typedef void (*ScenesClusterViewSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); +typedef void (*TestClusterClusterTestSpecificResponseCallback)(void * context, uint8_t returnValue); // List specific responses typedef void (*DescriptorDeviceListListAttributeCallback)(void * context, uint16_t count, _DeviceType * entries); @@ -114,3 +115,4 @@ typedef void (*DescriptorPartsListListAttributeCallback)(void * context, uint16_ typedef void (*GroupKeyManagementGroupsListAttributeCallback)(void * context, uint16_t count, _GroupState * entries); typedef void (*GroupKeyManagementGroupKeysListAttributeCallback)(void * context, uint16_t count, _GroupKey * entries); typedef void (*OperationalCredentialsFabricsListListAttributeCallback)(void * context, uint16_t count, _FabricDescriptor * entries); +typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, uint16_t count, uint8_t * entries); diff --git a/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp b/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp index a5db71393871a4..d2a3c21c50bdb1 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp +++ b/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp @@ -4309,6 +4309,362 @@ CHIP_ERROR TemperatureMeasurementCluster::ReadAttributeClusterRevision(Callback: return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); } +// TestCluster Cluster Commands +CHIP_ERROR TestClusterCluster::Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestNotHandledCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestNotHandledCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +CHIP_ERROR TestClusterCluster::TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) +{ +#if CHIP_ENABLE_INTERACTION_MODEL + VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); + (void) onSuccessCallback; + (void) onFailureCallback; + + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kTestSpecificCommandId, + (chip::app::CommandPathFlags::kEndpointIdValid) }; + app::Command * ZCLcommand = mDevice->GetCommandSender(); + + ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); + + // Command takes no arguments. + + ReturnErrorOnFailure(ZCLcommand->FinishCommand()); + + return mDevice->SendCommands(); +#else + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterTestSpecificCommand(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +#endif +} + +// TestCluster Cluster Attributes +CHIP_ERROR TestClusterCluster::DiscoverAttributes(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterDiscoverAttributes(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} +CHIP_ERROR TestClusterCluster::ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBooleanAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBooleanAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap32Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap32Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadBitmap64Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteBitmap64Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64uAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt8sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt8sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt16sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt16sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt32sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int32_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt32sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadInt64sAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, int64_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteInt64sAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum8Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint8_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum8Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadEnum16Attribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteEnum16Attribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadOctetStringAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::ByteSpan value) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterWriteOctetStringAttribute(seqNum, mEndpoint, value); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadListInt8uAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + +CHIP_ERROR TestClusterCluster::ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback) +{ + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeTestClusterClusterReadClusterRevisionAttribute(seqNum, mEndpoint); + return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); +} + // Thermostat Cluster Commands CHIP_ERROR ThermostatCluster::ClearWeeklySchedule(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback) diff --git a/src/darwin/Framework/CHIP/gen/CHIPClusters.h b/src/darwin/Framework/CHIP/gen/CHIPClusters.h index 751c92ab71403b..d2b819408e5deb 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClusters.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClusters.h @@ -47,6 +47,7 @@ constexpr ClusterId kPumpConfigurationAndControlClusterId = 0x0200; constexpr ClusterId kScenesClusterId = 0x0005; constexpr ClusterId kSwitchClusterId = 0x003B; constexpr ClusterId kTemperatureMeasurementClusterId = 0x0402; +constexpr ClusterId kTestClusterClusterId = 0x050F; constexpr ClusterId kThermostatClusterId = 0x0201; class DLL_EXPORT ApplicationBasicCluster : public ClusterBase @@ -756,6 +757,76 @@ class DLL_EXPORT TemperatureMeasurementCluster : public ClusterBase CHIP_ERROR ReportAttributeMeasuredValue(Callback::Cancelable * onReportCallback); }; +class DLL_EXPORT TestClusterCluster : public ClusterBase +{ +public: + TestClusterCluster() : ClusterBase(kTestClusterClusterId) {} + ~TestClusterCluster() {} + + // Cluster Commands + CHIP_ERROR Test(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestNotHandled(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR TestSpecific(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + + // Cluster Attributes + CHIP_ERROR DiscoverAttributes(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeListInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); + CHIP_ERROR WriteAttributeBoolean(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeBitmap16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeBitmap32(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeBitmap64(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeInt16u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeInt32u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint32_t value); + CHIP_ERROR WriteAttributeInt64u(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint64_t value); + CHIP_ERROR WriteAttributeInt8s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int8_t value); + CHIP_ERROR WriteAttributeInt16s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int16_t value); + CHIP_ERROR WriteAttributeInt32s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int32_t value); + CHIP_ERROR WriteAttributeInt64s(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + int64_t value); + CHIP_ERROR WriteAttributeEnum8(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint8_t value); + CHIP_ERROR WriteAttributeEnum16(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + uint16_t value); + CHIP_ERROR WriteAttributeOctetString(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, + chip::ByteSpan value); + +private: + static constexpr CommandId kTestCommandId = 0x00; + static constexpr CommandId kTestNotHandledCommandId = 0x01; + static constexpr CommandId kTestSpecificCommandId = 0x02; +}; + class DLL_EXPORT ThermostatCluster : public ClusterBase { public: diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index c4ca0d9d92515b..a4519bdf6fb0c7 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -685,6 +685,53 @@ NS_ASSUME_NONNULL_BEGIN @end +/** + * Cluster Test Cluster + * + */ +@interface CHIPTestCluster : CHIPCluster + +- (void)test:(ResponseHandler)completionHandler; +- (void)testNotHandled:(ResponseHandler)completionHandler; +- (void)testSpecific:(ResponseHandler)completionHandler; + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler; +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64u:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt8s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt16s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt32s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeInt64s:(ResponseHandler)completionHandler; +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum8:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeEnum16:(ResponseHandler)completionHandler; +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeOctetString:(ResponseHandler)completionHandler; +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + +@end + /** * Cluster Thermostat * diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 7506e21b230198..ea1b7c2606ec06 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -259,6 +259,38 @@ static void CallbackFn(void * context, uint16_t value) bool mKeepAlive; }; +class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt16sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int16_t value) + { + CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt32uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt32uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -291,6 +323,38 @@ static void CallbackFn(void * context, uint32_t value) bool mKeepAlive; }; +class CHIPInt32sAttributeCallbackBridge : public Callback::Callback { +public: + CHIPInt32sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + , mKeepAlive(keepAlive) + { + } + + ~CHIPInt32sAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, int32_t value) + { + CHIPInt32sAttributeCallbackBridge * callback = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLong:value] }); + if (!callback->mKeepAlive) { + callback->Cancel(); + delete callback; + } + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; + bool mKeepAlive; +}; + class CHIPInt64uAttributeCallbackBridge : public Callback::Callback { public: CHIPInt64uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) @@ -323,24 +387,24 @@ static void CallbackFn(void * context, uint64_t value) bool mKeepAlive; }; -class CHIPInt16sAttributeCallbackBridge : public Callback::Callback { +class CHIPInt64sAttributeCallbackBridge : public Callback::Callback { public: - CHIPInt16sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) - : Callback::Callback(CallbackFn, this) + CHIPInt64sAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue, bool keepAlive = false) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) , mKeepAlive(keepAlive) { } - ~CHIPInt16sAttributeCallbackBridge() {}; + ~CHIPInt64sAttributeCallbackBridge() {}; - static void CallbackFn(void * context, int16_t value) + static void CallbackFn(void * context, int64_t value) { - CHIPInt16sAttributeCallbackBridge * callback = reinterpret_cast(context); + CHIPInt64sAttributeCallbackBridge * callback = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ - callback->mHandler(nil, @ { @"value" : [NSNumber numberWithShort:value] }); + callback->mHandler(nil, @ { @"value" : [NSNumber numberWithLongLong:value] }); if (!callback->mKeepAlive) { callback->Cancel(); delete callback; @@ -1842,6 +1906,38 @@ static void CallbackFn(void * context, uint16_t groupId, uint8_t sceneId, uint16 dispatch_queue_t mQueue; }; +class CHIPTestClusterClusterTestSpecificResponseCallbackBridge + : public Callback::Callback { +public: + CHIPTestClusterClusterTestSpecificResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterClusterTestSpecificResponseCallbackBridge() {}; + + static void CallbackFn(void * context, uint8_t returnValue) + { + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { + @"returnValue" : [NSNumber numberWithUnsignedChar:returnValue], + }); + callback->Cancel(); + delete callback; + }); + } + }; + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + class CHIPDescriptorDeviceListAttributeCallbackBridge : public Callback::Callback { public: CHIPDescriptorDeviceListAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) @@ -2103,6 +2199,41 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri dispatch_queue_t mQueue; }; +class CHIPTestClusterListInt8uAttributeCallbackBridge : public Callback::Callback { +public: + CHIPTestClusterListInt8uAttributeCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) + , mHandler(handler) + , mQueue(queue) + { + } + + ~CHIPTestClusterListInt8uAttributeCallbackBridge() {}; + + static void CallbackFn(void * context, uint16_t count, uint8_t * entries) + { + CHIPTestClusterListInt8uAttributeCallbackBridge * callback + = reinterpret_cast(context); + if (callback && callback->mQueue) { + id values[count]; + for (uint16_t i = 0; i < count; i++) { + values[i] = [NSNumber numberWithUnsignedChar:entries[i]]; + } + + id array = [NSArray arrayWithObjects:values count:count]; + dispatch_async(callback->mQueue, ^{ + callback->mHandler(nil, @ { @"value" : array }); + callback->Cancel(); + delete callback; + }); + } + } + +private: + ResponseHandler mHandler; + dispatch_queue_t mQueue; +}; + @interface CHIPCluster () @property (readonly, nonatomic) dispatch_queue_t callbackQueue; @property (readonly, nonatomic) dispatch_queue_t chipWorkQueue; @@ -9483,6 +9614,1021 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler @end +@interface CHIPTestCluster () +@property (readonly) Controller::TestClusterCluster cppCluster; +@end + +@implementation CHIPTestCluster + +- (Controller::ClusterBase *)getCluster +{ + return &_cppCluster; +} + +- (void)test:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.Test(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testNotHandled:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestNotHandled(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} +- (void)testSpecific:(ResponseHandler)completionHandler +{ + CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.TestSpecific(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBoolean:(ResponseHandler)completionHandler +{ + CHIPBooleanAttributeCallbackBridge * onSuccess + = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBoolean(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap32(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeBitmap64(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8u:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16u:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32u:(ResponseHandler)completionHandler +{ + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64u:(ResponseHandler)completionHandler +{ + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64u(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt8s:(ResponseHandler)completionHandler +{ + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt8s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt16s:(ResponseHandler)completionHandler +{ + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt16s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt32s:(ResponseHandler)completionHandler +{ + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt32s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeInt64s:(ResponseHandler)completionHandler +{ + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeInt64s(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum8:(ResponseHandler)completionHandler +{ + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum8(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeEnum16:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeEnum16(onSuccess->Cancel(), onFailure->Cancel(), value); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeOctetString:(ResponseHandler)completionHandler +{ + CHIPStringAttributeCallbackBridge * onSuccess + = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeOctetString(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +{ + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.WriteAttributeOctetString( + onSuccess->Cancel(), onFailure->Cancel(), chip::ByteSpan((const uint8_t *) value.bytes, value.length)); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +{ + CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess + = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeListInt8u(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +{ + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + if (!onSuccess) { + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + if (!onFailure) { + delete onSuccess; + completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + return; + } + + __block CHIP_ERROR err; + dispatch_sync([self chipWorkQueue], ^{ + err = self.cppCluster.ReadAttributeClusterRevision(onSuccess->Cancel(), onFailure->Cancel()); + }); + + if (err != CHIP_NO_ERROR) { + delete onSuccess; + delete onFailure; + completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + } +} + +@end + @interface CHIPThermostat () @property (readonly) Controller::ThermostatCluster cppCluster; @end diff --git a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp index 934fb34f6b2abf..01f14340b6428e 100644 --- a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp +++ b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp @@ -4310,6 +4310,93 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace Scenes +namespace TestCluster { + +void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint8_t returnValue; + bool returnValueExists = false; + uint32_t validArgumentCount = 0; + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (returnValueExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(returnValue); + if (CHIP_NO_ERROR == TLVUnpackError) + { + returnValueExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } + + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTestClusterClusterTestSpecificResponseCallback(apCommandObj, returnValue); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 1, validArgumentCount, TLVError, TLVUnpackError); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TEST_CLUSTER_ID); + break; + } + } + } +} + +} // namespace TestCluster + } // namespace clusters void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aCommandId, chip::EndpointId aEndPointId, diff --git a/src/darwin/Framework/CHIP/gen/attribute-id.h b/src/darwin/Framework/CHIP/gen/attribute-id.h index 8e7aa393464caf..e4691450f06d9c 100644 --- a/src/darwin/Framework/CHIP/gen/attribute-id.h +++ b/src/darwin/Framework/CHIP/gen/attribute-id.h @@ -1240,6 +1240,29 @@ // Server attributes +// Attribute ids for cluster: Test Cluster + +// Client attributes + +// Server attributes +#define ZCL_BOOLEAN_ATTRIBUTE_ID (0x0000) +#define ZCL_BITMAP8_ATTRIBUTE_ID (0x0001) +#define ZCL_BITMAP16_ATTRIBUTE_ID (0x0002) +#define ZCL_BITMAP32_ATTRIBUTE_ID (0x0003) +#define ZCL_BITMAP64_ATTRIBUTE_ID (0x0004) +#define ZCL_INT8_U_ATTRIBUTE_ID (0x0005) +#define ZCL_INT16_U_ATTRIBUTE_ID (0x0006) +#define ZCL_INT32_U_ATTRIBUTE_ID (0x0008) +#define ZCL_INT64_U_ATTRIBUTE_ID (0x000C) +#define ZCL_INT8_S_ATTRIBUTE_ID (0x000D) +#define ZCL_INT16_S_ATTRIBUTE_ID (0x000E) +#define ZCL_INT32_S_ATTRIBUTE_ID (0x0010) +#define ZCL_INT64_S_ATTRIBUTE_ID (0x0014) +#define ZCL_ENUM8_ATTRIBUTE_ID (0x0015) +#define ZCL_ENUM16_ATTRIBUTE_ID (0x0016) +#define ZCL_OCTET_STRING_ATTRIBUTE_ID (0x0019) +#define ZCL_LIST_ATTRIBUTE_ID (0x001A) + // Attribute ids for cluster: Generic Tunnel // Client attributes diff --git a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp index 8a2ac614c4bc67..a0a60ecc16014e 100644 --- a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp +++ b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp @@ -48,6 +48,7 @@ EmberAfStatus emberAfPumpConfigurationAndControlClusterClientCommandParse(EmberA EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfSwitchClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfTemperatureMeasurementClusterClientCommandParse(EmberAfClusterCommand * cmd); +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd); EmberAfStatus emberAfThermostatClusterClientCommandParse(EmberAfClusterCommand * cmd); static EmberAfStatus status(bool wasHandled, bool clusterExists, bool mfgSpecific) @@ -152,6 +153,9 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) // No commands are enabled for cluster Temperature Measurement result = status(false, true, cmd->mfgSpecific); break; + case ZCL_TEST_CLUSTER_ID: + result = emberAfTestClusterClusterClientCommandParse(cmd); + break; case ZCL_THERMOSTAT_CLUSTER_ID: // No commands are enabled for cluster Thermostat result = status(false, true, cmd->mfgSpecific); @@ -1348,3 +1352,32 @@ EmberAfStatus emberAfScenesClusterClientCommandParse(EmberAfClusterCommand * cmd } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfTestClusterClusterClientCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t returnValue; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + returnValue = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTestClusterClusterTestSpecificResponseCallback(nullptr, returnValue); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} diff --git a/src/darwin/Framework/CHIP/gen/callback-stub.cpp b/src/darwin/Framework/CHIP/gen/callback-stub.cpp index 692e2845326d6d..de7b7758bd5a8a 100644 --- a/src/darwin/Framework/CHIP/gen/callback-stub.cpp +++ b/src/darwin/Framework/CHIP/gen/callback-stub.cpp @@ -89,6 +89,9 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case ZCL_TEMP_MEASUREMENT_CLUSTER_ID: emberAfTemperatureMeasurementClusterInitCallback(endpoint); break; + case ZCL_TEST_CLUSTER_ID: + emberAfTestClusterClusterInitCallback(endpoint); + break; case ZCL_THERMOSTAT_CLUSTER_ID: emberAfThermostatClusterInitCallback(endpoint); break; @@ -198,6 +201,11 @@ void __attribute__((weak)) emberAfTemperatureMeasurementClusterInitCallback(Endp // To prevent warning (void) endpoint; } +void __attribute__((weak)) emberAfTestClusterClusterInitCallback(EndpointId endpoint) +{ + // To prevent warning + (void) endpoint; +} void __attribute__((weak)) emberAfThermostatClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/src/darwin/Framework/CHIP/gen/callback.h b/src/darwin/Framework/CHIP/gen/callback.h index 427396801eb7a0..a73a115fd733bf 100644 --- a/src/darwin/Framework/CHIP/gen/callback.h +++ b/src/darwin/Framework/CHIP/gen/callback.h @@ -200,6 +200,14 @@ void emberAfSwitchClusterInitCallback(chip::EndpointId endpoint); */ void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint); +/** @brief Test Cluster Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterInitCallback(chip::EndpointId endpoint); + /** @brief Thermostat Cluster Init * * Cluster Init @@ -1615,6 +1623,76 @@ EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallb */ void emberAfTemperatureMeasurementClusterClientTickCallback(chip::EndpointId endpoint); +// +// Test Cluster Cluster client +// + +/** @brief Test Cluster Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfTestClusterClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Test Cluster Cluster Client Attribute Changed + * + * Client Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + */ +void emberAfTestClusterClusterClientAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId); + +/** @brief Test Cluster Cluster Client Manufacturer Specific Attribute Changed + * + * Client Manufacturer Specific Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute that changed + * @param manufacturerCode Manufacturer Code of the attribute that changed + */ +void emberAfTestClusterClusterClientManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, + chip::AttributeId attributeId, + uint16_t manufacturerCode); + +/** @brief Test Cluster Cluster Client Message Sent + * + * Client Message Sent + * + * @param type The type of message sent + * @param indexOrDestination The destination or address to which the message was sent + * @param apsFrame The APS frame for the message + * @param msgLen The length of the message + * @param message The message that was sent + * @param status The status of the sent message + */ +void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, + EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, + EmberStatus status); + +/** @brief Test Cluster Cluster Client Pre Attribute Changed + * + * client Pre Attribute Changed + * + * @param endpoint Endpoint that is being initialized + * @param attributeId Attribute to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, + EmberAfAttributeType attributeType, uint8_t size, + uint8_t * value); + +/** @brief Test Cluster Cluster Client Tick + * + * client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfTestClusterClusterClientTickCallback(chip::EndpointId endpoint); + // // Thermostat Cluster client // @@ -2103,6 +2181,13 @@ bool emberAfScenesClusterViewSceneResponseCallback(chip::app::Command * commandO uint8_t sceneId, uint16_t transitionTime, uint8_t * sceneName, /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets); +/** + * @brief Test Cluster Cluster TestSpecificResponse Command callback + * @param returnValue + */ + +bool emberAfTestClusterClusterTestSpecificResponseCallback(chip::app::Command * commandObj, uint8_t returnValue); + // // Non-Cluster Related Callbacks // diff --git a/src/darwin/Framework/CHIP/gen/client-command-macro.h b/src/darwin/Framework/CHIP/gen/client-command-macro.h index 1cfc06d80ce7c2..c8666bc5678d12 100644 --- a/src/darwin/Framework/CHIP/gen/client-command-macro.h +++ b/src/darwin/Framework/CHIP/gen/client-command-macro.h @@ -3629,6 +3629,34 @@ \ ZCL_LOGIN_COMMAND_ID, "uu", tempAccountIdentifier, setupPIN); +/** @brief Command description for Test + * + * Command: Test + * @param returnValue INT8U + */ +#define emberAfFillCommandTest \ + ClusterClusterTest(returnValue) emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_COMMAND_ID, "u", returnValue); + +/** @brief Command description for TestNotHandled + * + * Command: TestNotHandled + */ +#define emberAfFillCommandTest \ + ClusterClusterTestNotHandled() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_NOT_HANDLED_COMMAND_ID, "", ); + +/** @brief Command description for TestSpecific + * + * Command: TestSpecific + */ +#define emberAfFillCommandTest \ + ClusterClusterTestSpecific() emberAfFillExternalBuffer(mask, \ + \ + ZCL_TEST_SPECIFIC_COMMAND_ID, "", ); + /** @brief Command description for MatchProtocolAddress * * Command: MatchProtocolAddress diff --git a/src/darwin/Framework/CHIP/gen/cluster-id.h b/src/darwin/Framework/CHIP/gen/cluster-id.h index b8d9a9f7ed09bf..7f71ea5976846c 100644 --- a/src/darwin/Framework/CHIP/gen/cluster-id.h +++ b/src/darwin/Framework/CHIP/gen/cluster-id.h @@ -293,6 +293,9 @@ // Definitions for cluster: Account Login #define ZCL_ACCOUNT_LOGIN_CLUSTER_ID (0x050E) +// Definitions for cluster: Test Cluster +#define ZCL_TEST_CLUSTER_ID (0x050F) + // Definitions for cluster: Generic Tunnel #define ZCL_GENERIC_TUNNEL_CLUSTER_ID (0x0600) diff --git a/src/darwin/Framework/CHIP/gen/command-id.h b/src/darwin/Framework/CHIP/gen/command-id.h index 25ee08826f030c..8e97e911e0a423 100644 --- a/src/darwin/Framework/CHIP/gen/command-id.h +++ b/src/darwin/Framework/CHIP/gen/command-id.h @@ -470,6 +470,12 @@ #define ZCL_GET_SETUP_PIN_RESPONSE_COMMAND_ID (0x00) #define ZCL_LOGIN_COMMAND_ID (0x01) +// Commands for cluster: Test Cluster +#define ZCL_TEST_COMMAND_ID (0x00) +#define ZCL_TEST_SPECIFIC_RESPONSE_COMMAND_ID (0x00) +#define ZCL_TEST_NOT_HANDLED_COMMAND_ID (0x01) +#define ZCL_TEST_SPECIFIC_COMMAND_ID (0x02) + // Commands for cluster: Generic Tunnel #define ZCL_MATCH_PROTOCOL_ADDRESS_COMMAND_ID (0x00) #define ZCL_MATCH_PROTOCOL_ADDRESS_RESPONSE_COMMAND_ID (0x00) diff --git a/src/darwin/Framework/CHIP/gen/endpoint_config.h b/src/darwin/Framework/CHIP/gen/endpoint_config.h index 5d7aa618a861c8..64db0994ccd3a9 100644 --- a/src/darwin/Framework/CHIP/gen/endpoint_config.h +++ b/src/darwin/Framework/CHIP/gen/endpoint_config.h @@ -63,7 +63,7 @@ #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 21 +#define GENERATED_ATTRIBUTE_COUNT 22 #define GENERATED_ATTRIBUTES \ { \ \ @@ -123,6 +123,9 @@ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Application Basic (client) */ \ + { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ + \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(CLIENT), ZAP_SIMPLE_DEFAULT(0x0001) }, /* cluster revision */ \ \ /* Endpoint: 1, Cluster: Binding (client) */ \ @@ -139,7 +142,7 @@ #define GENERATED_FUNCTION_ARRAYS #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask -#define GENERATED_CLUSTER_COUNT 21 +#define GENERATED_CLUSTER_COUNT 22 #define GENERATED_CLUSTERS \ { \ { 0x0003, ZAP_ATTRIBUTE_INDEX(0), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL }, /* Endpoint: 1, Cluster: Identify (client) */ \ @@ -188,10 +191,13 @@ 0x050D, ZAP_ATTRIBUTE_INDEX(18), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Application Basic (client) */ \ { \ - 0xF000, ZAP_ATTRIBUTE_INDEX(19), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0x050F, ZAP_ATTRIBUTE_INDEX(19), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + }, /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { \ + 0xF000, ZAP_ATTRIBUTE_INDEX(20), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Binding (client) */ \ { \ - 0xF004, ZAP_ATTRIBUTE_INDEX(20), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ + 0xF004, ZAP_ATTRIBUTE_INDEX(21), 1, 2, ZAP_CLUSTER_MASK(CLIENT), NULL \ }, /* Endpoint: 1, Cluster: Group Key Management (client) */ \ } @@ -200,7 +206,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 21, 42 }, \ + { ZAP_CLUSTER_INDEX(0), 22, 44 }, \ } // Largest attribute size is needed for various buffers @@ -210,7 +216,7 @@ #define ATTRIBUTE_SINGLETONS_SIZE (2) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (42) +#define ATTRIBUTE_MAX_SIZE (44) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (1) @@ -254,7 +260,7 @@ // Array of EmberAfCommandMetadata structs. #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask -#define EMBER_AF_GENERATED_COMMAND_COUNT (142) +#define EMBER_AF_GENERATED_COMMAND_COUNT (146) #define GENERATED_COMMANDS \ { \ \ @@ -437,6 +443,12 @@ /* Endpoint: 1, Cluster: Low Power (client) */ \ { 0x0508, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Sleep */ \ \ + /* Endpoint: 1, Cluster: Test Cluster (client) */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Test */ \ + { 0x050F, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* TestSpecificResponse */ \ + { 0x050F, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestNotHandled */ \ + { 0x050F, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* TestSpecific */ \ + \ /* Endpoint: 1, Cluster: Binding (client) */ \ { 0xF000, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Bind */ \ { 0xF000, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Unbind */ \ diff --git a/src/darwin/Framework/CHIP/gen/gen_config.h b/src/darwin/Framework/CHIP/gen/gen_config.h index e0854ebb074057..786770655597af 100644 --- a/src/darwin/Framework/CHIP/gen/gen_config.h +++ b/src/darwin/Framework/CHIP/gen/gen_config.h @@ -49,6 +49,7 @@ #define EMBER_AF_SCENES_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_SWITCH_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_TEMP_MEASUREMENT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) +#define EMBER_AF_TEST_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define EMBER_AF_THERMOSTAT_CLUSTER_CLIENT_ENDPOINT_COUNT (1) /**** Cluster Plugins ****/ @@ -133,6 +134,10 @@ #define ZCL_USING_TEMP_MEASUREMENT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_TEMPERATURE_MEASUREMENT_CLIENT +// Use this macro to check if the client side of the Test Cluster cluster is included +#define ZCL_USING_TEST_CLUSTER_CLIENT +#define EMBER_AF_PLUGIN_TEST_CLUSTER_CLIENT + // Use this macro to check if the client side of the Thermostat cluster is included #define ZCL_USING_THERMOSTAT_CLUSTER_CLIENT #define EMBER_AF_PLUGIN_THERMOSTAT_CLIENT diff --git a/src/darwin/Framework/CHIP/gen/print-cluster.h b/src/darwin/Framework/CHIP/gen/print-cluster.h index 9c879d94a9390d..886dad371554b7 100644 --- a/src/darwin/Framework/CHIP/gen/print-cluster.h +++ b/src/darwin/Framework/CHIP/gen/print-cluster.h @@ -634,6 +634,12 @@ #define CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER #endif +#if defined(ZCL_USING_TEST_CLUSTER_SERVER) || defined(ZCL_USING_TEST_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_TEST_CLUSTER { ZCL_TEST_CLUSTER_ID, 1295, "Test Cluster" }, +#else +#define CHIP_PRINTCLUSTER_TEST_CLUSTER +#endif + #if defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_SERVER) || defined(ZCL_USING_GENERIC_TUNNEL_CLUSTER_CLIENT) #define CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER { ZCL_GENERIC_TUNNEL_CLUSTER_ID, 1536, "Generic Tunnel" }, #else @@ -965,6 +971,7 @@ CHIP_PRINTCLUSTER_APPLICATION_LAUNCHER_CLUSTER \ CHIP_PRINTCLUSTER_APPLICATION_BASIC_CLUSTER \ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ + CHIP_PRINTCLUSTER_TEST_CLUSTER \ CHIP_PRINTCLUSTER_GENERIC_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_BACNET_PROTOCOL_TUNNEL_CLUSTER \ CHIP_PRINTCLUSTER_11073_PROTOCOL_TUNNEL_CLUSTER \ diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 42db26a77b4fb7..39ceb1b58aca4c 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -122,29 +122,60 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) XCTAssertTrue(stopped); } -{{#chip_client_clusters}} -{{#chip_server_cluster_commands}} -{{#unless (zcl_command_arguments_count this.id)}} -- (void)testSendCluster{{asCamelCased parent.name false}}{{asCamelCased name false}}Command +- (void)testSendClusterTestCommand { - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asCamelCased parent.name false}}{{asCamelCased name false}}"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestCommand"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIP{{asCamelCased parent.name false}} * cluster = [[CHIP{{asCamelCased parent.name false}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asCamelCased parent.name false)}} queue:queue]; + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster {{asCamelCased name}}:^(NSError * err, NSDictionary * values) { - NSLog(@"{{asCamelCased parent.name false}} {{asCamelCased name false}} Error: %@", err); - XCTAssertEqual(err.code, {{asExpectedReturnValueForCommand (asCamelCased parent.name false) (asCamelCased name false)}}); + [cluster test:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster test Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestNotHandledCommand +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestNotHandledCommand"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster testNotHandled:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster testNotHandled Error: %@", err); + XCTAssertEqual(err.code, 1); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestSpecificCommand +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestSpecificCommand"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster testSpecific:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster testSpecific Error: %@", err); + XCTAssertEqual(err.code, 0); + XCTAssertEqual([values[@"returnValue"] intValue], 7); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -{{/unless}} -{{/chip_server_cluster_commands}} -{{/chip_client_clusters}} {{#chip_client_clusters}} {{#chip_server_cluster_attributes}} diff --git a/src/darwin/Framework/CHIP/templates/helper.js b/src/darwin/Framework/CHIP/templates/helper.js index 230a251ac18519..6da29f09afb4ec 100644 --- a/src/darwin/Framework/CHIP/templates/helper.js +++ b/src/darwin/Framework/CHIP/templates/helper.js @@ -40,41 +40,6 @@ function asExpectedEndpointForCluster(clusterName) return 1; } -function asExpectedReturnValueForCommand(clusterName, commandName) -{ - switch (clusterName) { - case 'GeneralCommissioning': - switch (commandName) { - // All methods are not implemented and returns `EMBER_ZCL_STATUS_FAILURE` - default: - return 1; - } - break; - - case 'OperationalCredentials': - switch (commandName) { - // All methods are not implemented and returns `EMBER_ZCL_STATUS_FAILURE` - default: - return 1; - } - break; - - case 'Thermostat': - switch (commandName) { - // All those methods are not implemented and directly returns false. So the stack returns - // `EMBER_ZCL_STATUS_UNSUP_CLUSTER_COMMAND` - case 'GetRelayStatusLog': - case 'ClearWeeklySchedule': - case 'SetWeeklySchedule': - case 'GetWeeklySchedule': - return 1; - } - break; - } - - return 0; -} - function asTestValue() { if (StringHelper.isOctetString(this.type)) { @@ -89,6 +54,5 @@ function asTestValue() // // Module exports // -exports.asExpectedEndpointForCluster = asExpectedEndpointForCluster; -exports.asExpectedReturnValueForCommand = asExpectedReturnValueForCommand; -exports.asTestValue = asTestValue; +exports.asExpectedEndpointForCluster = asExpectedEndpointForCluster; +exports.asTestValue = asTestValue; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 721eef6a7eb253..1e4ce429a93b10 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -123,256 +123,55 @@ - (void)testShutdownStack XCTAssertTrue(stopped); } -- (void)testSendClusterBarrierControlBarrierControlStopCommand +- (void)testSendClusterTestCommand { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlBarrierControlStop"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestCommand"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster barrierControlStop:^(NSError * err, NSDictionary * values) { - NSLog(@"BarrierControl BarrierControlStop Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterBasicMfgSpecificPingCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicMfgSpecificPing"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster mfgSpecificPing:^(NSError * err, NSDictionary * values) { - NSLog(@"Basic MfgSpecificPing Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterDoorLockClearAllPinsCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockClearAllPins"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster clearAllPins:^(NSError * err, NSDictionary * values) { - NSLog(@"DoorLock ClearAllPins Error: %@", err); + [cluster test:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster test Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDoorLockClearAllRfidsCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockClearAllRfids"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster clearAllRfids:^(NSError * err, NSDictionary * values) { - NSLog(@"DoorLock ClearAllRfids Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterGeneralCommissioningCommissioningCompleteCommand +- (void)testSendClusterTestNotHandledCommand { - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningCommissioningComplete"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestNotHandledCommand"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster commissioningComplete:^(NSError * err, NSDictionary * values) { - NSLog(@"GeneralCommissioning CommissioningComplete Error: %@", err); + [cluster testNotHandled:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster testNotHandled Error: %@", err); XCTAssertEqual(err.code, 1); [expectation fulfill]; }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupsRemoveAllGroupsCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsRemoveAllGroups"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster removeAllGroups:^(NSError * err, NSDictionary * values) { - NSLog(@"Groups RemoveAllGroups Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterIdentifyIdentifyQueryCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyIdentifyQuery"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster identifyQuery:^(NSError * err, NSDictionary * values) { - NSLog(@"Identify IdentifyQuery Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLevelControlStopWithOnOffCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlStopWithOnOff"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster stopWithOnOff:^(NSError * err, NSDictionary * values) { - NSLog(@"LevelControl StopWithOnOff Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterLowPowerSleepCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"LowPowerSleep"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster sleep:^(NSError * err, NSDictionary * values) { - NSLog(@"LowPower Sleep Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffOffCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffOff"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster off:^(NSError * err, NSDictionary * values) { - NSLog(@"OnOff Off Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffOnCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffOn"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster on:^(NSError * err, NSDictionary * values) { - NSLog(@"OnOff On Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOnOffToggleCommand +- (void)testSendClusterTestSpecificCommand { - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffToggle"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterTestSpecificCommand"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster toggle:^(NSError * err, NSDictionary * values) { - NSLog(@"OnOff Toggle Error: %@", err); + [cluster testSpecific:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster testSpecific Error: %@", err); XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterOperationalCredentialsGetFabricIdCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"OperationalCredentialsGetFabricId"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster getFabricId:^(NSError * err, NSDictionary * values) { - NSLog(@"OperationalCredentials GetFabricId Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatClearWeeklyScheduleCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatClearWeeklySchedule"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster clearWeeklySchedule:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat ClearWeeklySchedule Error: %@", err); - XCTAssertEqual(err.code, 1); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; -} -- (void)testSendClusterThermostatGetRelayStatusLogCommand -{ - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatGetRelayStatusLog"]; - - CHIPDevice * device = GetPairedDevice(kDeviceId); - dispatch_queue_t queue = dispatch_get_main_queue(); - CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; - XCTAssertNotNil(cluster); - - [cluster getRelayStatusLog:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat GetRelayStatusLog Error: %@", err); - XCTAssertEqual(err.code, 1); + XCTAssertEqual([values[@"returnValue"] intValue], 7); [expectation fulfill]; }]; @@ -3118,6 +2917,634 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } +- (void)testSendClusterTestClusterReadAttributeBoolean +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBoolean"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBoolean:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Boolean Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeBoolean +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBoolean"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t value = 0; + [cluster writeAttributeBoolean:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Boolean Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeBitmap8 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap8"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBitmap8:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeBitmap8 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap8"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t value = 0; + [cluster writeAttributeBitmap8:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeBitmap16 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap16"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBitmap16:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeBitmap16 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap16"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t value = 0; + [cluster writeAttributeBitmap16:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeBitmap32 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap32"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBitmap32:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap32 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeBitmap32 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap32"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint32_t value = 0; + [cluster writeAttributeBitmap32:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap32 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeBitmap64 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap64"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeBitmap64:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap64 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeBitmap64 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap64"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint64_t value = 0; + [cluster writeAttributeBitmap64:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap64 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt8u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt8u:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt8u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t value = 0; + [cluster writeAttributeInt8u:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt16u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt16u:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt16u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t value = 0; + [cluster writeAttributeInt16u:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt32u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt32u:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt32u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint32_t value = 0; + [cluster writeAttributeInt32u:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt64u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt64u:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt64u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint64_t value = 0; + [cluster writeAttributeInt64u:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt8s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt8s:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt8s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + int8_t value = 0; + [cluster writeAttributeInt8s:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt16s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt16s:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt16s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + int16_t value = 0; + [cluster writeAttributeInt16s:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt32s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt32s:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt32s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + int32_t value = 0; + [cluster writeAttributeInt32s:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeInt64s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeInt64s:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeInt64s +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64s"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + int64_t value = 0; + [cluster writeAttributeInt64s:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeEnum8 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum8"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnum8:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeEnum8 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum8"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint8_t value = 0; + [cluster writeAttributeEnum8:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeEnum16 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum16"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeEnum16:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeEnum16 +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum16"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + uint16_t value = 0; + [cluster writeAttributeEnum16:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeOctetString +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeOctetString"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeOctetString:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster OctetString Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterWriteAttributeOctetString +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeOctetString"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + NSData * value = [@"Test" dataUsingEncoding:NSUTF8StringEncoding]; + [cluster writeAttributeOctetString:value + completionHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster OctetString Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} +- (void)testSendClusterTestClusterReadAttributeListInt8u +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeListInt8u"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeListInt8u:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster ListInt8u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + +- (void)testSendClusterTestClusterReadAttributeClusterRevision +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeClusterRevision"]; + + CHIPDevice * device = GetPairedDevice(kDeviceId); + dispatch_queue_t queue = dispatch_get_main_queue(); + CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; + XCTAssertNotNil(cluster); + + [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster ClusterRevision Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; +} + - (void)testSendClusterThermostatReadAttributeLocalTemperature { XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeLocalTemperature"]; From b38fb2a4cf3657049e8f102d09c2083da5ff8623 Mon Sep 17 00:00:00 2001 From: Lazar Kovacic Date: Tue, 4 May 2021 19:28:55 +0200 Subject: [PATCH 19/31] Updating TV example app to add support for on-off level control commands (#6417) Problem TV example app does not support on and off commands TV example app does not support level control commands Summary of Changes - Added attribute change callback so that developper can detect on-off attribute change and implement logic for TV - Added LevelControl.cpp file so that developper can use it and change current level-control.h file. We do not need all the logic from the current level-control cluster. Handeling step command is enough. Test - Tested locally using chip-tool client and newly created tv-server - Used the zap_regen_all.py and gn_build.sh to verify the building is successful --- examples/tv-app/linux/BUILD.gn | 1 + .../include/cluster-change-attribute.cpp | 65 +++++++ .../include/level-control/LevelControl.cpp | 180 ++++++++++++++++++ examples/tv-app/linux/main.cpp | 4 - 4 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 examples/tv-app/linux/include/cluster-change-attribute.cpp create mode 100644 examples/tv-app/linux/include/level-control/LevelControl.cpp diff --git a/examples/tv-app/linux/BUILD.gn b/examples/tv-app/linux/BUILD.gn index d882f0c763745a..259651bf8cb744 100644 --- a/examples/tv-app/linux/BUILD.gn +++ b/examples/tv-app/linux/BUILD.gn @@ -29,6 +29,7 @@ executable("chip-tv-app") { "include/application-launcher/ApplicationLauncherManager.h", "include/audio-output/AudioOutputManager.cpp", "include/audio-output/AudioOutputManager.h", + "include/cluster-change-attribute.cpp", "include/cluster-init.cpp", "include/content-launcher/ContentLauncherManager.cpp", "include/content-launcher/ContentLauncherManager.h", diff --git a/examples/tv-app/linux/include/cluster-change-attribute.cpp b/examples/tv-app/linux/include/cluster-change-attribute.cpp new file mode 100644 index 00000000000000..0ea165efa5002a --- /dev/null +++ b/examples/tv-app/linux/include/cluster-change-attribute.cpp @@ -0,0 +1,65 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +#include "gen/attribute-id.h" +#include "gen/cluster-id.h" +#include + +using namespace chip; + +enum TvCommand +{ + PowerToggle, + MuteToggle +}; + +void runTvCommand(TvCommand command) +{ + switch (command) + { + case PowerToggle: + // TODO: Insert your code here to send power toggle command + break; + case MuteToggle: + // TODO: Insert your code here to send mute toggle command + break; + + default: + break; + } +} + +void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, + uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) +{ + if (clusterId == ZCL_ON_OFF_CLUSTER_ID && attributeId == ZCL_ON_OFF_ATTRIBUTE_ID) + { + ChipLogProgress(Zcl, "Received on/off command for cluster id: %d", clusterId); + + if (endpoint == 0) + { + ChipLogProgress(Zcl, "Execute POWER_TOGGLE"); + runTvCommand(PowerToggle); + } + else if (endpoint == 1) + { + ChipLogProgress(Zcl, "Execute MUTE_TOGGLE"); + runTvCommand(MuteToggle); + } + } +} diff --git a/examples/tv-app/linux/include/level-control/LevelControl.cpp b/examples/tv-app/linux/include/level-control/LevelControl.cpp new file mode 100644 index 00000000000000..aaf79c7de14d5e --- /dev/null +++ b/examples/tv-app/linux/include/level-control/LevelControl.cpp @@ -0,0 +1,180 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +#include + +#include "gen/af-structs.h" +#include "gen/attribute-id.h" +#include "gen/attribute-type.h" +#include "gen/cluster-id.h" +#include "gen/command-id.h" + +using namespace chip; + +#define MAX_LEVEL 99 +#define MIN_LEVEL 1 + +typedef struct +{ + CommandId commandId; + uint16_t storedLevel; + bool increasing; +} EmberAfLevelControlState; + +static EmberAfLevelControlState stateTable[EMBER_AF_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; + +static EmberAfLevelControlState * getState(EndpointId endpoint) +{ + uint8_t ep = emberAfFindClusterServerEndpointIndex(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID); + return (ep == 0xFF ? NULL : &stateTable[ep]); +} + +static void stepHandler(CommandId commandId, uint8_t stepMode, uint8_t stepSize, uint16_t transitionTimeDs, uint8_t optionMask, + uint8_t optionOverride) +{ + + EndpointId endpoint = emberAfCurrentEndpoint(); + EmberAfLevelControlState * state = getState(endpoint); + EmberAfStatus status; + uint8_t currentLevel; + + status = emberAfReadServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, + (uint8_t *) ¤tLevel, sizeof(currentLevel)); + + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + emberAfLevelControlClusterPrintln("ERR: reading current level %x", status); + goto send_default_response; + } + + switch (stepMode) + { + case EMBER_ZCL_STEP_MODE_UP: + state->increasing = true; + if (MAX_LEVEL >= currentLevel + stepSize) + { + currentLevel = currentLevel + stepSize; + } + break; + case EMBER_ZCL_STEP_MODE_DOWN: + state->increasing = false; + if (MIN_LEVEL <= currentLevel - stepSize) + { + currentLevel = currentLevel - stepSize; + } + break; + default: + status = EMBER_ZCL_STATUS_INVALID_FIELD; + goto send_default_response; + } + + if (currentLevel != state->storedLevel) + { + int volumeIncrementCount = abs(currentLevel - state->storedLevel); + for (int i = 0; i < volumeIncrementCount; ++i) + { + if (state->increasing) + { + ChipLogProgress(Zcl, "Volume UP"); + // TODO: Insert your code here to send volume up command + } + else + { + ChipLogProgress(Zcl, "Volume DOWN"); + // TODO: Insert your code here to send volume down command + } + } + status = emberAfWriteServerAttribute(endpoint, ZCL_LEVEL_CONTROL_CLUSTER_ID, ZCL_CURRENT_LEVEL_ATTRIBUTE_ID, + (uint8_t *) ¤tLevel, ZCL_INT8U_ATTRIBUTE_TYPE); + state->storedLevel = currentLevel; + ChipLogProgress(Zcl, "Setting volume to new level %d", state->storedLevel); + } + +send_default_response: + if (emberAfCurrentCommand()->apsFrame->clusterId == ZCL_LEVEL_CONTROL_CLUSTER_ID) + { + emberAfSendImmediateDefaultResponse(status); + } +} + +bool emberAfLevelControlClusterStepCallback(uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask, + uint8_t optionOverride) +{ + stepHandler(ZCL_STEP_COMMAND_ID, stepMode, stepSize, transitionTime, optionMask, optionOverride); + return true; +} + +bool emberAfLevelControlClusterMoveCallback(unsigned char, unsigned char, unsigned char, unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterMoveToLevelCallback(unsigned char, unsigned short, unsigned char, unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(unsigned char, unsigned short) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterMoveWithOnOffCallback(unsigned char, unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterStopCallback(unsigned char, unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterStopWithOnOffCallback() +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfOnOffClusterLevelControlEffectCallback(unsigned char, bool) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterServerInitCallback(unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterStepWithOnOffCallback(unsigned char, unsigned char, unsigned short) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} + +bool emberAfLevelControlClusterServerTickCallback(unsigned char) +{ + ChipLogProgress(Zcl, "Not supported"); + return true; +} diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp index 64bd0db8a7ef6c..6b5c859328aefc 100644 --- a/examples/tv-app/linux/main.cpp +++ b/examples/tv-app/linux/main.cpp @@ -51,10 +51,6 @@ using namespace chip; using namespace chip::Transport; using namespace chip::DeviceLayer; -void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) -{} - bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); From 9a31fbfe9e0fabb56d33e289b41a13f2d397d0cb Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Tue, 4 May 2021 12:34:23 -0700 Subject: [PATCH 20/31] Use Objective-C naming convention for Cluster method names (#6442) * Use ObjC naming convention for Cluster Method names * Add generated files * Update CHIP Tool * Restyled by clang-format * Fix tests * Regenrate the test source * Fix responseHandler name * Regenerate tests * Regen everything again Co-authored-by: Restyled.io --- examples/chip-tool/gen/CHIPClustersObjc.h | 916 ++-- examples/chip-tool/gen/CHIPClustersObjc.mm | 4365 ++++++++------- .../templates/app/CHIPClustersObjc-src.zapt | 56 +- .../templates/app/CHIPClustersObjc.zapt | 12 +- src/controller/python/gen/CHIPClustersObjc.h | 990 ++-- src/controller/python/gen/CHIPClustersObjc.mm | 4657 ++++++++--------- .../Bindings/BindingsViewController.m | 24 +- .../Fabric/FabricUIViewController.m | 70 +- .../QRCode/QRCodeViewController.m | 18 +- .../TemperatureSensorViewController.m | 24 +- .../Framework/CHIP/gen/CHIPClustersObjc.h | 824 ++- .../Framework/CHIP/gen/CHIPClustersObjc.mm | 3795 +++++++------- .../CHIP/templates/clusters-tests.zapt | 12 +- .../Framework/CHIPTests/CHIPClustersTests.m | 1625 +++--- 14 files changed, 8701 insertions(+), 8687 deletions(-) diff --git a/examples/chip-tool/gen/CHIPClustersObjc.h b/examples/chip-tool/gen/CHIPClustersObjc.h index b93a294f29bf1f..c44ab70b07d659 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.h +++ b/examples/chip-tool/gen/CHIPClustersObjc.h @@ -48,10 +48,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAccountLogin : CHIPCluster -- (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(ResponseHandler)completionHandler; -- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN completionHandler:(ResponseHandler)completionHandler; +- (void)getSetupPIN:(NSString *)tempAccountIdentifier responseHandler:(ResponseHandler)responseHandler; +- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -61,14 +61,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationBasic : CHIPCluster -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler; -- (void)readAttributeProductId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler; -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -79,12 +79,12 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPApplicationLauncher : CHIPCluster - (void)launchApp:(NSString *)data - catalogVendorId:(uint16_t)catalogVendorId - applicationId:(NSString *)applicationId - completionHandler:(ResponseHandler)completionHandler; + catalogVendorId:(uint16_t)catalogVendorId + applicationId:(NSString *)applicationId + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -94,11 +94,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAudioOutput : CHIPCluster -- (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler; -- (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler; +- (void)renameOutput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler; +- (void)selectOutput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -108,14 +108,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBarrierControl : CHIPCluster -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler; -- (void)barrierControlStop:(ResponseHandler)completionHandler; +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler; +- (void)barrierControlStop:(ResponseHandler)responseHandler; -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -125,29 +125,29 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBasic : CHIPCluster -- (void)mfgSpecificPing:(ResponseHandler)completionHandler; - -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler; -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorID:(ResponseHandler)completionHandler; -- (void)readAttributeProductName:(ResponseHandler)completionHandler; -- (void)readAttributeProductID:(ResponseHandler)completionHandler; -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler; -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeLocation:(ResponseHandler)completionHandler; -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler; -- (void)readAttributePartNumber:(ResponseHandler)completionHandler; -- (void)readAttributeProductURL:(ResponseHandler)completionHandler; -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler; -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler; -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler; -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)mfgSpecificPing:(ResponseHandler)responseHandler; + +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -158,17 +158,17 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPBinding : CHIPCluster - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -179,61 +179,61 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPColorControl : CHIPCluster - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveColorTemperature:(uint8_t)moveMode rate:(uint16_t)rate colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHueAndSaturation:(uint8_t)hue saturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepColorTemperature:(uint8_t)stepMode stepSize:(uint16_t)stepSize transitionTime:(uint16_t)transitionTime @@ -241,112 +241,110 @@ NS_ASSUME_NONNULL_BEGIN colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepSaturation:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler; -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler; -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler; -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler; -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler; -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler; -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler; -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler; -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler; -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -356,14 +354,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPContentLaunch : CHIPCluster -- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler:(ResponseHandler)completionHandler; -- (void)launchURL:(NSString *)contentURL - displayString:(NSString *)displayString - completionHandler:(ResponseHandler)completionHandler; +- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler; +- (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler; -- (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSupportedStreamingTypesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -373,11 +369,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDescriptor : CHIPCluster -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler; -- (void)readAttributeServerList:(ResponseHandler)completionHandler; -- (void)readAttributeClientList:(ResponseHandler)completionHandler; -- (void)readAttributePartsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -387,37 +383,37 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDoorLock : CHIPCluster -- (void)clearAllPins:(ResponseHandler)completionHandler; -- (void)clearAllRfids:(ResponseHandler)completionHandler; -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler; -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; +- (void)clearAllPins:(ResponseHandler)responseHandler; +- (void)clearAllRfids:(ResponseHandler)responseHandler; +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler; +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler; - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler; -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler; +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler; - (void)setWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId daysMask:(uint8_t)daysMask @@ -425,23 +421,23 @@ NS_ASSUME_NONNULL_BEGIN startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler; -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeLockState:(ResponseHandler)completionHandler; -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLockState:(ResponseHandler)reportHandler; -- (void)readAttributeLockType:(ResponseHandler)completionHandler; -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -452,20 +448,20 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPGeneralCommissioning : CHIPCluster - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)commissioningComplete:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; +- (void)commissioningComplete:(ResponseHandler)responseHandler; - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricId:(ResponseHandler)completionHandler; -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler; -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -475,9 +471,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroupKeyManagement : CHIPCluster -- (void)readAttributeGroups:(ResponseHandler)completionHandler; -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -487,17 +483,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroups : CHIPCluster -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler; -- (void)addGroupIfIdentifying:(uint16_t)groupId - groupName:(NSString *)groupName - completionHandler:(ResponseHandler)completionHandler; -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllGroups:(ResponseHandler)completionHandler; -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllGroups:(ResponseHandler)responseHandler; +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -507,12 +501,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPIdentify : CHIPCluster -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler; -- (void)identifyQuery:(ResponseHandler)completionHandler; +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler; +- (void)identifyQuery:(ResponseHandler)responseHandler; -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler; -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -522,9 +516,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPKeypadInput : CHIPCluster -- (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHandler; +- (void)sendKey:(uint8_t)keyCode responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -535,39 +529,39 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPLevelControl : CHIPCluster - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler; - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler; -- (void)stopWithOnOff:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler; +- (void)stopWithOnOff:(ResponseHandler)responseHandler; -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -577,9 +571,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPLowPower : CHIPCluster -- (void)sleep:(ResponseHandler)completionHandler; +- (void)sleep:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -589,13 +583,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaInput : CHIPCluster -- (void)hideInputStatus:(ResponseHandler)completionHandler; -- (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler; -- (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler; -- (void)showInputStatus:(ResponseHandler)completionHandler; +- (void)hideInputStatus:(ResponseHandler)responseHandler; +- (void)renameInput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler; +- (void)selectInput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler; +- (void)showInputStatus:(ResponseHandler)responseHandler; -- (void)readAttributeMediaInputList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -605,19 +599,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaPlayback : CHIPCluster -- (void)mediaFastForward:(ResponseHandler)completionHandler; -- (void)mediaNext:(ResponseHandler)completionHandler; -- (void)mediaPause:(ResponseHandler)completionHandler; -- (void)mediaPlay:(ResponseHandler)completionHandler; -- (void)mediaPrevious:(ResponseHandler)completionHandler; -- (void)mediaRewind:(ResponseHandler)completionHandler; -- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler; -- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler; -- (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)completionHandler; -- (void)mediaStartOver:(ResponseHandler)completionHandler; -- (void)mediaStop:(ResponseHandler)completionHandler; +- (void)mediaFastForward:(ResponseHandler)responseHandler; +- (void)mediaNext:(ResponseHandler)responseHandler; +- (void)mediaPause:(ResponseHandler)responseHandler; +- (void)mediaPlay:(ResponseHandler)responseHandler; +- (void)mediaPrevious:(ResponseHandler)responseHandler; +- (void)mediaRewind:(ResponseHandler)responseHandler; +- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; +- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; +- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler; +- (void)mediaStartOver:(ResponseHandler)responseHandler; +- (void)mediaStop:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -630,40 +624,40 @@ NS_ASSUME_NONNULL_BEGIN - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler; - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -673,16 +667,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOnOff : CHIPCluster -- (void)off:(ResponseHandler)completionHandler; -- (void)on:(ResponseHandler)completionHandler; -- (void)toggle:(ResponseHandler)completionHandler; +- (void)off:(ResponseHandler)responseHandler; +- (void)on:(ResponseHandler)responseHandler; +- (void)toggle:(ResponseHandler)responseHandler; -- (void)readAttributeOnOff:(ResponseHandler)completionHandler; -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -692,15 +686,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)completionHandler; +- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler; -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler; + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler; +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -710,20 +704,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPPumpConfigurationAndControl : CHIPCluster -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler; -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler; -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler; -- (void)readAttributeCapacity:(ResponseHandler)completionHandler; -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler; -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler; -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -734,29 +728,29 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPScenes : CHIPCluster - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler; -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler; +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler; -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -766,14 +760,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPSwitch : CHIPCluster -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -783,16 +777,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTvChannel : CHIPCluster -- (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)completionHandler; +- (void)changeChannel:(NSString *)match responseHandler:(ResponseHandler)responseHandler; - (void)changeChannelByNumber:(uint16_t)majorNumber minorNumber:(uint16_t)minorNumber - completionHandler:(ResponseHandler)completionHandler; -- (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)skipChannel:(uint16_t)count responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeTvChannelList:(ResponseHandler)completionHandler; -- (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeTvChannelListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeTvChannelLineupWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentTvChannelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -802,10 +796,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTargetNavigator : CHIPCluster -- (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:(ResponseHandler)completionHandler; +- (void)navigateTarget:(uint8_t)target data:(NSString *)data responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeTargetNavigatorListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -815,15 +809,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTemperatureMeasurement : CHIPCluster -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler; -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler; -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -833,44 +827,44 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestCluster : CHIPCluster -- (void)test:(ResponseHandler)completionHandler; -- (void)testNotHandled:(ResponseHandler)completionHandler; -- (void)testSpecific:(ResponseHandler)completionHandler; - -- (void)readAttributeBoolean:(ResponseHandler)completionHandler; -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum8:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum16:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOctetString:(ResponseHandler)completionHandler; -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)test:(ResponseHandler)responseHandler; +- (void)testNotHandled:(ResponseHandler)responseHandler; +- (void)testSpecific:(ResponseHandler)responseHandler; + +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -880,33 +874,31 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPThermostat : CHIPCluster -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler; -- (void)getRelayStatusLog:(ResponseHandler)completionHandler; -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler; +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler; +- (void)getRelayStatusLog:(ResponseHandler)responseHandler; +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler; - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler; -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler; -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler; -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -916,8 +908,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPWakeOnLan : CHIPCluster -- (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeWakeOnLanMacAddressWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm index 7e46e2467edef7..30706c27d00202 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.mm +++ b/examples/chip-tool/gen/CHIPClustersObjc.mm @@ -2936,19 +2936,19 @@ @implementation CHIPAccountLogin return &_cppCluster; } -- (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(ResponseHandler)completionHandler +- (void)getSetupPIN:(NSString *)tempAccountIdentifier responseHandler:(ResponseHandler)responseHandler { CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge * onSuccess - = new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2962,21 +2962,21 @@ - (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(Respons if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN completionHandler:(ResponseHandler)completionHandler +- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2992,22 +2992,22 @@ - (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3019,7 +3019,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3036,19 +3036,19 @@ @implementation CHIPApplicationBasic return &_cppCluster; } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3060,22 +3060,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorId:(ResponseHandler)completionHandler +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3087,23 +3087,23 @@ - (void)readAttributeVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3115,22 +3115,22 @@ - (void)readAttributeApplicationName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductId:(ResponseHandler)completionHandler +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3142,23 +3142,23 @@ - (void)readAttributeProductId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3170,22 +3170,22 @@ - (void)readAttributeApplicationId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3197,22 +3197,22 @@ - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3224,22 +3224,22 @@ - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3251,7 +3251,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3269,21 +3269,21 @@ @implementation CHIPApplicationLauncher } - (void)launchApp:(NSString *)data - catalogVendorId:(uint16_t)catalogVendorId - applicationId:(NSString *)applicationId - completionHandler:(ResponseHandler)completionHandler + catalogVendorId:(uint16_t)catalogVendorId + applicationId:(NSString *)applicationId + responseHandler:(ResponseHandler)responseHandler { CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge * onSuccess - = new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3300,23 +3300,23 @@ - (void)launchApp:(NSString *)data if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler +- (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3328,22 +3328,22 @@ - (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3355,7 +3355,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3372,18 +3372,18 @@ @implementation CHIPAudioOutput return &_cppCluster; } -- (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler +- (void)renameOutput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3397,21 +3397,21 @@ - (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler +- (void)selectOutput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3423,23 +3423,23 @@ - (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler +- (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3451,22 +3451,22 @@ - (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3478,7 +3478,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3495,18 +3495,18 @@ @implementation CHIPBarrierControl return &_cppCluster; } -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3518,21 +3518,21 @@ - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(Respon if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)barrierControlStop:(ResponseHandler)completionHandler +- (void)barrierControlStop:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3544,22 +3544,22 @@ - (void)barrierControlStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3571,22 +3571,22 @@ - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3598,22 +3598,22 @@ - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3625,22 +3625,22 @@ - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3652,22 +3652,22 @@ - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3679,7 +3679,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3696,18 +3696,18 @@ @implementation CHIPBasic return &_cppCluster; } -- (void)mfgSpecificPing:(ResponseHandler)completionHandler +- (void)mfgSpecificPing:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3719,22 +3719,22 @@ - (void)mfgSpecificPing:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3746,23 +3746,23 @@ - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3774,22 +3774,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorID:(ResponseHandler)completionHandler +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3801,23 +3801,23 @@ - (void)readAttributeVendorID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductName:(ResponseHandler)completionHandler +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3829,22 +3829,22 @@ - (void)readAttributeProductName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductID:(ResponseHandler)completionHandler +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3856,23 +3856,23 @@ - (void)readAttributeProductID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3884,22 +3884,22 @@ - (void)readAttributeUserLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3913,23 +3913,23 @@ - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocation:(ResponseHandler)completionHandler +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3941,22 +3941,22 @@ - (void)readAttributeLocation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3970,22 +3970,22 @@ - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3997,23 +3997,23 @@ - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4025,22 +4025,22 @@ - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4052,23 +4052,23 @@ - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4080,23 +4080,23 @@ - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4108,23 +4108,23 @@ - (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartNumber:(ResponseHandler)completionHandler +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4136,23 +4136,23 @@ - (void)readAttributePartNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductURL:(ResponseHandler)completionHandler +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4164,23 +4164,23 @@ - (void)readAttributeProductURL:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4192,23 +4192,23 @@ - (void)readAttributeProductLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4220,23 +4220,22 @@ - (void)readAttributeSerialNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4248,22 +4247,22 @@ - (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4275,22 +4274,22 @@ - (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4302,7 +4301,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -4320,21 +4319,21 @@ @implementation CHIPBinding } - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4346,25 +4345,25 @@ - (void)bind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4376,22 +4375,22 @@ - (void)unbind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4403,7 +4402,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -4421,21 +4420,21 @@ @implementation CHIPColorControl } - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4447,7 +4446,7 @@ - (void)moveColor:(int16_t)rateX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveColorTemperature:(uint8_t)moveMode @@ -4456,18 +4455,18 @@ - (void)moveColorTemperature:(uint8_t)moveMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4480,25 +4479,25 @@ - (void)moveColorTemperature:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4510,25 +4509,25 @@ - (void)moveHue:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4541,26 +4540,26 @@ - (void)moveSaturation:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4573,25 +4572,25 @@ - (void)moveToColor:(uint16_t)colorX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4604,26 +4603,26 @@ - (void)moveToColorTemperature:(uint16_t)colorTemperature if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4636,7 +4635,7 @@ - (void)moveToHue:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHueAndSaturation:(uint8_t)hue @@ -4644,18 +4643,18 @@ - (void)moveToHueAndSaturation:(uint8_t)hue transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4668,25 +4667,25 @@ - (void)moveToHueAndSaturation:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4699,26 +4698,26 @@ - (void)moveToSaturation:(uint8_t)saturation if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4731,7 +4730,7 @@ - (void)stepColor:(int16_t)stepX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColorTemperature:(uint8_t)stepMode @@ -4741,18 +4740,18 @@ - (void)stepColorTemperature:(uint8_t)stepMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4765,26 +4764,26 @@ - (void)stepColorTemperature:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4797,7 +4796,7 @@ - (void)stepHue:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepSaturation:(uint8_t)stepMode @@ -4805,18 +4804,18 @@ - (void)stepSaturation:(uint8_t)stepMode transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4829,23 +4828,21 @@ - (void)stepSaturation:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4857,22 +4854,22 @@ - (void)stopMoveStep:(uint8_t)optionsMask if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4884,25 +4881,25 @@ - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4915,11 +4912,11 @@ - (void)configureAttributeCurrentHue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4938,18 +4935,18 @@ - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4961,25 +4958,25 @@ - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4992,11 +4989,11 @@ - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5015,18 +5012,18 @@ - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler } } -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5038,22 +5035,22 @@ - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5065,25 +5062,25 @@ - (void)readAttributeCurrentX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5096,11 +5093,11 @@ - (void)configureAttributeCurrentX:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5119,18 +5116,18 @@ - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5142,25 +5139,25 @@ - (void)readAttributeCurrentY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5173,11 +5170,11 @@ - (void)configureAttributeCurrentY:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5196,18 +5193,18 @@ - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler } } -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5219,23 +5216,23 @@ - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5247,22 +5244,22 @@ - (void)readAttributeCompensationText:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5274,25 +5271,25 @@ - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5305,11 +5302,11 @@ - (void)configureAttributeColorTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5328,18 +5325,18 @@ - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeColorMode:(ResponseHandler)completionHandler +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5351,22 +5348,22 @@ - (void)readAttributeColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5378,22 +5375,22 @@ - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5405,22 +5402,22 @@ - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5432,22 +5429,22 @@ - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5459,22 +5456,22 @@ - (void)readAttributePrimary1X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5486,22 +5483,22 @@ - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5513,22 +5510,22 @@ - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5540,22 +5537,22 @@ - (void)readAttributePrimary2X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5567,22 +5564,22 @@ - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5594,22 +5591,22 @@ - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5621,22 +5618,22 @@ - (void)readAttributePrimary3X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5648,22 +5645,22 @@ - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5675,22 +5672,22 @@ - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5702,22 +5699,22 @@ - (void)readAttributePrimary4X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5729,22 +5726,22 @@ - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5756,22 +5753,22 @@ - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5783,22 +5780,22 @@ - (void)readAttributePrimary5X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5810,22 +5807,22 @@ - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5837,22 +5834,22 @@ - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5864,22 +5861,22 @@ - (void)readAttributePrimary6X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5891,22 +5888,22 @@ - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5918,22 +5915,22 @@ - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5945,22 +5942,22 @@ - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5972,22 +5969,22 @@ - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5999,22 +5996,22 @@ - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6026,22 +6023,22 @@ - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6053,22 +6050,22 @@ - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6080,22 +6077,22 @@ - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6107,22 +6104,22 @@ - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6134,22 +6131,22 @@ - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6161,22 +6158,22 @@ - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6188,22 +6185,22 @@ - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6215,22 +6212,22 @@ - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6242,22 +6239,22 @@ - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6269,22 +6266,22 @@ - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6296,22 +6293,22 @@ - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6323,22 +6320,22 @@ - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6350,22 +6347,22 @@ - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6377,22 +6374,22 @@ - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6404,22 +6401,22 @@ - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6431,22 +6428,22 @@ - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6458,22 +6455,22 @@ - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6485,22 +6482,22 @@ - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6512,22 +6509,22 @@ - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6539,22 +6536,22 @@ - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6566,22 +6563,22 @@ - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6593,22 +6590,22 @@ - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6620,22 +6617,22 @@ - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6647,22 +6644,22 @@ - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6674,22 +6671,22 @@ - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6701,22 +6698,22 @@ - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6728,22 +6725,22 @@ - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6755,22 +6752,22 @@ - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6782,22 +6779,22 @@ - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6809,22 +6806,22 @@ - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6836,7 +6833,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -6853,19 +6850,19 @@ @implementation CHIPContentLaunch return &_cppCluster; } -- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler:(ResponseHandler)completionHandler +- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler { CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6879,24 +6876,22 @@ - (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)launchURL:(NSString *)contentURL - displayString:(NSString *)displayString - completionHandler:(ResponseHandler)completionHandler +- (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler { CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6912,23 +6907,23 @@ - (void)launchURL:(NSString *)contentURL if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler +- (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6940,23 +6935,23 @@ - (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler +- (void)readAttributeSupportedStreamingTypesWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6968,22 +6963,22 @@ - (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6995,7 +6990,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7012,19 +7007,19 @@ @implementation CHIPDescriptor return &_cppCluster; } -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorDeviceListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorDeviceListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorDeviceListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7036,23 +7031,23 @@ - (void)readAttributeDeviceList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeServerList:(ResponseHandler)completionHandler +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorServerListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorServerListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorServerListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7064,23 +7059,23 @@ - (void)readAttributeServerList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClientList:(ResponseHandler)completionHandler +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorClientListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorClientListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorClientListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7092,23 +7087,23 @@ - (void)readAttributeClientList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartsList:(ResponseHandler)completionHandler +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorPartsListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorPartsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorPartsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7120,22 +7115,22 @@ - (void)readAttributePartsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7147,7 +7142,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7164,19 +7159,19 @@ @implementation CHIPDoorLock return &_cppCluster; } -- (void)clearAllPins:(ResponseHandler)completionHandler +- (void)clearAllPins:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7188,22 +7183,22 @@ - (void)clearAllPins:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearAllRfids:(ResponseHandler)completionHandler +- (void)clearAllRfids:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7215,22 +7210,22 @@ - (void)clearAllRfids:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7242,22 +7237,22 @@ - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7269,22 +7264,22 @@ - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionH if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7296,22 +7291,22 @@ - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7323,22 +7318,22 @@ - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7350,22 +7345,22 @@ - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7377,22 +7372,22 @@ - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7404,22 +7399,22 @@ - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7431,22 +7426,22 @@ - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7458,22 +7453,22 @@ - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7485,22 +7480,22 @@ - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7512,22 +7507,22 @@ - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7539,22 +7534,22 @@ - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7568,26 +7563,26 @@ - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7600,26 +7595,26 @@ - (void)setHolidaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7633,26 +7628,26 @@ - (void)setPin:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7666,22 +7661,22 @@ - (void)setRfid:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7693,7 +7688,7 @@ - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeekdaySchedule:(uint8_t)scheduleId @@ -7703,19 +7698,19 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7728,26 +7723,26 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7760,22 +7755,22 @@ - (void)setYeardaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7789,22 +7784,22 @@ - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7818,22 +7813,22 @@ - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLockState:(ResponseHandler)completionHandler +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7845,24 +7840,24 @@ - (void)readAttributeLockState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7874,11 +7869,11 @@ - (void)configureAttributeLockState:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLockState:(ResponseHandler)reportHandler +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -7897,18 +7892,18 @@ - (void)reportAttributeLockState:(ResponseHandler)reportHandler } } -- (void)readAttributeLockType:(ResponseHandler)completionHandler +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7920,23 +7915,22 @@ - (void)readAttributeLockType:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7948,22 +7942,22 @@ - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7975,7 +7969,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7993,21 +7987,21 @@ @implementation CHIPGeneralCommissioning } - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8019,22 +8013,22 @@ - (void)armFailSafe:(uint16_t)expiryLengthSeconds if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)commissioningComplete:(ResponseHandler)completionHandler +- (void)commissioningComplete:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8046,26 +8040,26 @@ - (void)commissioningComplete:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8080,23 +8074,23 @@ - (void)setRegulatoryConfig:(uint8_t)location if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricId:(ResponseHandler)completionHandler +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8108,22 +8102,22 @@ - (void)readAttributeFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8135,22 +8129,22 @@ - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8162,22 +8156,22 @@ - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8189,7 +8183,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8206,19 +8200,19 @@ @implementation CHIPGroupKeyManagement return &_cppCluster; } -- (void)readAttributeGroups:(ResponseHandler)completionHandler +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupsAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8230,23 +8224,23 @@ - (void)readAttributeGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8258,22 +8252,22 @@ - (void)readAttributeGroupKeys:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8285,7 +8279,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8302,19 +8296,19 @@ @implementation CHIPGroups return &_cppCluster; } -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterAddGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8328,21 +8322,21 @@ - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8356,22 +8350,22 @@ - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8383,21 +8377,21 @@ - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllGroups:(ResponseHandler)completionHandler +- (void)removeAllGroups:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8409,22 +8403,22 @@ - (void)removeAllGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8436,22 +8430,22 @@ - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterViewGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8463,22 +8457,22 @@ - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8490,22 +8484,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8517,7 +8511,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8534,18 +8528,18 @@ @implementation CHIPIdentify return &_cppCluster; } -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8557,22 +8551,22 @@ - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)identifyQuery:(ResponseHandler)completionHandler +- (void)identifyQuery:(ResponseHandler)responseHandler { CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess - = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8584,22 +8578,22 @@ - (void)identifyQuery:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8611,22 +8605,22 @@ - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8638,22 +8632,22 @@ - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8665,7 +8659,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8682,19 +8676,19 @@ @implementation CHIPKeypadInput return &_cppCluster; } -- (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHandler +- (void)sendKey:(uint8_t)keyCode responseHandler:(ResponseHandler)responseHandler { CHIPKeypadInputClusterSendKeyResponseCallbackBridge * onSuccess - = new CHIPKeypadInputClusterSendKeyResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPKeypadInputClusterSendKeyResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8706,22 +8700,22 @@ - (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8733,7 +8727,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8751,21 +8745,21 @@ @implementation CHIPLevelControl } - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8777,25 +8771,25 @@ - (void)move:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8808,23 +8802,21 @@ - (void)moveToLevel:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveToLevelWithOnOff:(uint8_t)level - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler +- (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8836,21 +8828,21 @@ - (void)moveToLevelWithOnOff:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8862,26 +8854,26 @@ - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(Re if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8894,24 +8886,24 @@ - (void)step:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8923,21 +8915,21 @@ - (void)stepWithOnOff:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8949,21 +8941,21 @@ - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopWithOnOff:(ResponseHandler)completionHandler +- (void)stopWithOnOff:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8975,22 +8967,22 @@ - (void)stopWithOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9002,25 +8994,25 @@ - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9033,11 +9025,11 @@ - (void)configureAttributeCurrentLevel:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -9056,18 +9048,18 @@ - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9079,7 +9071,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9096,18 +9088,18 @@ @implementation CHIPLowPower return &_cppCluster; } -- (void)sleep:(ResponseHandler)completionHandler +- (void)sleep:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9119,22 +9111,22 @@ - (void)sleep:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9146,7 +9138,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9163,18 +9155,18 @@ @implementation CHIPMediaInput return &_cppCluster; } -- (void)hideInputStatus:(ResponseHandler)completionHandler +- (void)hideInputStatus:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9186,21 +9178,21 @@ - (void)hideInputStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler +- (void)renameInput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9214,21 +9206,21 @@ - (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler +- (void)selectInput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9240,21 +9232,21 @@ - (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)showInputStatus:(ResponseHandler)completionHandler +- (void)showInputStatus:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9266,23 +9258,23 @@ - (void)showInputStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMediaInputList:(ResponseHandler)completionHandler +- (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9294,22 +9286,22 @@ - (void)readAttributeMediaInputList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9321,7 +9313,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9338,19 +9330,19 @@ @implementation CHIPMediaPlayback return &_cppCluster; } -- (void)mediaFastForward:(ResponseHandler)completionHandler +- (void)mediaFastForward:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9362,22 +9354,22 @@ - (void)mediaFastForward:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaNext:(ResponseHandler)completionHandler +- (void)mediaNext:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9389,22 +9381,22 @@ - (void)mediaNext:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPause:(ResponseHandler)completionHandler +- (void)mediaPause:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9416,22 +9408,22 @@ - (void)mediaPause:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPlay:(ResponseHandler)completionHandler +- (void)mediaPlay:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9443,22 +9435,22 @@ - (void)mediaPlay:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPrevious:(ResponseHandler)completionHandler +- (void)mediaPrevious:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9470,22 +9462,22 @@ - (void)mediaPrevious:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaRewind:(ResponseHandler)completionHandler +- (void)mediaRewind:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9497,22 +9489,22 @@ - (void)mediaRewind:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9524,22 +9516,22 @@ - (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9551,22 +9543,22 @@ - (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9578,22 +9570,22 @@ - (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)comp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaStartOver:(ResponseHandler)completionHandler +- (void)mediaStartOver:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9605,22 +9597,22 @@ - (void)mediaStartOver:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaStop:(ResponseHandler)completionHandler +- (void)mediaStop:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9632,22 +9624,22 @@ - (void)mediaStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9659,7 +9651,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9679,19 +9671,19 @@ @implementation CHIPNetworkCommissioning - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9704,26 +9696,26 @@ - (void)addThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9737,25 +9729,25 @@ - (void)addWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9768,25 +9760,25 @@ - (void)disableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9799,21 +9791,21 @@ - (void)enableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9825,25 +9817,25 @@ - (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9856,25 +9848,25 @@ - (void)removeNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9887,25 +9879,25 @@ - (void)scanNetworks:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9918,26 +9910,26 @@ - (void)updateThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9951,22 +9943,22 @@ - (void)updateWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9978,7 +9970,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9995,18 +9987,18 @@ @implementation CHIPOnOff return &_cppCluster; } -- (void)off:(ResponseHandler)completionHandler +- (void)off:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10018,21 +10010,21 @@ - (void)off:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)on:(ResponseHandler)completionHandler +- (void)on:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10044,21 +10036,21 @@ - (void)on:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)toggle:(ResponseHandler)completionHandler +- (void)toggle:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10070,23 +10062,22 @@ - (void)toggle:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOnOff:(ResponseHandler)completionHandler +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10098,24 +10089,24 @@ - (void)readAttributeOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10127,11 +10118,11 @@ - (void)configureAttributeOnOff:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)reportHandler { CHIPBooleanAttributeCallbackBridge * onReport = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true); @@ -10151,18 +10142,18 @@ - (void)reportAttributeOnOff:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10174,7 +10165,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10191,19 +10182,19 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)completionHandler +- (void)getFabricId:(ResponseHandler)responseHandler { CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10215,24 +10206,24 @@ - (void)getFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10244,21 +10235,21 @@ - (void)removeFabric:(uint64_t)fabricId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10272,23 +10263,23 @@ - (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * onSuccess - = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10300,22 +10291,22 @@ - (void)readAttributeFabricsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10327,7 +10318,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10344,18 +10335,18 @@ @implementation CHIPPumpConfigurationAndControl return &_cppCluster; } -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10367,22 +10358,22 @@ - (void)readAttributeMaxPressure:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10394,22 +10385,22 @@ - (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10421,22 +10412,22 @@ - (void)readAttributeMaxFlow:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10448,22 +10439,22 @@ - (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10475,22 +10466,22 @@ - (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCapacity:(ResponseHandler)completionHandler +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10502,25 +10493,25 @@ - (void)readAttributeCapacity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10533,11 +10524,11 @@ - (void)configureAttributeCapacity:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -10556,18 +10547,18 @@ - (void)reportAttributeCapacity:(ResponseHandler)reportHandler } } -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10579,22 +10570,22 @@ - (void)readAttributeOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10606,22 +10597,22 @@ - (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10633,7 +10624,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10651,25 +10642,25 @@ @implementation CHIPScenes } - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterAddSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10684,22 +10675,22 @@ - (void)addScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess - = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10711,24 +10702,24 @@ - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10740,22 +10731,22 @@ - (void)recallScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10767,22 +10758,22 @@ - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10794,22 +10785,22 @@ - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterStoreSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10821,22 +10812,22 @@ - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterViewSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10848,22 +10839,22 @@ - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10875,22 +10866,22 @@ - (void)readAttributeSceneCount:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10902,22 +10893,22 @@ - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10929,23 +10920,22 @@ - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10957,22 +10947,22 @@ - (void)readAttributeSceneValid:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10984,22 +10974,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11011,7 +11001,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11028,18 +11018,18 @@ @implementation CHIPSwitch return &_cppCluster; } -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11051,22 +11041,22 @@ - (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11078,25 +11068,25 @@ - (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11109,11 +11099,11 @@ - (void)configureAttributeCurrentPosition:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -11132,18 +11122,18 @@ - (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11155,7 +11145,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11172,19 +11162,19 @@ @implementation CHIPTvChannel return &_cppCluster; } -- (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)completionHandler +- (void)changeChannel:(NSString *)match responseHandler:(ResponseHandler)responseHandler { CHIPTvChannelClusterChangeChannelResponseCallbackBridge * onSuccess - = new CHIPTvChannelClusterChangeChannelResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTvChannelClusterChangeChannelResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11198,23 +11188,23 @@ - (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)changeChannelByNumber:(uint16_t)majorNumber minorNumber:(uint16_t)minorNumber - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11226,21 +11216,21 @@ - (void)changeChannelByNumber:(uint16_t)majorNumber if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completionHandler +- (void)skipChannel:(uint16_t)count responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11252,23 +11242,23 @@ - (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTvChannelList:(ResponseHandler)completionHandler +- (void)readAttributeTvChannelListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11280,23 +11270,23 @@ - (void)readAttributeTvChannelList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler +- (void)readAttributeTvChannelLineupWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11308,23 +11298,23 @@ - (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler +- (void)readAttributeCurrentTvChannelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11336,22 +11326,22 @@ - (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11363,7 +11353,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11380,19 +11370,19 @@ @implementation CHIPTargetNavigator return &_cppCluster; } -- (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:(ResponseHandler)completionHandler +- (void)navigateTarget:(uint8_t)target data:(NSString *)data responseHandler:(ResponseHandler)responseHandler { CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge * onSuccess - = new CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11406,23 +11396,23 @@ - (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler +- (void)readAttributeTargetNavigatorListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11434,22 +11424,22 @@ - (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11461,7 +11451,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11478,18 +11468,18 @@ @implementation CHIPTemperatureMeasurement return &_cppCluster; } -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11501,25 +11491,25 @@ - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11532,11 +11522,11 @@ - (void)configureAttributeMeasuredValue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -11555,18 +11545,18 @@ - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler } } -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11578,22 +11568,22 @@ - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11605,22 +11595,22 @@ - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11632,7 +11622,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11649,18 +11639,18 @@ @implementation CHIPTestCluster return &_cppCluster; } -- (void)test:(ResponseHandler)completionHandler +- (void)test:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11672,21 +11662,21 @@ - (void)test:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testNotHandled:(ResponseHandler)completionHandler +- (void)testNotHandled:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11698,22 +11688,22 @@ - (void)testNotHandled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testSpecific:(ResponseHandler)completionHandler +- (void)testSpecific:(ResponseHandler)responseHandler { CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess - = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11725,23 +11715,22 @@ - (void)testSpecific:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBoolean:(ResponseHandler)completionHandler +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11753,22 +11742,22 @@ - (void)readAttributeBoolean:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11780,22 +11769,22 @@ - (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11807,22 +11796,22 @@ - (void)readAttributeBitmap8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11834,22 +11823,22 @@ - (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11861,22 +11850,22 @@ - (void)readAttributeBitmap16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11888,22 +11877,22 @@ - (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11915,22 +11904,22 @@ - (void)readAttributeBitmap32:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11942,22 +11931,22 @@ - (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11969,22 +11958,22 @@ - (void)readAttributeBitmap64:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11996,22 +11985,22 @@ - (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8u:(ResponseHandler)completionHandler +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12023,22 +12012,22 @@ - (void)readAttributeInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12050,22 +12039,22 @@ - (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16u:(ResponseHandler)completionHandler +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12077,22 +12066,22 @@ - (void)readAttributeInt16u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12104,22 +12093,22 @@ - (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32u:(ResponseHandler)completionHandler +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12131,22 +12120,22 @@ - (void)readAttributeInt32u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12158,22 +12147,22 @@ - (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64u:(ResponseHandler)completionHandler +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12185,22 +12174,22 @@ - (void)readAttributeInt64u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12212,22 +12201,22 @@ - (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8s:(ResponseHandler)completionHandler +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12239,22 +12228,22 @@ - (void)readAttributeInt8s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12266,22 +12255,22 @@ - (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16s:(ResponseHandler)completionHandler +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12293,22 +12282,22 @@ - (void)readAttributeInt16s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12320,22 +12309,22 @@ - (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32s:(ResponseHandler)completionHandler +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12347,22 +12336,22 @@ - (void)readAttributeInt32s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12374,22 +12363,22 @@ - (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64s:(ResponseHandler)completionHandler +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12401,22 +12390,22 @@ - (void)readAttributeInt64s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12428,22 +12417,22 @@ - (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum8:(ResponseHandler)completionHandler +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12455,22 +12444,22 @@ - (void)readAttributeEnum8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12482,22 +12471,22 @@ - (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum16:(ResponseHandler)completionHandler +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12509,22 +12498,22 @@ - (void)readAttributeEnum16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12536,23 +12525,23 @@ - (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOctetString:(ResponseHandler)completionHandler +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12564,22 +12553,22 @@ - (void)readAttributeOctetString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12592,23 +12581,23 @@ - (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler { CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess - = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterListInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12620,22 +12609,22 @@ - (void)readAttributeListInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12647,7 +12636,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -12664,18 +12653,18 @@ @implementation CHIPThermostat return &_cppCluster; } -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12687,21 +12676,21 @@ - (void)clearWeeklySchedule:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRelayStatusLog:(ResponseHandler)completionHandler +- (void)getRelayStatusLog:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12713,23 +12702,21 @@ - (void)getRelayStatusLog:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12741,25 +12728,25 @@ - (void)getWeeklySchedule:(uint8_t)daysToReturn if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12772,21 +12759,21 @@ - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12798,22 +12785,22 @@ - (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12825,25 +12812,25 @@ - (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12856,11 +12843,11 @@ - (void)configureAttributeLocalTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -12879,18 +12866,18 @@ - (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12902,22 +12889,22 @@ - (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12929,22 +12916,22 @@ - (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12956,22 +12943,22 @@ - (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12983,22 +12970,22 @@ - (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13010,22 +12997,22 @@ - (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13037,22 +13024,22 @@ - (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13064,22 +13051,22 @@ - (void)readAttributeSystemMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13091,22 +13078,22 @@ - (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13118,7 +13105,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -13135,19 +13122,19 @@ @implementation CHIPWakeOnLan return &_cppCluster; } -- (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler +- (void)readAttributeWakeOnLanMacAddressWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13159,22 +13146,22 @@ - (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13186,7 +13173,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } diff --git a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt index d508ef872ebc67..68cd8403dcaa8d 100644 --- a/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt +++ b/src/app/zap-templates/templates/app/CHIPClustersObjc-src.zapt @@ -590,25 +590,25 @@ private: {{#chip_server_cluster_commands}} {{#if (zcl_command_arguments_count this.id)}} -- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if (isFirstElement index)}}{{else}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}completionHandler:(ResponseHandler)completionHandler +- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if (isFirstElement index)}}{{else}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}responseHandler:(ResponseHandler)responseHandler {{else}} -- (void){{asCamelCased name}}:(ResponseHandler)completionHandler +- (void){{asCamelCased name}}:(ResponseHandler)responseHandler {{/if}} { {{#if (hasSpecificResponse name)}} - CHIP{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}ResponseCallbackBridge * onSuccess = new CHIP{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}ResponseCallbackBridge(completionHandler, [self callbackQueue]); + CHIP{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}ResponseCallbackBridge * onSuccess = new CHIP{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}ResponseCallbackBridge(responseHandler, [self callbackQueue]); {{else}} - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); {{/if}} if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -620,28 +620,28 @@ private: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } {{/chip_server_cluster_commands}} {{#chip_server_cluster_attributes}} -- (void)readAttribute{{asCamelCased name false}}:(ResponseHandler)completionHandler +- (void)readAttribute{{asCamelCased name false}}WithResponseHandler:(ResponseHandler)responseHandler { {{#if isList}} - CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallbackBridge * onSuccess = new CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallbackBridge * onSuccess = new CHIP{{asCamelCased parent.name false}}{{asCamelCased name false}}AttributeCallbackBridge(responseHandler, [self callbackQueue]); {{else}} - CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge * onSuccess = new CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge(completionHandler, [self callbackQueue]{{#if (isString type)}},{{#if (isOctetString type)}}true{{else}}false{{/if}}{{/if}}); + CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge * onSuccess = new CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge(responseHandler, [self callbackQueue]{{#if (isString type)}},{{#if (isOctetString type)}}true{{else}}false{{/if}}{{/if}}); {{/if}} if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -653,23 +653,23 @@ private: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } {{#if (isWritableAttribute)}} -- (void)writeAttribute{{asCamelCased name false}}:({{asObjectiveCBasicType type}})value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttribute{{asCamelCased name false}}WithValue:({{asObjectiveCBasicType type}})value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -688,24 +688,24 @@ private: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } {{/if}} {{#if (isReportableAttribute)}} -- (void) configureAttribute{{asCamelCased name false}}:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval{{#unless (isDiscreteType)}} change:({{chipType}})change{{/unless}} completionHandler:(ResponseHandler)completionHandler +- (void) configureAttribute{{asCamelCased name false}}WithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval{{#unless (isDiscreteType)}} change:({{chipType}})change{{/unless}} responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -718,11 +718,11 @@ private: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void) reportAttribute{{asCamelCased name false}}:(ResponseHandler)reportHandler +- (void) reportAttribute{{asCamelCased name false}}WithResponseHandler:(ResponseHandler)reportHandler { CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge * onReport = new CHIP{{asCallbackAttributeType atomicTypeId}}AttributeCallbackBridge(reportHandler, [self callbackQueue]{{#if (isString type)}},{{#if (isOctetString type)}}true{{else}}false{{/if}}{{/if}}, true); if (!onReport) { diff --git a/src/app/zap-templates/templates/app/CHIPClustersObjc.zapt b/src/app/zap-templates/templates/app/CHIPClustersObjc.zapt index b2df6231bc2cc7..f79816bc8afbbf 100644 --- a/src/app/zap-templates/templates/app/CHIPClustersObjc.zapt +++ b/src/app/zap-templates/templates/app/CHIPClustersObjc.zapt @@ -35,20 +35,20 @@ NS_ASSUME_NONNULL_BEGIN {{#chip_server_cluster_commands}} {{#if (zcl_command_arguments_count this.id)}} -- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if (isFirstElement index)}}{{else}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}completionHandler:(ResponseHandler)completionHandler; +- (void){{asCamelCased name}}:{{#chip_server_cluster_command_arguments}}{{#if (isFirstElement index)}}{{else}}{{asCamelCased label}}:{{/if}}({{asObjectiveCBasicType type}}){{asCamelCased label}} {{/chip_server_cluster_command_arguments}}responseHandler:(ResponseHandler)responseHandler; {{else}} -- (void){{asCamelCased name}}:(ResponseHandler)completionHandler; +- (void){{asCamelCased name}}:(ResponseHandler)responseHandler; {{/if}} {{/chip_server_cluster_commands}} {{#chip_server_cluster_attributes}} -- (void)readAttribute{{asCamelCased name false}}:(ResponseHandler)completionHandler; +- (void)readAttribute{{asCamelCased name false}}WithResponseHandler:(ResponseHandler)responseHandler; {{#if (isWritableAttribute)}} -- (void)writeAttribute{{asCamelCased name false}}:({{asObjectiveCBasicType type}})value completionHandler:(ResponseHandler)completionHandler; +- (void)writeAttribute{{asCamelCased name false}}WithValue:({{asObjectiveCBasicType type}})value responseHandler:(ResponseHandler)responseHandler; {{/if}} {{#if (isReportableAttribute)}} -- (void) configureAttribute{{asCamelCased name false}}:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval{{#unless (isDiscreteType)}} change:({{chipType}})change{{/unless}} completionHandler:(ResponseHandler)completionHandler; -- (void) reportAttribute{{asCamelCased name false}}:(ResponseHandler)reportHandler; +- (void) configureAttribute{{asCamelCased name false}}WithMinInterval:(uint16_t)minInterval maxInterval:(uint16_t)maxInterval{{#unless (isDiscreteType)}} change:({{chipType}})change{{/unless}} responseHandler:(ResponseHandler)responseHandler; +- (void) reportAttribute{{asCamelCased name false}}WithResponseHandler:(ResponseHandler)responseHandler; {{/if}} {{/chip_server_cluster_attributes}} diff --git a/src/controller/python/gen/CHIPClustersObjc.h b/src/controller/python/gen/CHIPClustersObjc.h index e099d7c65f431a..9cc61d60648ce1 100644 --- a/src/controller/python/gen/CHIPClustersObjc.h +++ b/src/controller/python/gen/CHIPClustersObjc.h @@ -48,10 +48,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAccountLogin : CHIPCluster -- (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(ResponseHandler)completionHandler; -- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN completionHandler:(ResponseHandler)completionHandler; +- (void)getSetupPIN:(NSString *)tempAccountIdentifier responseHandler:(ResponseHandler)responseHandler; +- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -61,14 +61,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationBasic : CHIPCluster -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler; -- (void)readAttributeProductId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler; -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -79,12 +79,12 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPApplicationLauncher : CHIPCluster - (void)launchApp:(NSString *)data - catalogVendorId:(uint16_t)catalogVendorId - applicationId:(NSString *)applicationId - completionHandler:(ResponseHandler)completionHandler; + catalogVendorId:(uint16_t)catalogVendorId + applicationId:(NSString *)applicationId + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -94,11 +94,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPAudioOutput : CHIPCluster -- (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler; -- (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler; +- (void)renameOutput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler; +- (void)selectOutput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -108,14 +108,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBarrierControl : CHIPCluster -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler; -- (void)barrierControlStop:(ResponseHandler)completionHandler; +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler; +- (void)barrierControlStop:(ResponseHandler)responseHandler; -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -125,29 +125,29 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBasic : CHIPCluster -- (void)mfgSpecificPing:(ResponseHandler)completionHandler; - -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler; -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorID:(ResponseHandler)completionHandler; -- (void)readAttributeProductName:(ResponseHandler)completionHandler; -- (void)readAttributeProductID:(ResponseHandler)completionHandler; -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler; -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeLocation:(ResponseHandler)completionHandler; -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler; -- (void)readAttributePartNumber:(ResponseHandler)completionHandler; -- (void)readAttributeProductURL:(ResponseHandler)completionHandler; -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler; -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler; -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler; -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)mfgSpecificPing:(ResponseHandler)responseHandler; + +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -158,17 +158,17 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPBinding : CHIPCluster - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -179,61 +179,61 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPColorControl : CHIPCluster - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveColorTemperature:(uint8_t)moveMode rate:(uint16_t)rate colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHueAndSaturation:(uint8_t)hue saturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepColorTemperature:(uint8_t)stepMode stepSize:(uint16_t)stepSize transitionTime:(uint16_t)transitionTime @@ -241,112 +241,110 @@ NS_ASSUME_NONNULL_BEGIN colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepSaturation:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler; -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler; -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler; -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler; -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler; -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler; -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler; -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler; -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler; -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -356,14 +354,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPContentLaunch : CHIPCluster -- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler:(ResponseHandler)completionHandler; -- (void)launchURL:(NSString *)contentURL - displayString:(NSString *)displayString - completionHandler:(ResponseHandler)completionHandler; +- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler; +- (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler; -- (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSupportedStreamingTypesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -373,11 +369,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDescriptor : CHIPCluster -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler; -- (void)readAttributeServerList:(ResponseHandler)completionHandler; -- (void)readAttributeClientList:(ResponseHandler)completionHandler; -- (void)readAttributePartsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -387,37 +383,37 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDoorLock : CHIPCluster -- (void)clearAllPins:(ResponseHandler)completionHandler; -- (void)clearAllRfids:(ResponseHandler)completionHandler; -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler; -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; +- (void)clearAllPins:(ResponseHandler)responseHandler; +- (void)clearAllRfids:(ResponseHandler)responseHandler; +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler; +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler; - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler; -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler; +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler; - (void)setWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId daysMask:(uint8_t)daysMask @@ -425,23 +421,23 @@ NS_ASSUME_NONNULL_BEGIN startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler; -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeLockState:(ResponseHandler)completionHandler; -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLockState:(ResponseHandler)reportHandler; -- (void)readAttributeLockType:(ResponseHandler)completionHandler; -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -452,20 +448,20 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPGeneralCommissioning : CHIPCluster - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)commissioningComplete:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; +- (void)commissioningComplete:(ResponseHandler)responseHandler; - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricId:(ResponseHandler)completionHandler; -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler; -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -475,9 +471,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroupKeyManagement : CHIPCluster -- (void)readAttributeGroups:(ResponseHandler)completionHandler; -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -487,17 +483,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroups : CHIPCluster -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler; -- (void)addGroupIfIdentifying:(uint16_t)groupId - groupName:(NSString *)groupName - completionHandler:(ResponseHandler)completionHandler; -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllGroups:(ResponseHandler)completionHandler; -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllGroups:(ResponseHandler)responseHandler; +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -507,12 +501,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPIdentify : CHIPCluster -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler; -- (void)identifyQuery:(ResponseHandler)completionHandler; +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler; +- (void)identifyQuery:(ResponseHandler)responseHandler; -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler; -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -522,9 +516,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPKeypadInput : CHIPCluster -- (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHandler; +- (void)sendKey:(uint8_t)keyCode responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -535,39 +529,39 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPLevelControl : CHIPCluster - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler; - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler; -- (void)stopWithOnOff:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler; +- (void)stopWithOnOff:(ResponseHandler)responseHandler; -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -577,9 +571,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPLowPower : CHIPCluster -- (void)sleep:(ResponseHandler)completionHandler; +- (void)sleep:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -589,13 +583,13 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaInput : CHIPCluster -- (void)hideInputStatus:(ResponseHandler)completionHandler; -- (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler; -- (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler; -- (void)showInputStatus:(ResponseHandler)completionHandler; +- (void)hideInputStatus:(ResponseHandler)responseHandler; +- (void)renameInput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler; +- (void)selectInput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler; +- (void)showInputStatus:(ResponseHandler)responseHandler; -- (void)readAttributeMediaInputList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -605,19 +599,19 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPMediaPlayback : CHIPCluster -- (void)mediaFastForward:(ResponseHandler)completionHandler; -- (void)mediaNext:(ResponseHandler)completionHandler; -- (void)mediaPause:(ResponseHandler)completionHandler; -- (void)mediaPlay:(ResponseHandler)completionHandler; -- (void)mediaPrevious:(ResponseHandler)completionHandler; -- (void)mediaRewind:(ResponseHandler)completionHandler; -- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler; -- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler; -- (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)completionHandler; -- (void)mediaStartOver:(ResponseHandler)completionHandler; -- (void)mediaStop:(ResponseHandler)completionHandler; +- (void)mediaFastForward:(ResponseHandler)responseHandler; +- (void)mediaNext:(ResponseHandler)responseHandler; +- (void)mediaPause:(ResponseHandler)responseHandler; +- (void)mediaPlay:(ResponseHandler)responseHandler; +- (void)mediaPrevious:(ResponseHandler)responseHandler; +- (void)mediaRewind:(ResponseHandler)responseHandler; +- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; +- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler; +- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler; +- (void)mediaStartOver:(ResponseHandler)responseHandler; +- (void)mediaStop:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -630,40 +624,40 @@ NS_ASSUME_NONNULL_BEGIN - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler; - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -673,16 +667,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOnOff : CHIPCluster -- (void)off:(ResponseHandler)completionHandler; -- (void)on:(ResponseHandler)completionHandler; -- (void)toggle:(ResponseHandler)completionHandler; +- (void)off:(ResponseHandler)responseHandler; +- (void)on:(ResponseHandler)responseHandler; +- (void)toggle:(ResponseHandler)responseHandler; -- (void)readAttributeOnOff:(ResponseHandler)completionHandler; -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -692,15 +686,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)completionHandler; +- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler; -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler; + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler; +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -710,20 +704,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPPumpConfigurationAndControl : CHIPCluster -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler; -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler; -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler; -- (void)readAttributeCapacity:(ResponseHandler)completionHandler; -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler; -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler; -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -734,29 +728,29 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPScenes : CHIPCluster - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler; -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler; +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler; -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -766,14 +760,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPSwitch : CHIPCluster -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -783,16 +777,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTvChannel : CHIPCluster -- (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)completionHandler; +- (void)changeChannel:(NSString *)match responseHandler:(ResponseHandler)responseHandler; - (void)changeChannelByNumber:(uint16_t)majorNumber minorNumber:(uint16_t)minorNumber - completionHandler:(ResponseHandler)completionHandler; -- (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)skipChannel:(uint16_t)count responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeTvChannelList:(ResponseHandler)completionHandler; -- (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeTvChannelListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeTvChannelLineupWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentTvChannelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -802,10 +796,10 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTargetNavigator : CHIPCluster -- (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:(ResponseHandler)completionHandler; +- (void)navigateTarget:(uint8_t)target data:(NSString *)data responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeTargetNavigatorListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -815,15 +809,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTemperatureMeasurement : CHIPCluster -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler; -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler; -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -833,44 +827,44 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestCluster : CHIPCluster -- (void)test:(ResponseHandler)completionHandler; -- (void)testNotHandled:(ResponseHandler)completionHandler; -- (void)testSpecific:(ResponseHandler)completionHandler; - -- (void)readAttributeBoolean:(ResponseHandler)completionHandler; -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum8:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum16:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOctetString:(ResponseHandler)completionHandler; -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)test:(ResponseHandler)responseHandler; +- (void)testNotHandled:(ResponseHandler)responseHandler; +- (void)testSpecific:(ResponseHandler)responseHandler; + +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -880,33 +874,31 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPThermostat : CHIPCluster -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler; -- (void)getRelayStatusLog:(ResponseHandler)completionHandler; -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler; +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler; +- (void)getRelayStatusLog:(ResponseHandler)responseHandler; +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler; - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler; -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler; -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler; -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -916,8 +908,8 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPWakeOnLan : CHIPCluster -- (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeWakeOnLanMacAddressWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -927,43 +919,43 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPWindowCovering : CHIPCluster -- (void)windowCoveringDownClose:(ResponseHandler)completionHandler; -- (void)windowCoveringGoToLiftPercentage:(uint8_t)percentageLiftValue completionHandler:(ResponseHandler)completionHandler; -- (void)windowCoveringGoToLiftValue:(uint16_t)liftValue completionHandler:(ResponseHandler)completionHandler; -- (void)windowCoveringGoToTiltPercentage:(uint8_t)percentageTiltValue completionHandler:(ResponseHandler)completionHandler; -- (void)windowCoveringGoToTiltValue:(uint16_t)tiltValue completionHandler:(ResponseHandler)completionHandler; -- (void)windowCoveringStop:(ResponseHandler)completionHandler; -- (void)windowCoveringUpOpen:(ResponseHandler)completionHandler; - -- (void)readAttributeWindowCoveringType:(ResponseHandler)completionHandler; -- (void)configureAttributeWindowCoveringType:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeWindowCoveringType:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentPositionLift:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentPositionLift:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentPositionLift:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentPositionTilt:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentPositionTilt:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentPositionTilt:(ResponseHandler)reportHandler; -- (void)readAttributeConfigStatus:(ResponseHandler)completionHandler; -- (void)configureAttributeConfigStatus:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeConfigStatus:(ResponseHandler)reportHandler; -- (void)readAttributeInstalledOpenLimitLift:(ResponseHandler)completionHandler; -- (void)readAttributeInstalledClosedLimitLift:(ResponseHandler)completionHandler; -- (void)readAttributeInstalledOpenLimitTilt:(ResponseHandler)completionHandler; -- (void)readAttributeInstalledClosedLimitTilt:(ResponseHandler)completionHandler; -- (void)readAttributeMode:(ResponseHandler)completionHandler; -- (void)writeAttributeMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)windowCoveringDownClose:(ResponseHandler)responseHandler; +- (void)windowCoveringGoToLiftPercentage:(uint8_t)percentageLiftValue responseHandler:(ResponseHandler)responseHandler; +- (void)windowCoveringGoToLiftValue:(uint16_t)liftValue responseHandler:(ResponseHandler)responseHandler; +- (void)windowCoveringGoToTiltPercentage:(uint8_t)percentageTiltValue responseHandler:(ResponseHandler)responseHandler; +- (void)windowCoveringGoToTiltValue:(uint16_t)tiltValue responseHandler:(ResponseHandler)responseHandler; +- (void)windowCoveringStop:(ResponseHandler)responseHandler; +- (void)windowCoveringUpOpen:(ResponseHandler)responseHandler; + +- (void)readAttributeWindowCoveringTypeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeWindowCoveringTypeWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeWindowCoveringTypeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentPositionLiftWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentPositionLiftWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentPositionLiftWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentPositionTiltWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentPositionTiltWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentPositionTiltWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeConfigStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeConfigStatusWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeConfigStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInstalledOpenLimitLiftWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInstalledClosedLimitLiftWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInstalledOpenLimitTiltWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInstalledClosedLimitTiltWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end diff --git a/src/controller/python/gen/CHIPClustersObjc.mm b/src/controller/python/gen/CHIPClustersObjc.mm index 131bc5900f3a16..54ef66191619c7 100644 --- a/src/controller/python/gen/CHIPClustersObjc.mm +++ b/src/controller/python/gen/CHIPClustersObjc.mm @@ -2862,19 +2862,19 @@ @implementation CHIPAccountLogin return &_cppCluster; } -- (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(ResponseHandler)completionHandler +- (void)getSetupPIN:(NSString *)tempAccountIdentifier responseHandler:(ResponseHandler)responseHandler { CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge * onSuccess - = new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPAccountLoginClusterGetSetupPINResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2888,21 +2888,21 @@ - (void)getSetupPIN:(NSString *)tempAccountIdentifier completionHandler:(Respons if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN completionHandler:(ResponseHandler)completionHandler +- (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2918,22 +2918,22 @@ - (void)login:(NSString *)tempAccountIdentifier setupPIN:(NSString *)setupPIN co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2945,7 +2945,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -2962,19 +2962,19 @@ @implementation CHIPApplicationBasic return &_cppCluster; } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2986,22 +2986,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorId:(ResponseHandler)completionHandler +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3013,23 +3013,23 @@ - (void)readAttributeVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3041,22 +3041,22 @@ - (void)readAttributeApplicationName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductId:(ResponseHandler)completionHandler +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3068,23 +3068,23 @@ - (void)readAttributeProductId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3096,22 +3096,22 @@ - (void)readAttributeApplicationId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3123,22 +3123,22 @@ - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3150,22 +3150,22 @@ - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3177,7 +3177,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3195,21 +3195,21 @@ @implementation CHIPApplicationLauncher } - (void)launchApp:(NSString *)data - catalogVendorId:(uint16_t)catalogVendorId - applicationId:(NSString *)applicationId - completionHandler:(ResponseHandler)completionHandler + catalogVendorId:(uint16_t)catalogVendorId + applicationId:(NSString *)applicationId + responseHandler:(ResponseHandler)responseHandler { CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge * onSuccess - = new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPApplicationLauncherClusterLaunchAppResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3226,23 +3226,23 @@ - (void)launchApp:(NSString *)data if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler +- (void)readAttributeApplicationLauncherListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3254,22 +3254,22 @@ - (void)readAttributeApplicationLauncherList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3281,7 +3281,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3298,18 +3298,18 @@ @implementation CHIPAudioOutput return &_cppCluster; } -- (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler +- (void)renameOutput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3323,21 +3323,21 @@ - (void)renameOutput:(uint8_t)index name:(NSString *)name completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler +- (void)selectOutput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3349,23 +3349,23 @@ - (void)selectOutput:(uint8_t)index completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler +- (void)readAttributeAudioOutputListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3377,22 +3377,22 @@ - (void)readAttributeAudioOutputList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3404,7 +3404,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3421,18 +3421,18 @@ @implementation CHIPBarrierControl return &_cppCluster; } -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3444,21 +3444,21 @@ - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(Respon if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)barrierControlStop:(ResponseHandler)completionHandler +- (void)barrierControlStop:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3470,22 +3470,22 @@ - (void)barrierControlStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3497,22 +3497,22 @@ - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3524,22 +3524,22 @@ - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3551,22 +3551,22 @@ - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3578,22 +3578,22 @@ - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3605,7 +3605,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3622,18 +3622,18 @@ @implementation CHIPBasic return &_cppCluster; } -- (void)mfgSpecificPing:(ResponseHandler)completionHandler +- (void)mfgSpecificPing:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3645,22 +3645,22 @@ - (void)mfgSpecificPing:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3672,23 +3672,23 @@ - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3700,22 +3700,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorID:(ResponseHandler)completionHandler +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3727,23 +3727,23 @@ - (void)readAttributeVendorID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductName:(ResponseHandler)completionHandler +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3755,22 +3755,22 @@ - (void)readAttributeProductName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductID:(ResponseHandler)completionHandler +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3782,23 +3782,23 @@ - (void)readAttributeProductID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3810,22 +3810,22 @@ - (void)readAttributeUserLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3839,23 +3839,23 @@ - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocation:(ResponseHandler)completionHandler +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3867,22 +3867,22 @@ - (void)readAttributeLocation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3896,22 +3896,22 @@ - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3923,23 +3923,23 @@ - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3951,22 +3951,22 @@ - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3978,23 +3978,23 @@ - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4006,23 +4006,23 @@ - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4034,23 +4034,23 @@ - (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartNumber:(ResponseHandler)completionHandler +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4062,23 +4062,23 @@ - (void)readAttributePartNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductURL:(ResponseHandler)completionHandler +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4090,23 +4090,23 @@ - (void)readAttributeProductURL:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4118,23 +4118,23 @@ - (void)readAttributeProductLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4146,23 +4146,22 @@ - (void)readAttributeSerialNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4174,22 +4173,22 @@ - (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4201,22 +4200,22 @@ - (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4228,7 +4227,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -4246,21 +4245,21 @@ @implementation CHIPBinding } - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4272,25 +4271,25 @@ - (void)bind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4302,22 +4301,22 @@ - (void)unbind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4329,7 +4328,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -4347,21 +4346,21 @@ @implementation CHIPColorControl } - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4373,7 +4372,7 @@ - (void)moveColor:(int16_t)rateX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveColorTemperature:(uint8_t)moveMode @@ -4382,18 +4381,18 @@ - (void)moveColorTemperature:(uint8_t)moveMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4406,25 +4405,25 @@ - (void)moveColorTemperature:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4436,25 +4435,25 @@ - (void)moveHue:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4467,26 +4466,26 @@ - (void)moveSaturation:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4499,25 +4498,25 @@ - (void)moveToColor:(uint16_t)colorX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4530,26 +4529,26 @@ - (void)moveToColorTemperature:(uint16_t)colorTemperature if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4562,7 +4561,7 @@ - (void)moveToHue:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHueAndSaturation:(uint8_t)hue @@ -4570,18 +4569,18 @@ - (void)moveToHueAndSaturation:(uint8_t)hue transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4594,25 +4593,25 @@ - (void)moveToHueAndSaturation:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4625,26 +4624,26 @@ - (void)moveToSaturation:(uint8_t)saturation if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4657,7 +4656,7 @@ - (void)stepColor:(int16_t)stepX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColorTemperature:(uint8_t)stepMode @@ -4667,18 +4666,18 @@ - (void)stepColorTemperature:(uint8_t)stepMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4691,26 +4690,26 @@ - (void)stepColorTemperature:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4723,7 +4722,7 @@ - (void)stepHue:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepSaturation:(uint8_t)stepMode @@ -4731,18 +4730,18 @@ - (void)stepSaturation:(uint8_t)stepMode transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4755,23 +4754,21 @@ - (void)stepSaturation:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4783,22 +4780,22 @@ - (void)stopMoveStep:(uint8_t)optionsMask if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4810,25 +4807,25 @@ - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4841,11 +4838,11 @@ - (void)configureAttributeCurrentHue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4864,18 +4861,18 @@ - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4887,25 +4884,25 @@ - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4918,11 +4915,11 @@ - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4941,18 +4938,18 @@ - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler } } -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4964,22 +4961,22 @@ - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4991,25 +4988,25 @@ - (void)readAttributeCurrentX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5022,11 +5019,11 @@ - (void)configureAttributeCurrentX:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5045,18 +5042,18 @@ - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5068,25 +5065,25 @@ - (void)readAttributeCurrentY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5099,11 +5096,11 @@ - (void)configureAttributeCurrentY:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5122,18 +5119,18 @@ - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler } } -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5145,23 +5142,23 @@ - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5173,22 +5170,22 @@ - (void)readAttributeCompensationText:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5200,25 +5197,25 @@ - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5231,11 +5228,11 @@ - (void)configureAttributeColorTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -5254,18 +5251,18 @@ - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeColorMode:(ResponseHandler)completionHandler +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5277,22 +5274,22 @@ - (void)readAttributeColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5304,22 +5301,22 @@ - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5331,22 +5328,22 @@ - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5358,22 +5355,22 @@ - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5385,22 +5382,22 @@ - (void)readAttributePrimary1X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5412,22 +5409,22 @@ - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5439,22 +5436,22 @@ - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5466,22 +5463,22 @@ - (void)readAttributePrimary2X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5493,22 +5490,22 @@ - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5520,22 +5517,22 @@ - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5547,22 +5544,22 @@ - (void)readAttributePrimary3X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5574,22 +5571,22 @@ - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5601,22 +5598,22 @@ - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5628,22 +5625,22 @@ - (void)readAttributePrimary4X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5655,22 +5652,22 @@ - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5682,22 +5679,22 @@ - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5709,22 +5706,22 @@ - (void)readAttributePrimary5X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5736,22 +5733,22 @@ - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5763,22 +5760,22 @@ - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5790,22 +5787,22 @@ - (void)readAttributePrimary6X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5817,22 +5814,22 @@ - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5844,22 +5841,22 @@ - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5871,22 +5868,22 @@ - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5898,22 +5895,22 @@ - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5925,22 +5922,22 @@ - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5952,22 +5949,22 @@ - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5979,22 +5976,22 @@ - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6006,22 +6003,22 @@ - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6033,22 +6030,22 @@ - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6060,22 +6057,22 @@ - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6087,22 +6084,22 @@ - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6114,22 +6111,22 @@ - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6141,22 +6138,22 @@ - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6168,22 +6165,22 @@ - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6195,22 +6192,22 @@ - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6222,22 +6219,22 @@ - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6249,22 +6246,22 @@ - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6276,22 +6273,22 @@ - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6303,22 +6300,22 @@ - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6330,22 +6327,22 @@ - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6357,22 +6354,22 @@ - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6384,22 +6381,22 @@ - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6411,22 +6408,22 @@ - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6438,22 +6435,22 @@ - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6465,22 +6462,22 @@ - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6492,22 +6489,22 @@ - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6519,22 +6516,22 @@ - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6546,22 +6543,22 @@ - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6573,22 +6570,22 @@ - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6600,22 +6597,22 @@ - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6627,22 +6624,22 @@ - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6654,22 +6651,22 @@ - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6681,22 +6678,22 @@ - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6708,22 +6705,22 @@ - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6735,22 +6732,22 @@ - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6762,7 +6759,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -6779,19 +6776,19 @@ @implementation CHIPContentLaunch return &_cppCluster; } -- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler:(ResponseHandler)completionHandler +- (void)launchContent:(uint8_t)autoPlay data:(NSString *)data responseHandler:(ResponseHandler)responseHandler { CHIPContentLaunchClusterLaunchContentResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPContentLaunchClusterLaunchContentResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6805,24 +6802,22 @@ - (void)launchContent:(uint8_t)autoPlay data:(NSString *)data completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)launchURL:(NSString *)contentURL - displayString:(NSString *)displayString - completionHandler:(ResponseHandler)completionHandler +- (void)launchURL:(NSString *)contentURL displayString:(NSString *)displayString responseHandler:(ResponseHandler)responseHandler { CHIPContentLaunchClusterLaunchURLResponseCallbackBridge * onSuccess - = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPContentLaunchClusterLaunchURLResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6838,23 +6833,23 @@ - (void)launchURL:(NSString *)contentURL if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler +- (void)readAttributeAcceptsHeaderListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6866,23 +6861,23 @@ - (void)readAttributeAcceptsHeaderList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler +- (void)readAttributeSupportedStreamingTypesWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6894,22 +6889,22 @@ - (void)readAttributeSupportedStreamingTypes:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6921,7 +6916,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -6938,19 +6933,19 @@ @implementation CHIPDescriptor return &_cppCluster; } -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorDeviceListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorDeviceListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorDeviceListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6962,23 +6957,23 @@ - (void)readAttributeDeviceList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeServerList:(ResponseHandler)completionHandler +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorServerListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorServerListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorServerListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6990,23 +6985,23 @@ - (void)readAttributeServerList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClientList:(ResponseHandler)completionHandler +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorClientListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorClientListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorClientListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7018,23 +7013,23 @@ - (void)readAttributeClientList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartsList:(ResponseHandler)completionHandler +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorPartsListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorPartsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorPartsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7046,22 +7041,22 @@ - (void)readAttributePartsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7073,7 +7068,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7090,19 +7085,19 @@ @implementation CHIPDoorLock return &_cppCluster; } -- (void)clearAllPins:(ResponseHandler)completionHandler +- (void)clearAllPins:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7114,22 +7109,22 @@ - (void)clearAllPins:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearAllRfids:(ResponseHandler)completionHandler +- (void)clearAllRfids:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7141,22 +7136,22 @@ - (void)clearAllRfids:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7168,22 +7163,22 @@ - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7195,22 +7190,22 @@ - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionH if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7222,22 +7217,22 @@ - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7249,22 +7244,22 @@ - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7276,22 +7271,22 @@ - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7303,22 +7298,22 @@ - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7330,22 +7325,22 @@ - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7357,22 +7352,22 @@ - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7384,22 +7379,22 @@ - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7411,22 +7406,22 @@ - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7438,22 +7433,22 @@ - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7465,22 +7460,22 @@ - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7494,26 +7489,26 @@ - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7526,26 +7521,26 @@ - (void)setHolidaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7559,26 +7554,26 @@ - (void)setPin:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7592,22 +7587,22 @@ - (void)setRfid:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7619,7 +7614,7 @@ - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeekdaySchedule:(uint8_t)scheduleId @@ -7629,19 +7624,19 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7654,26 +7649,26 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7686,22 +7681,22 @@ - (void)setYeardaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7715,22 +7710,22 @@ - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7744,22 +7739,22 @@ - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLockState:(ResponseHandler)completionHandler +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7771,24 +7766,24 @@ - (void)readAttributeLockState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7800,11 +7795,11 @@ - (void)configureAttributeLockState:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLockState:(ResponseHandler)reportHandler +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -7823,18 +7818,18 @@ - (void)reportAttributeLockState:(ResponseHandler)reportHandler } } -- (void)readAttributeLockType:(ResponseHandler)completionHandler +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7846,23 +7841,22 @@ - (void)readAttributeLockType:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7874,22 +7868,22 @@ - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7901,7 +7895,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7919,21 +7913,21 @@ @implementation CHIPGeneralCommissioning } - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7945,22 +7939,22 @@ - (void)armFailSafe:(uint16_t)expiryLengthSeconds if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)commissioningComplete:(ResponseHandler)completionHandler +- (void)commissioningComplete:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7972,26 +7966,26 @@ - (void)commissioningComplete:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8006,23 +8000,23 @@ - (void)setRegulatoryConfig:(uint8_t)location if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricId:(ResponseHandler)completionHandler +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8034,22 +8028,22 @@ - (void)readAttributeFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8061,22 +8055,22 @@ - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8088,22 +8082,22 @@ - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8115,7 +8109,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8132,19 +8126,19 @@ @implementation CHIPGroupKeyManagement return &_cppCluster; } -- (void)readAttributeGroups:(ResponseHandler)completionHandler +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupsAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8156,23 +8150,23 @@ - (void)readAttributeGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8184,22 +8178,22 @@ - (void)readAttributeGroupKeys:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8211,7 +8205,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8228,19 +8222,19 @@ @implementation CHIPGroups return &_cppCluster; } -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterAddGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8254,21 +8248,21 @@ - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8282,22 +8276,22 @@ - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8309,21 +8303,21 @@ - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllGroups:(ResponseHandler)completionHandler +- (void)removeAllGroups:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8335,22 +8329,22 @@ - (void)removeAllGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8362,22 +8356,22 @@ - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterViewGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8389,22 +8383,22 @@ - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8416,22 +8410,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8443,7 +8437,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8460,18 +8454,18 @@ @implementation CHIPIdentify return &_cppCluster; } -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8483,22 +8477,22 @@ - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)identifyQuery:(ResponseHandler)completionHandler +- (void)identifyQuery:(ResponseHandler)responseHandler { CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess - = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8510,22 +8504,22 @@ - (void)identifyQuery:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8537,22 +8531,22 @@ - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8564,22 +8558,22 @@ - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8591,7 +8585,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8608,19 +8602,19 @@ @implementation CHIPKeypadInput return &_cppCluster; } -- (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHandler +- (void)sendKey:(uint8_t)keyCode responseHandler:(ResponseHandler)responseHandler { CHIPKeypadInputClusterSendKeyResponseCallbackBridge * onSuccess - = new CHIPKeypadInputClusterSendKeyResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPKeypadInputClusterSendKeyResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8632,22 +8626,22 @@ - (void)sendKey:(uint8_t)keyCode completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8659,7 +8653,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8677,21 +8671,21 @@ @implementation CHIPLevelControl } - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8703,25 +8697,25 @@ - (void)move:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8734,23 +8728,21 @@ - (void)moveToLevel:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveToLevelWithOnOff:(uint8_t)level - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler +- (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8762,21 +8754,21 @@ - (void)moveToLevelWithOnOff:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8788,26 +8780,26 @@ - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(Re if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8820,24 +8812,24 @@ - (void)step:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8849,21 +8841,21 @@ - (void)stepWithOnOff:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8875,21 +8867,21 @@ - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopWithOnOff:(ResponseHandler)completionHandler +- (void)stopWithOnOff:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8901,22 +8893,22 @@ - (void)stopWithOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8928,25 +8920,25 @@ - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8959,11 +8951,11 @@ - (void)configureAttributeCurrentLevel:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -8982,18 +8974,18 @@ - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9005,7 +8997,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9022,18 +9014,18 @@ @implementation CHIPLowPower return &_cppCluster; } -- (void)sleep:(ResponseHandler)completionHandler +- (void)sleep:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9045,22 +9037,22 @@ - (void)sleep:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9072,7 +9064,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9089,18 +9081,18 @@ @implementation CHIPMediaInput return &_cppCluster; } -- (void)hideInputStatus:(ResponseHandler)completionHandler +- (void)hideInputStatus:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9112,21 +9104,21 @@ - (void)hideInputStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(ResponseHandler)completionHandler +- (void)renameInput:(uint8_t)index name:(NSString *)name responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9140,21 +9132,21 @@ - (void)renameInput:(uint8_t)index name:(NSString *)name completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completionHandler +- (void)selectInput:(uint8_t)index responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9166,21 +9158,21 @@ - (void)selectInput:(uint8_t)index completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)showInputStatus:(ResponseHandler)completionHandler +- (void)showInputStatus:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9192,23 +9184,23 @@ - (void)showInputStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMediaInputList:(ResponseHandler)completionHandler +- (void)readAttributeMediaInputListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9220,22 +9212,22 @@ - (void)readAttributeMediaInputList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9247,7 +9239,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9264,19 +9256,19 @@ @implementation CHIPMediaPlayback return &_cppCluster; } -- (void)mediaFastForward:(ResponseHandler)completionHandler +- (void)mediaFastForward:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaFastForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9288,22 +9280,22 @@ - (void)mediaFastForward:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaNext:(ResponseHandler)completionHandler +- (void)mediaNext:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaNextResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9315,22 +9307,22 @@ - (void)mediaNext:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPause:(ResponseHandler)completionHandler +- (void)mediaPause:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPauseResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9342,22 +9334,22 @@ - (void)mediaPause:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPlay:(ResponseHandler)completionHandler +- (void)mediaPlay:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPlayResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9369,22 +9361,22 @@ - (void)mediaPlay:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaPrevious:(ResponseHandler)completionHandler +- (void)mediaPrevious:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaPreviousResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9396,22 +9388,22 @@ - (void)mediaPrevious:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaRewind:(ResponseHandler)completionHandler +- (void)mediaRewind:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaRewindResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9423,22 +9415,22 @@ - (void)mediaRewind:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipBackwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9450,22 +9442,22 @@ - (void)mediaSkipBackward:(uint64_t)deltaPositionMilliseconds completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipForwardResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9477,22 +9469,22 @@ - (void)mediaSkipForward:(uint64_t)deltaPositionMilliseconds completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)completionHandler +- (void)mediaSkipSeek:(uint64_t)position responseHandler:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaSkipSeekResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9504,22 +9496,22 @@ - (void)mediaSkipSeek:(uint64_t)position completionHandler:(ResponseHandler)comp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaStartOver:(ResponseHandler)completionHandler +- (void)mediaStartOver:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaStartOverResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9531,22 +9523,22 @@ - (void)mediaStartOver:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)mediaStop:(ResponseHandler)completionHandler +- (void)mediaStop:(ResponseHandler)responseHandler { CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge * onSuccess - = new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPMediaPlaybackClusterMediaStopResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9558,22 +9550,22 @@ - (void)mediaStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9585,7 +9577,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9605,19 +9597,19 @@ @implementation CHIPNetworkCommissioning - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9630,26 +9622,26 @@ - (void)addThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9663,25 +9655,25 @@ - (void)addWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9694,25 +9686,25 @@ - (void)disableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9725,21 +9717,21 @@ - (void)enableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9751,25 +9743,25 @@ - (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9782,25 +9774,25 @@ - (void)removeNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9813,25 +9805,25 @@ - (void)scanNetworks:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9844,26 +9836,26 @@ - (void)updateThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9877,22 +9869,22 @@ - (void)updateWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9904,7 +9896,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9921,18 +9913,18 @@ @implementation CHIPOnOff return &_cppCluster; } -- (void)off:(ResponseHandler)completionHandler +- (void)off:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9944,21 +9936,21 @@ - (void)off:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)on:(ResponseHandler)completionHandler +- (void)on:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9970,21 +9962,21 @@ - (void)on:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)toggle:(ResponseHandler)completionHandler +- (void)toggle:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9996,23 +9988,22 @@ - (void)toggle:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOnOff:(ResponseHandler)completionHandler +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10024,24 +10015,24 @@ - (void)readAttributeOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10053,11 +10044,11 @@ - (void)configureAttributeOnOff:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)reportHandler { CHIPBooleanAttributeCallbackBridge * onReport = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true); @@ -10077,18 +10068,18 @@ - (void)reportAttributeOnOff:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10100,7 +10091,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10117,19 +10108,19 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)completionHandler +- (void)getFabricId:(ResponseHandler)responseHandler { CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10141,24 +10132,24 @@ - (void)getFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10170,21 +10161,21 @@ - (void)removeFabric:(uint64_t)fabricId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10198,23 +10189,23 @@ - (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * onSuccess - = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10226,22 +10217,22 @@ - (void)readAttributeFabricsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10253,7 +10244,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10270,18 +10261,18 @@ @implementation CHIPPumpConfigurationAndControl return &_cppCluster; } -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10293,22 +10284,22 @@ - (void)readAttributeMaxPressure:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10320,22 +10311,22 @@ - (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10347,22 +10338,22 @@ - (void)readAttributeMaxFlow:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10374,22 +10365,22 @@ - (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10401,22 +10392,22 @@ - (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCapacity:(ResponseHandler)completionHandler +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10428,25 +10419,25 @@ - (void)readAttributeCapacity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10459,11 +10450,11 @@ - (void)configureAttributeCapacity:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -10482,18 +10473,18 @@ - (void)reportAttributeCapacity:(ResponseHandler)reportHandler } } -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10505,22 +10496,22 @@ - (void)readAttributeOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10532,22 +10523,22 @@ - (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10559,7 +10550,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10577,25 +10568,25 @@ @implementation CHIPScenes } - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterAddSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10610,22 +10601,22 @@ - (void)addScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess - = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10637,24 +10628,24 @@ - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10666,22 +10657,22 @@ - (void)recallScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10693,22 +10684,22 @@ - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10720,22 +10711,22 @@ - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterStoreSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10747,22 +10738,22 @@ - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterViewSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10774,22 +10765,22 @@ - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10801,22 +10792,22 @@ - (void)readAttributeSceneCount:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10828,22 +10819,22 @@ - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10855,23 +10846,22 @@ - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10883,22 +10873,22 @@ - (void)readAttributeSceneValid:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10910,22 +10900,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10937,7 +10927,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10954,18 +10944,18 @@ @implementation CHIPSwitch return &_cppCluster; } -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10977,22 +10967,22 @@ - (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11004,25 +10994,25 @@ - (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11035,11 +11025,11 @@ - (void)configureAttributeCurrentPosition:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -11058,18 +11048,18 @@ - (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11081,7 +11071,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11098,19 +11088,19 @@ @implementation CHIPTvChannel return &_cppCluster; } -- (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)completionHandler +- (void)changeChannel:(NSString *)match responseHandler:(ResponseHandler)responseHandler { CHIPTvChannelClusterChangeChannelResponseCallbackBridge * onSuccess - = new CHIPTvChannelClusterChangeChannelResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTvChannelClusterChangeChannelResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11124,23 +11114,23 @@ - (void)changeChannel:(NSString *)match completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)changeChannelByNumber:(uint16_t)majorNumber minorNumber:(uint16_t)minorNumber - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11152,21 +11142,21 @@ - (void)changeChannelByNumber:(uint16_t)majorNumber if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completionHandler +- (void)skipChannel:(uint16_t)count responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11178,23 +11168,23 @@ - (void)skipChannel:(uint16_t)count completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTvChannelList:(ResponseHandler)completionHandler +- (void)readAttributeTvChannelListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11206,23 +11196,23 @@ - (void)readAttributeTvChannelList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler +- (void)readAttributeTvChannelLineupWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11234,23 +11224,23 @@ - (void)readAttributeTvChannelLineup:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler +- (void)readAttributeCurrentTvChannelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11262,22 +11252,22 @@ - (void)readAttributeCurrentTvChannel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11289,7 +11279,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11306,19 +11296,19 @@ @implementation CHIPTargetNavigator return &_cppCluster; } -- (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:(ResponseHandler)completionHandler +- (void)navigateTarget:(uint8_t)target data:(NSString *)data responseHandler:(ResponseHandler)responseHandler { CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge * onSuccess - = new CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTargetNavigatorClusterNavigateTargetResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11332,23 +11322,23 @@ - (void)navigateTarget:(uint8_t)target data:(NSString *)data completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler +- (void)readAttributeTargetNavigatorListWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11360,22 +11350,22 @@ - (void)readAttributeTargetNavigatorList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11387,7 +11377,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11404,18 +11394,18 @@ @implementation CHIPTemperatureMeasurement return &_cppCluster; } -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11427,25 +11417,25 @@ - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11458,11 +11448,11 @@ - (void)configureAttributeMeasuredValue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -11481,18 +11471,18 @@ - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler } } -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11504,22 +11494,22 @@ - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11531,22 +11521,22 @@ - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11558,7 +11548,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -11575,18 +11565,18 @@ @implementation CHIPTestCluster return &_cppCluster; } -- (void)test:(ResponseHandler)completionHandler +- (void)test:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11598,21 +11588,21 @@ - (void)test:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testNotHandled:(ResponseHandler)completionHandler +- (void)testNotHandled:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11624,22 +11614,22 @@ - (void)testNotHandled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testSpecific:(ResponseHandler)completionHandler +- (void)testSpecific:(ResponseHandler)responseHandler { CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess - = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11651,23 +11641,22 @@ - (void)testSpecific:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBoolean:(ResponseHandler)completionHandler +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11679,22 +11668,22 @@ - (void)readAttributeBoolean:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11706,22 +11695,22 @@ - (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11733,22 +11722,22 @@ - (void)readAttributeBitmap8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11760,22 +11749,22 @@ - (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11787,22 +11776,22 @@ - (void)readAttributeBitmap16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11814,22 +11803,22 @@ - (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11841,22 +11830,22 @@ - (void)readAttributeBitmap32:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11868,22 +11857,22 @@ - (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11895,22 +11884,22 @@ - (void)readAttributeBitmap64:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11922,22 +11911,22 @@ - (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8u:(ResponseHandler)completionHandler +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11949,22 +11938,22 @@ - (void)readAttributeInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11976,22 +11965,22 @@ - (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16u:(ResponseHandler)completionHandler +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12003,22 +11992,22 @@ - (void)readAttributeInt16u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12030,22 +12019,22 @@ - (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32u:(ResponseHandler)completionHandler +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12057,22 +12046,22 @@ - (void)readAttributeInt32u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12084,22 +12073,22 @@ - (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64u:(ResponseHandler)completionHandler +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12111,22 +12100,22 @@ - (void)readAttributeInt64u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12138,22 +12127,22 @@ - (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8s:(ResponseHandler)completionHandler +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12165,22 +12154,22 @@ - (void)readAttributeInt8s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12192,22 +12181,22 @@ - (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16s:(ResponseHandler)completionHandler +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12219,22 +12208,22 @@ - (void)readAttributeInt16s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12246,22 +12235,22 @@ - (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32s:(ResponseHandler)completionHandler +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12273,22 +12262,22 @@ - (void)readAttributeInt32s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12300,22 +12289,22 @@ - (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64s:(ResponseHandler)completionHandler +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12327,22 +12316,22 @@ - (void)readAttributeInt64s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12354,22 +12343,22 @@ - (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum8:(ResponseHandler)completionHandler +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12381,22 +12370,22 @@ - (void)readAttributeEnum8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12408,22 +12397,22 @@ - (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum16:(ResponseHandler)completionHandler +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12435,22 +12424,22 @@ - (void)readAttributeEnum16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12462,23 +12451,23 @@ - (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOctetString:(ResponseHandler)completionHandler +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12490,22 +12479,22 @@ - (void)readAttributeOctetString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12518,23 +12507,23 @@ - (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler { CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess - = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterListInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12546,22 +12535,22 @@ - (void)readAttributeListInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12573,7 +12562,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -12590,18 +12579,18 @@ @implementation CHIPThermostat return &_cppCluster; } -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12613,21 +12602,21 @@ - (void)clearWeeklySchedule:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRelayStatusLog:(ResponseHandler)completionHandler +- (void)getRelayStatusLog:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12639,23 +12628,21 @@ - (void)getRelayStatusLog:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12667,25 +12654,25 @@ - (void)getWeeklySchedule:(uint8_t)daysToReturn if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12698,21 +12685,21 @@ - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12724,22 +12711,22 @@ - (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12751,25 +12738,25 @@ - (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12782,11 +12769,11 @@ - (void)configureAttributeLocalTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -12805,18 +12792,18 @@ - (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12828,22 +12815,22 @@ - (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12855,22 +12842,22 @@ - (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12882,22 +12869,22 @@ - (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12909,22 +12896,22 @@ - (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12936,22 +12923,22 @@ - (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12963,22 +12950,22 @@ - (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -12990,22 +12977,22 @@ - (void)readAttributeSystemMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13017,22 +13004,22 @@ - (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13044,7 +13031,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -13061,19 +13048,19 @@ @implementation CHIPWakeOnLan return &_cppCluster; } -- (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler +- (void)readAttributeWakeOnLanMacAddressWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13085,22 +13072,22 @@ - (void)readAttributeWakeOnLanMacAddress:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13112,7 +13099,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -13129,18 +13116,18 @@ @implementation CHIPWindowCovering return &_cppCluster; } -- (void)windowCoveringDownClose:(ResponseHandler)completionHandler +- (void)windowCoveringDownClose:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13152,21 +13139,21 @@ - (void)windowCoveringDownClose:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringGoToLiftPercentage:(uint8_t)percentageLiftValue completionHandler:(ResponseHandler)completionHandler +- (void)windowCoveringGoToLiftPercentage:(uint8_t)percentageLiftValue responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13178,21 +13165,21 @@ - (void)windowCoveringGoToLiftPercentage:(uint8_t)percentageLiftValue completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringGoToLiftValue:(uint16_t)liftValue completionHandler:(ResponseHandler)completionHandler +- (void)windowCoveringGoToLiftValue:(uint16_t)liftValue responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13204,21 +13191,21 @@ - (void)windowCoveringGoToLiftValue:(uint16_t)liftValue completionHandler:(Respo if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringGoToTiltPercentage:(uint8_t)percentageTiltValue completionHandler:(ResponseHandler)completionHandler +- (void)windowCoveringGoToTiltPercentage:(uint8_t)percentageTiltValue responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13230,21 +13217,21 @@ - (void)windowCoveringGoToTiltPercentage:(uint8_t)percentageTiltValue completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringGoToTiltValue:(uint16_t)tiltValue completionHandler:(ResponseHandler)completionHandler +- (void)windowCoveringGoToTiltValue:(uint16_t)tiltValue responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13256,21 +13243,21 @@ - (void)windowCoveringGoToTiltValue:(uint16_t)tiltValue completionHandler:(Respo if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringStop:(ResponseHandler)completionHandler +- (void)windowCoveringStop:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13282,21 +13269,21 @@ - (void)windowCoveringStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)windowCoveringUpOpen:(ResponseHandler)completionHandler +- (void)windowCoveringUpOpen:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13308,22 +13295,22 @@ - (void)windowCoveringUpOpen:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWindowCoveringType:(ResponseHandler)completionHandler +- (void)readAttributeWindowCoveringTypeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13335,24 +13322,24 @@ - (void)readAttributeWindowCoveringType:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeWindowCoveringType:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeWindowCoveringTypeWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13365,11 +13352,11 @@ - (void)configureAttributeWindowCoveringType:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeWindowCoveringType:(ResponseHandler)reportHandler +- (void)reportAttributeWindowCoveringTypeWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -13388,18 +13375,18 @@ - (void)reportAttributeWindowCoveringType:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentPositionLift:(ResponseHandler)completionHandler +- (void)readAttributeCurrentPositionLiftWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13411,25 +13398,25 @@ - (void)readAttributeCurrentPositionLift:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentPositionLift:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentPositionLiftWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13442,11 +13429,11 @@ - (void)configureAttributeCurrentPositionLift:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentPositionLift:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentPositionLiftWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -13465,18 +13452,18 @@ - (void)reportAttributeCurrentPositionLift:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentPositionTilt:(ResponseHandler)completionHandler +- (void)readAttributeCurrentPositionTiltWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13488,25 +13475,25 @@ - (void)readAttributeCurrentPositionTilt:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentPositionTilt:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentPositionTiltWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13519,11 +13506,11 @@ - (void)configureAttributeCurrentPositionTilt:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentPositionTilt:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentPositionTiltWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -13542,18 +13529,18 @@ - (void)reportAttributeCurrentPositionTilt:(ResponseHandler)reportHandler } } -- (void)readAttributeConfigStatus:(ResponseHandler)completionHandler +- (void)readAttributeConfigStatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13565,24 +13552,24 @@ - (void)readAttributeConfigStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeConfigStatus:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeConfigStatusWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13594,11 +13581,11 @@ - (void)configureAttributeConfigStatus:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeConfigStatus:(ResponseHandler)reportHandler +- (void)reportAttributeConfigStatusWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -13617,18 +13604,18 @@ - (void)reportAttributeConfigStatus:(ResponseHandler)reportHandler } } -- (void)readAttributeInstalledOpenLimitLift:(ResponseHandler)completionHandler +- (void)readAttributeInstalledOpenLimitLiftWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13640,22 +13627,22 @@ - (void)readAttributeInstalledOpenLimitLift:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInstalledClosedLimitLift:(ResponseHandler)completionHandler +- (void)readAttributeInstalledClosedLimitLiftWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13667,22 +13654,22 @@ - (void)readAttributeInstalledClosedLimitLift:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInstalledOpenLimitTilt:(ResponseHandler)completionHandler +- (void)readAttributeInstalledOpenLimitTiltWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13694,22 +13681,22 @@ - (void)readAttributeInstalledOpenLimitTilt:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInstalledClosedLimitTilt:(ResponseHandler)completionHandler +- (void)readAttributeInstalledClosedLimitTiltWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13721,22 +13708,22 @@ - (void)readAttributeInstalledClosedLimitTilt:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMode:(ResponseHandler)completionHandler +- (void)readAttributeModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13748,22 +13735,22 @@ - (void)readAttributeMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13775,22 +13762,22 @@ - (void)writeAttributeMode:(uint8_t)value completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -13802,7 +13789,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m index 7279c0c40b229c..ec42a43932b08c 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Bindings/BindingsViewController.m @@ -141,10 +141,10 @@ - (IBAction)bind:(id)sender int clusterId = [_clusterIDTextField.text intValue]; [self.cluster bind:nodeId - groupId:groupId - endpointId:endpointId - clusterId:clusterId - completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + groupId:groupId + endpointId:endpointId + clusterId:clusterId + responseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { NSString * resultString = (error == nil) ? @"Bind command: success!" : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; NSLog(resultString, nil); @@ -159,14 +159,14 @@ - (IBAction)unbind:(id)sender int clusterId = [_clusterIDTextField.text intValue]; [self.cluster unbind:nodeId - groupId:groupId - endpointId:endpointId - clusterId:clusterId - completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { - NSString * resultString = (error == nil) ? @"Unbind command: success!" - : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; - NSLog(resultString, nil); - }]; + groupId:groupId + endpointId:endpointId + clusterId:clusterId + responseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + NSString * resultString = (error == nil) ? @"Unbind command: success!" + : [NSString stringWithFormat:@"An error occured: 0x%02lx", error.code]; + NSLog(resultString, nil); + }]; } @end diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m index 74a11a25bfb4e6..0a8f4390184001 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m @@ -208,7 +208,7 @@ - (void)fetchFabricsList { NSLog(@"Request to fetchFabricsList"); [self updateResult:[NSString stringWithFormat:@"readAttributeFabricsList command sent."] isError:NO]; - [self.cluster readAttributeFabricsList:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + [self.cluster readAttributeFabricsListWithResponseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { NSArray * fabricsList = [values objectForKey:@"value"]; if (error) { dispatch_async(dispatch_get_main_queue(), ^{ @@ -263,25 +263,26 @@ - (IBAction)updateFabricLabelButtonPressed:(id)sender [self updateResult:[NSString stringWithFormat:@"updateFabricLabel command sent."] isError:NO]; [self.cluster updateFabricLabel:label - completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { - dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - NSLog(@"Got back error trying to updateFabricLabel %@", error); - self->_updateFabricLabelTextField.text = @""; - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateResult:[NSString stringWithFormat:@"Command updateFabricLabel failed with error %@", error] - isError:YES]; - }); - } else { - NSLog(@"Successfully updated the label: %@", values); - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateResult:[NSString + responseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (error) { + NSLog(@"Got back error trying to updateFabricLabel %@", error); + self->_updateFabricLabelTextField.text = @""; + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateResult:[NSString stringWithFormat:@"Command updateFabricLabel failed with error %@", error] + isError:YES]; + }); + } else { + NSLog(@"Successfully updated the label: %@", values); + dispatch_async(dispatch_get_main_queue(), ^{ + [self + updateResult:[NSString stringWithFormat:@"Command updateFabricLabel succeeded to update label to %@", label] isError:NO]; - }); - } - }); - }]; + }); + } + }); + }]; } - (IBAction)removeFabricButtonPressed:(id)sender @@ -298,23 +299,24 @@ - (IBAction)removeFabricButtonPressed:(id)sender [self.cluster removeFabric:[fabricId unsignedLongLongValue] nodeId:[nodeID unsignedLongLongValue] vendorId:[vendorID unsignedShortValue] - completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { - if (error) { - NSLog(@"Failed to remove fabric with error %@", error); - dispatch_async(dispatch_get_main_queue(), ^{ - [self updateResult:[NSString stringWithFormat:@"Command removeFabric failed with error %@", error] - isError:YES]; - self->_removeFabricTextField.text = @""; - }); - } else { - NSLog(@"Succeeded removing fabric!"); - dispatch_async(dispatch_get_main_queue(), ^{ - self->_removeFabricTextField.text = @""; - [self updateResult:[NSString stringWithFormat:@"Command removeFabric succeeded to remove %@", fabricId] + responseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + if (error) { + NSLog(@"Failed to remove fabric with error %@", error); + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateResult:[NSString stringWithFormat:@"Command removeFabric failed with error %@", error] + isError:YES]; + self->_removeFabricTextField.text = @""; + }); + } else { + NSLog(@"Succeeded removing fabric!"); + dispatch_async(dispatch_get_main_queue(), ^{ + self->_removeFabricTextField.text = @""; + [self + updateResult:[NSString stringWithFormat:@"Command removeFabric succeeded to remove %@", fabricId] isError:NO]; - }); - } - }]; + }); + } + }]; } else { dispatch_async(dispatch_get_main_queue(), ^{ self->_removeFabricTextField.text = @""; diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m index caf939dc654e1b..f4a6a92639e0c3 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m @@ -531,9 +531,9 @@ - (void)addWiFiNetwork:(NSString *)ssid password:(NSString *)password credentials:credentials breadcrumb:breadcrumb timeoutMs:timeoutMs - completionHandler:^(NSError * error, NSDictionary * values) { - [weakSelf onAddNetworkResponse:error isWiFi:YES]; - }]; + responseHandler:^(NSError * error, NSDictionary * values) { + [weakSelf onAddNetworkResponse:error isWiFi:YES]; + }]; } - (void)addThreadNetwork:(NSData *)threadDataSet @@ -548,9 +548,9 @@ - (void)addThreadNetwork:(NSData *)threadDataSet [_cluster addThreadNetwork:threadDataSet breadcrumb:breadcrumb timeoutMs:timeoutMs - completionHandler:^(NSError * error, NSDictionary * values) { - [weakSelf onAddNetworkResponse:error isWiFi:NO]; - }]; + responseHandler:^(NSError * error, NSDictionary * values) { + [weakSelf onAddNetworkResponse:error isWiFi:NO]; + }]; } - (void)onAddNetworkResponse:(NSError *)error isWiFi:(BOOL)isWiFi @@ -575,9 +575,9 @@ - (void)onAddNetworkResponse:(NSError *)error isWiFi:(BOOL)isWiFi [_cluster enableNetwork:networkId breadcrumb:breadcrumb timeoutMs:timeoutMs - completionHandler:^(NSError * err, NSDictionary * values) { - [weakSelf onEnableNetworkResponse:err]; - }]; + responseHandler:^(NSError * err, NSDictionary * values) { + [weakSelf onEnableNetworkResponse:err]; + }]; } - (void)onEnableNetworkResponse:(NSError *)error diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m index aec38cc68fa640..e051bcc35d37df 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m @@ -166,7 +166,7 @@ - (void)updateTempInUI:(int)newTemp - (void)readCurrentTemperature { - [self.cluster readAttributeMeasuredValue:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + [self.cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { if (error != nil) return; NSNumber * value = values[@"value"]; @@ -183,17 +183,17 @@ - (void)reportFromUserEnteredSettings NSLog(@"Sending temp reporting values: min %@ max %@ value %@", @(minIntervalSeconds), @(maxIntervalSeconds), @(deltaInFahrenheit)); - [self.cluster - configureAttributeMeasuredValue:minIntervalSeconds - maxInterval:maxIntervalSeconds - change:deltaInFahrenheit - completionHandler:^(NSError * error, NSDictionary * values) { - if (error == nil) - return; - NSLog(@"Status: update reportAttributeMeasuredValue completed with error %@", [error description]); - }]; - - [self.cluster reportAttributeMeasuredValue:^(NSError * error, NSDictionary * values) { + [self.cluster configureAttributeMeasuredValueWithMinInterval:minIntervalSeconds + maxInterval:maxIntervalSeconds + change:deltaInFahrenheit + responseHandler:^(NSError * error, NSDictionary * values) { + if (error == nil) + return; + NSLog(@"Status: update reportAttributeMeasuredValue completed with error %@", + [error description]); + }]; + + [self.cluster reportAttributeMeasuredValueWithResponseHandler:^(NSError * error, NSDictionary * values) { if (error != nil) return; NSNumber * value = values[@"value"]; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index a4519bdf6fb0c7..4c55adfab7e875 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -48,14 +48,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPApplicationBasic : CHIPCluster -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler; -- (void)readAttributeProductId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler; -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler; -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -65,14 +65,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBarrierControl : CHIPCluster -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler; -- (void)barrierControlStop:(ResponseHandler)completionHandler; +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler; +- (void)barrierControlStop:(ResponseHandler)responseHandler; -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -82,29 +82,29 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPBasic : CHIPCluster -- (void)mfgSpecificPing:(ResponseHandler)completionHandler; - -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler; -- (void)readAttributeVendorName:(ResponseHandler)completionHandler; -- (void)readAttributeVendorID:(ResponseHandler)completionHandler; -- (void)readAttributeProductName:(ResponseHandler)completionHandler; -- (void)readAttributeProductID:(ResponseHandler)completionHandler; -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler; -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeLocation:(ResponseHandler)completionHandler; -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler; -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler; -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler; -- (void)readAttributePartNumber:(ResponseHandler)completionHandler; -- (void)readAttributeProductURL:(ResponseHandler)completionHandler; -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler; -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler; -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler; -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)mfgSpecificPing:(ResponseHandler)responseHandler; + +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -115,17 +115,17 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPBinding : CHIPCluster - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler; + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -136,61 +136,61 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPColorControl : CHIPCluster - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveColorTemperature:(uint8_t)moveMode rate:(uint16_t)rate colorTemperatureMinimum:(uint16_t)colorTemperatureMinimum colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToHueAndSaturation:(uint8_t)hue saturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepColorTemperature:(uint8_t)stepMode stepSize:(uint16_t)stepSize transitionTime:(uint16_t)transitionTime @@ -198,112 +198,110 @@ NS_ASSUME_NONNULL_BEGIN colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepSaturation:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler; -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler; -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler; -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler; -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler; -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler; -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler; -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler; -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler; -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler; -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler; -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler; -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler; -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler; -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler; -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler; -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -313,11 +311,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDescriptor : CHIPCluster -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler; -- (void)readAttributeServerList:(ResponseHandler)completionHandler; -- (void)readAttributeClientList:(ResponseHandler)completionHandler; -- (void)readAttributePartsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -327,37 +325,37 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPDoorLock : CHIPCluster -- (void)clearAllPins:(ResponseHandler)completionHandler; -- (void)clearAllRfids:(ResponseHandler)completionHandler; -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler; -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler; -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler; -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; +- (void)clearAllPins:(ResponseHandler)responseHandler; +- (void)clearAllRfids:(ResponseHandler)responseHandler; +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler; +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler; +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler; +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler; - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler; -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler; + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler; +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler; - (void)setWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId daysMask:(uint8_t)daysMask @@ -365,23 +363,23 @@ NS_ASSUME_NONNULL_BEGIN startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler; -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeLockState:(ResponseHandler)completionHandler; -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLockState:(ResponseHandler)reportHandler; -- (void)readAttributeLockType:(ResponseHandler)completionHandler; -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -392,20 +390,20 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPGeneralCommissioning : CHIPCluster - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)commissioningComplete:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; +- (void)commissioningComplete:(ResponseHandler)responseHandler; - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricId:(ResponseHandler)completionHandler; -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler; -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -415,9 +413,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroupKeyManagement : CHIPCluster -- (void)readAttributeGroups:(ResponseHandler)completionHandler; -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -427,17 +425,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPGroups : CHIPCluster -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler; -- (void)addGroupIfIdentifying:(uint16_t)groupId - groupName:(NSString *)groupName - completionHandler:(ResponseHandler)completionHandler; -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllGroups:(ResponseHandler)completionHandler; -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler; +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllGroups:(ResponseHandler)responseHandler; +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -447,12 +443,12 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPIdentify : CHIPCluster -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler; -- (void)identifyQuery:(ResponseHandler)completionHandler; +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler; +- (void)identifyQuery:(ResponseHandler)responseHandler; -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler; -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -463,39 +459,39 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPLevelControl : CHIPCluster - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler; - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler; + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler; - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler; -- (void)stopWithOnOff:(ResponseHandler)completionHandler; - -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler; +- (void)stopWithOnOff:(ResponseHandler)responseHandler; + +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -505,9 +501,9 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPLowPower : CHIPCluster -- (void)sleep:(ResponseHandler)completionHandler; +- (void)sleep:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -520,40 +516,40 @@ NS_ASSUME_NONNULL_BEGIN - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler; - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler; - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -563,16 +559,16 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOnOff : CHIPCluster -- (void)off:(ResponseHandler)completionHandler; -- (void)on:(ResponseHandler)completionHandler; -- (void)toggle:(ResponseHandler)completionHandler; +- (void)off:(ResponseHandler)responseHandler; +- (void)on:(ResponseHandler)responseHandler; +- (void)toggle:(ResponseHandler)responseHandler; -- (void)readAttributeOnOff:(ResponseHandler)completionHandler; -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -582,15 +578,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)completionHandler; +- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler; -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler; + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler; +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -600,20 +596,20 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPPumpConfigurationAndControl : CHIPCluster -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler; -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler; -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler; -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler; -- (void)readAttributeCapacity:(ResponseHandler)completionHandler; -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler; -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler; -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -624,29 +620,29 @@ NS_ASSUME_NONNULL_BEGIN @interface CHIPScenes : CHIPCluster - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler; -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler; +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler; -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler; -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler; -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler; -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler; +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler; +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -656,14 +652,14 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPSwitch : CHIPCluster -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler; -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler; -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -673,15 +669,15 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTemperatureMeasurement : CHIPCluster -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler; -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler; -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -691,44 +687,44 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPTestCluster : CHIPCluster -- (void)test:(ResponseHandler)completionHandler; -- (void)testNotHandled:(ResponseHandler)completionHandler; -- (void)testSpecific:(ResponseHandler)completionHandler; - -- (void)readAttributeBoolean:(ResponseHandler)completionHandler; -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler; -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64u:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt8s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt16s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt32s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeInt64s:(ResponseHandler)completionHandler; -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum8:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeEnum16:(ResponseHandler)completionHandler; -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOctetString:(ResponseHandler)completionHandler; -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; +- (void)test:(ResponseHandler)responseHandler; +- (void)testNotHandled:(ResponseHandler)responseHandler; +- (void)testSpecific:(ResponseHandler)responseHandler; + +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end @@ -738,33 +734,31 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPThermostat : CHIPCluster -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler; -- (void)getRelayStatusLog:(ResponseHandler)completionHandler; -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler; +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler; +- (void)getRelayStatusLog:(ResponseHandler)responseHandler; +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler; - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler; -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler; - -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler; -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler; -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler; -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler; -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler; -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler; -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler; -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler; + responseHandler:(ResponseHandler)responseHandler; +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler; + +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler; +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler; +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler; +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler; @end diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index ea1b7c2606ec06..00c39d973adef4 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -2285,19 +2285,19 @@ @implementation CHIPApplicationBasic return &_cppCluster; } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2309,22 +2309,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorId:(ResponseHandler)completionHandler +- (void)readAttributeVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2336,23 +2336,23 @@ - (void)readAttributeVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationName:(ResponseHandler)completionHandler +- (void)readAttributeApplicationNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2364,22 +2364,22 @@ - (void)readAttributeApplicationName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductId:(ResponseHandler)completionHandler +- (void)readAttributeProductIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2391,23 +2391,23 @@ - (void)readAttributeProductId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationId:(ResponseHandler)completionHandler +- (void)readAttributeApplicationIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2419,22 +2419,22 @@ - (void)readAttributeApplicationId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler +- (void)readAttributeCatalogVendorIdWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2446,22 +2446,22 @@ - (void)readAttributeCatalogVendorId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler +- (void)readAttributeApplicationSatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2473,22 +2473,22 @@ - (void)readAttributeApplicationSatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2500,7 +2500,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -2517,18 +2517,18 @@ @implementation CHIPBarrierControl return &_cppCluster; } -- (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(ResponseHandler)completionHandler +- (void)barrierControlGoToPercent:(uint8_t)percentOpen responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2540,21 +2540,21 @@ - (void)barrierControlGoToPercent:(uint8_t)percentOpen completionHandler:(Respon if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)barrierControlStop:(ResponseHandler)completionHandler +- (void)barrierControlStop:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2566,22 +2566,22 @@ - (void)barrierControlStop:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler +- (void)readAttributeBarrierMovingStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2593,22 +2593,22 @@ - (void)readAttributeBarrierMovingState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler +- (void)readAttributeBarrierSafetyStatusWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2620,22 +2620,22 @@ - (void)readAttributeBarrierSafetyStatus:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeBarrierCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2647,22 +2647,22 @@ - (void)readAttributeBarrierCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler +- (void)readAttributeBarrierPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2674,22 +2674,22 @@ - (void)readAttributeBarrierPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2701,7 +2701,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -2718,18 +2718,18 @@ @implementation CHIPBasic return &_cppCluster; } -- (void)mfgSpecificPing:(ResponseHandler)completionHandler +- (void)mfgSpecificPing:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2741,22 +2741,22 @@ - (void)mfgSpecificPing:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler +- (void)readAttributeInteractionModelVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2768,23 +2768,23 @@ - (void)readAttributeInteractionModelVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorName:(ResponseHandler)completionHandler +- (void)readAttributeVendorNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2796,22 +2796,22 @@ - (void)readAttributeVendorName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeVendorID:(ResponseHandler)completionHandler +- (void)readAttributeVendorIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2823,23 +2823,23 @@ - (void)readAttributeVendorID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductName:(ResponseHandler)completionHandler +- (void)readAttributeProductNameWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2851,22 +2851,22 @@ - (void)readAttributeProductName:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductID:(ResponseHandler)completionHandler +- (void)readAttributeProductIDWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2878,23 +2878,23 @@ - (void)readAttributeProductID:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeUserLabel:(ResponseHandler)completionHandler +- (void)readAttributeUserLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2906,22 +2906,22 @@ - (void)readAttributeUserLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeUserLabelWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2935,23 +2935,23 @@ - (void)writeAttributeUserLabel:(NSString *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocation:(ResponseHandler)completionHandler +- (void)readAttributeLocationWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2963,22 +2963,22 @@ - (void)readAttributeLocation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocationWithValue:(NSString *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -2992,22 +2992,22 @@ - (void)writeAttributeLocation:(NSString *)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3019,23 +3019,23 @@ - (void)readAttributeHardwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeHardwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3047,22 +3047,22 @@ - (void)readAttributeHardwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3074,23 +3074,23 @@ - (void)readAttributeSoftwareVersion:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler +- (void)readAttributeSoftwareVersionStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3102,23 +3102,23 @@ - (void)readAttributeSoftwareVersionString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler +- (void)readAttributeManufacturingDateWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3130,23 +3130,23 @@ - (void)readAttributeManufacturingDate:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartNumber:(ResponseHandler)completionHandler +- (void)readAttributePartNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3158,23 +3158,23 @@ - (void)readAttributePartNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductURL:(ResponseHandler)completionHandler +- (void)readAttributeProductURLWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3186,23 +3186,23 @@ - (void)readAttributeProductURL:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeProductLabel:(ResponseHandler)completionHandler +- (void)readAttributeProductLabelWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3214,23 +3214,23 @@ - (void)readAttributeProductLabel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSerialNumber:(ResponseHandler)completionHandler +- (void)readAttributeSerialNumberWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3242,23 +3242,22 @@ - (void)readAttributeSerialNumber:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler +- (void)readAttributeLocalConfigDisabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3270,22 +3269,22 @@ - (void)readAttributeLocalConfigDisabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeLocalConfigDisabledWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3297,22 +3296,22 @@ - (void)writeAttributeLocalConfigDisabled:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3324,7 +3323,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3342,21 +3341,21 @@ @implementation CHIPBinding } - (void)bind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3368,25 +3367,25 @@ - (void)bind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)unbind:(uint64_t)nodeId - groupId:(uint16_t)groupId - endpointId:(uint8_t)endpointId - clusterId:(uint16_t)clusterId - completionHandler:(ResponseHandler)completionHandler + groupId:(uint16_t)groupId + endpointId:(uint8_t)endpointId + clusterId:(uint16_t)clusterId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3398,22 +3397,22 @@ - (void)unbind:(uint64_t)nodeId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3425,7 +3424,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -3443,21 +3442,21 @@ @implementation CHIPColorControl } - (void)moveColor:(int16_t)rateX - rateY:(int16_t)rateY - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rateY:(int16_t)rateY + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3469,7 +3468,7 @@ - (void)moveColor:(int16_t)rateX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveColorTemperature:(uint8_t)moveMode @@ -3478,18 +3477,18 @@ - (void)moveColorTemperature:(uint8_t)moveMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3502,25 +3501,25 @@ - (void)moveColorTemperature:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveHue:(uint8_t)moveMode - rate:(uint8_t)rate - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3532,25 +3531,25 @@ - (void)moveHue:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveSaturation:(uint8_t)moveMode rate:(uint8_t)rate optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3563,26 +3562,26 @@ - (void)moveSaturation:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColor:(uint16_t)colorX - colorY:(uint16_t)colorY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + colorY:(uint16_t)colorY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3595,25 +3594,25 @@ - (void)moveToColor:(uint16_t)colorX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToColorTemperature:(uint16_t)colorTemperature transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3626,26 +3625,26 @@ - (void)moveToColorTemperature:(uint16_t)colorTemperature if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHue:(uint8_t)hue - direction:(uint8_t)direction - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + direction:(uint8_t)direction + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3658,7 +3657,7 @@ - (void)moveToHue:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToHueAndSaturation:(uint8_t)hue @@ -3666,18 +3665,18 @@ - (void)moveToHueAndSaturation:(uint8_t)hue transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3690,25 +3689,25 @@ - (void)moveToHueAndSaturation:(uint8_t)hue if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToSaturation:(uint8_t)saturation transitionTime:(uint16_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3721,26 +3720,26 @@ - (void)moveToSaturation:(uint8_t)saturation if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColor:(int16_t)stepX - stepY:(int16_t)stepY - transitionTime:(uint16_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepY:(int16_t)stepY + transitionTime:(uint16_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3753,7 +3752,7 @@ - (void)stepColor:(int16_t)stepX if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepColorTemperature:(uint8_t)stepMode @@ -3763,18 +3762,18 @@ - (void)stepColorTemperature:(uint8_t)stepMode colorTemperatureMaximum:(uint16_t)colorTemperatureMaximum optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3787,26 +3786,26 @@ - (void)stepColorTemperature:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepHue:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint8_t)transitionTime - optionsMask:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint8_t)transitionTime + optionsMask:(uint8_t)optionsMask + optionsOverride:(uint8_t)optionsOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3819,7 +3818,7 @@ - (void)stepHue:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepSaturation:(uint8_t)stepMode @@ -3827,18 +3826,18 @@ - (void)stepSaturation:(uint8_t)stepMode transitionTime:(uint8_t)transitionTime optionsMask:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3851,23 +3850,21 @@ - (void)stepSaturation:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopMoveStep:(uint8_t)optionsMask - optionsOverride:(uint8_t)optionsOverride - completionHandler:(ResponseHandler)completionHandler +- (void)stopMoveStep:(uint8_t)optionsMask optionsOverride:(uint8_t)optionsOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3879,22 +3876,22 @@ - (void)stopMoveStep:(uint8_t)optionsMask if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3906,25 +3903,25 @@ - (void)readAttributeCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentHue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentHueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3937,11 +3934,11 @@ - (void)configureAttributeCurrentHue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentHueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -3960,18 +3957,18 @@ - (void)reportAttributeCurrentHue:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -3983,25 +3980,25 @@ - (void)readAttributeCurrentSaturation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentSaturation:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentSaturationWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4014,11 +4011,11 @@ - (void)configureAttributeCurrentSaturation:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentSaturationWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4037,18 +4034,18 @@ - (void)reportAttributeCurrentSaturation:(ResponseHandler)reportHandler } } -- (void)readAttributeRemainingTime:(ResponseHandler)completionHandler +- (void)readAttributeRemainingTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4060,22 +4057,22 @@ - (void)readAttributeRemainingTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentX:(ResponseHandler)completionHandler +- (void)readAttributeCurrentXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4087,25 +4084,25 @@ - (void)readAttributeCurrentX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentX:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentXWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4118,11 +4115,11 @@ - (void)configureAttributeCurrentX:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentX:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentXWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4141,18 +4138,18 @@ - (void)reportAttributeCurrentX:(ResponseHandler)reportHandler } } -- (void)readAttributeCurrentY:(ResponseHandler)completionHandler +- (void)readAttributeCurrentYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4164,25 +4161,25 @@ - (void)readAttributeCurrentY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentY:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentYWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4195,11 +4192,11 @@ - (void)configureAttributeCurrentY:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentY:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentYWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4218,18 +4215,18 @@ - (void)reportAttributeCurrentY:(ResponseHandler)reportHandler } } -- (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler +- (void)readAttributeDriftCompensationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4241,23 +4238,23 @@ - (void)readAttributeDriftCompensation:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCompensationText:(ResponseHandler)completionHandler +- (void)readAttributeCompensationTextWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], false); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], false); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4269,22 +4266,22 @@ - (void)readAttributeCompensationText:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTemperature:(ResponseHandler)completionHandler +- (void)readAttributeColorTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4296,25 +4293,25 @@ - (void)readAttributeColorTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeColorTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeColorTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4327,11 +4324,11 @@ - (void)configureAttributeColorTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeColorTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16uAttributeCallbackBridge * onReport = new CHIPInt16uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -4350,18 +4347,18 @@ - (void)reportAttributeColorTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeColorMode:(ResponseHandler)completionHandler +- (void)readAttributeColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4373,22 +4370,22 @@ - (void)readAttributeColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler +- (void)readAttributeColorControlOptionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4400,22 +4397,22 @@ - (void)readAttributeColorControlOptions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorControlOptionsWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4427,22 +4424,22 @@ - (void)writeAttributeColorControlOptions:(uint8_t)value completionHandler:(Resp if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPrimariesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4454,22 +4451,22 @@ - (void)readAttributeNumberOfPrimaries:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1X:(ResponseHandler)completionHandler +- (void)readAttributePrimary1XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4481,22 +4478,22 @@ - (void)readAttributePrimary1X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary1YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4508,22 +4505,22 @@ - (void)readAttributePrimary1Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary1IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4535,22 +4532,22 @@ - (void)readAttributePrimary1Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2X:(ResponseHandler)completionHandler +- (void)readAttributePrimary2XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4562,22 +4559,22 @@ - (void)readAttributePrimary2X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary2YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4589,22 +4586,22 @@ - (void)readAttributePrimary2Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary2IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4616,22 +4613,22 @@ - (void)readAttributePrimary2Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3X:(ResponseHandler)completionHandler +- (void)readAttributePrimary3XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4643,22 +4640,22 @@ - (void)readAttributePrimary3X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary3YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4670,22 +4667,22 @@ - (void)readAttributePrimary3Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary3IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4697,22 +4694,22 @@ - (void)readAttributePrimary3Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4X:(ResponseHandler)completionHandler +- (void)readAttributePrimary4XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4724,22 +4721,22 @@ - (void)readAttributePrimary4X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary4YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4751,22 +4748,22 @@ - (void)readAttributePrimary4Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary4IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4778,22 +4775,22 @@ - (void)readAttributePrimary4Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5X:(ResponseHandler)completionHandler +- (void)readAttributePrimary5XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4805,22 +4802,22 @@ - (void)readAttributePrimary5X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary5YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4832,22 +4829,22 @@ - (void)readAttributePrimary5Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary5IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4859,22 +4856,22 @@ - (void)readAttributePrimary5Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6X:(ResponseHandler)completionHandler +- (void)readAttributePrimary6XWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4886,22 +4883,22 @@ - (void)readAttributePrimary6X:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Y:(ResponseHandler)completionHandler +- (void)readAttributePrimary6YWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4913,22 +4910,22 @@ - (void)readAttributePrimary6Y:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler +- (void)readAttributePrimary6IntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4940,22 +4937,22 @@ - (void)readAttributePrimary6Intensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointX:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4967,22 +4964,22 @@ - (void)readAttributeWhitePointX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -4994,22 +4991,22 @@ - (void)writeAttributeWhitePointX:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeWhitePointY:(ResponseHandler)completionHandler +- (void)readAttributeWhitePointYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5021,22 +5018,22 @@ - (void)readAttributeWhitePointY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeWhitePointYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5048,22 +5045,22 @@ - (void)writeAttributeWhitePointY:(uint16_t)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5075,22 +5072,22 @@ - (void)readAttributeColorPointRX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5102,22 +5099,22 @@ - (void)writeAttributeColorPointRX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5129,22 +5126,22 @@ - (void)readAttributeColorPointRY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5156,22 +5153,22 @@ - (void)writeAttributeColorPointRY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointRIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5183,22 +5180,22 @@ - (void)readAttributeColorPointRIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointRIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5210,22 +5207,22 @@ - (void)writeAttributeColorPointRIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5237,22 +5234,22 @@ - (void)readAttributeColorPointGX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5264,22 +5261,22 @@ - (void)writeAttributeColorPointGX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5291,22 +5288,22 @@ - (void)readAttributeColorPointGY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5318,22 +5315,22 @@ - (void)writeAttributeColorPointGY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointGIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5345,22 +5342,22 @@ - (void)readAttributeColorPointGIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointGIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5372,22 +5369,22 @@ - (void)writeAttributeColorPointGIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBX:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBXWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5399,22 +5396,22 @@ - (void)readAttributeColorPointBX:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBXWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5426,22 +5423,22 @@ - (void)writeAttributeColorPointBX:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBY:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBYWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5453,22 +5450,22 @@ - (void)readAttributeColorPointBY:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBYWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5480,22 +5477,22 @@ - (void)writeAttributeColorPointBY:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler +- (void)readAttributeColorPointBIntensityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5507,22 +5504,22 @@ - (void)readAttributeColorPointBIntensity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeColorPointBIntensityWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5534,22 +5531,22 @@ - (void)writeAttributeColorPointBIntensity:(uint8_t)value completionHandler:(Res if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedCurrentHueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5561,22 +5558,22 @@ - (void)readAttributeEnhancedCurrentHue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler +- (void)readAttributeEnhancedColorModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5588,22 +5585,22 @@ - (void)readAttributeEnhancedColorMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopActiveWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5615,22 +5612,22 @@ - (void)readAttributeColorLoopActive:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopDirectionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5642,22 +5639,22 @@ - (void)readAttributeColorLoopDirection:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler +- (void)readAttributeColorLoopTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5669,22 +5666,22 @@ - (void)readAttributeColorLoopTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler +- (void)readAttributeColorCapabilitiesWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5696,22 +5693,22 @@ - (void)readAttributeColorCapabilities:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMinWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5723,22 +5720,22 @@ - (void)readAttributeColorTempPhysicalMin:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler +- (void)readAttributeColorTempPhysicalMaxWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5750,22 +5747,22 @@ - (void)readAttributeColorTempPhysicalMax:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completionHandler +- (void)readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5777,22 +5774,22 @@ - (void)readAttributeCoupleColorTempToLevelMinMireds:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHandler +- (void)readAttributeStartUpColorTemperatureMiredsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5804,22 +5801,22 @@ - (void)readAttributeStartUpColorTemperatureMireds:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeStartUpColorTemperatureMiredsWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5831,22 +5828,22 @@ - (void)writeAttributeStartUpColorTemperatureMireds:(uint16_t)value completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5858,7 +5855,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -5875,19 +5872,19 @@ @implementation CHIPDescriptor return &_cppCluster; } -- (void)readAttributeDeviceList:(ResponseHandler)completionHandler +- (void)readAttributeDeviceListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorDeviceListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorDeviceListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorDeviceListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5899,23 +5896,23 @@ - (void)readAttributeDeviceList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeServerList:(ResponseHandler)completionHandler +- (void)readAttributeServerListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorServerListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorServerListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorServerListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5927,23 +5924,23 @@ - (void)readAttributeServerList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClientList:(ResponseHandler)completionHandler +- (void)readAttributeClientListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorClientListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorClientListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorClientListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5955,23 +5952,23 @@ - (void)readAttributeClientList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributePartsList:(ResponseHandler)completionHandler +- (void)readAttributePartsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPDescriptorPartsListAttributeCallbackBridge * onSuccess - = new CHIPDescriptorPartsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDescriptorPartsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -5983,22 +5980,22 @@ - (void)readAttributePartsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6010,7 +6007,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -6027,19 +6024,19 @@ @implementation CHIPDoorLock return &_cppCluster; } -- (void)clearAllPins:(ResponseHandler)completionHandler +- (void)clearAllPins:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllPinsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllPinsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6051,22 +6048,22 @@ - (void)clearAllPins:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearAllRfids:(ResponseHandler)completionHandler +- (void)clearAllRfids:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearAllRfidsResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6078,22 +6075,22 @@ - (void)clearAllRfids:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)clearHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6105,22 +6102,22 @@ - (void)clearHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6132,22 +6129,22 @@ - (void)clearPin:(uint16_t)userId completionHandler:(ResponseHandler)completionH if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6159,22 +6156,22 @@ - (void)clearRfid:(uint16_t)userId completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6186,22 +6183,22 @@ - (void)clearWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterClearYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6213,22 +6210,22 @@ - (void)clearYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandler)completionHandler +- (void)getHolidaySchedule:(uint8_t)scheduleId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6240,22 +6237,22 @@ - (void)getHolidaySchedule:(uint8_t)scheduleId completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)completionHandler +- (void)getLogRecord:(uint16_t)logIndex responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetLogRecordResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetLogRecordResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6267,22 +6264,22 @@ - (void)getLogRecord:(uint16_t)logIndex completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getPin:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6294,22 +6291,22 @@ - (void)getPin:(uint16_t)userId completionHandler:(ResponseHandler)completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getRfid:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6321,22 +6318,22 @@ - (void)getRfid:(uint16_t)userId completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getUserType:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6348,22 +6345,22 @@ - (void)getUserType:(uint16_t)userId completionHandler:(ResponseHandler)completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6375,22 +6372,22 @@ - (void)getWeekdaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completionHandler:(ResponseHandler)completionHandler +- (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterGetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6402,22 +6399,22 @@ - (void)getYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)lockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterLockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterLockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6431,26 +6428,26 @@ - (void)lockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setHolidaySchedule:(uint8_t)scheduleId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime operatingModeDuringHoliday:(uint8_t)operatingModeDuringHoliday - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetHolidayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6463,26 +6460,26 @@ - (void)setHolidaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setPin:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - pin:(NSString *)pin - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + pin:(NSString *)pin + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetPinResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetPinResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetPinResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6496,26 +6493,26 @@ - (void)setPin:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRfid:(uint16_t)userId - userStatus:(uint8_t)userStatus - userType:(uint8_t)userType - id:(NSString *)id - completionHandler:(ResponseHandler)completionHandler + userStatus:(uint8_t)userStatus + userType:(uint8_t)userType + id:(NSString *)id + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetRfidResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetRfidResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6529,22 +6526,22 @@ - (void)setRfid:(uint16_t)userId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandler:(ResponseHandler)completionHandler +- (void)setUserType:(uint16_t)userId userType:(uint8_t)userType responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetUserTypeResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetUserTypeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6556,7 +6553,7 @@ - (void)setUserType:(uint16_t)userId userType:(uint8_t)userType completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeekdaySchedule:(uint8_t)scheduleId @@ -6566,19 +6563,19 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId startMinute:(uint8_t)startMinute endHour:(uint8_t)endHour endMinute:(uint8_t)endMinute - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetWeekdayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6591,26 +6588,26 @@ - (void)setWeekdaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setYeardaySchedule:(uint8_t)scheduleId userId:(uint16_t)userId localStartTime:(uint32_t)localStartTime localEndTime:(uint32_t)localEndTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterSetYeardayScheduleResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6623,22 +6620,22 @@ - (void)setYeardaySchedule:(uint8_t)scheduleId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockDoor:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockDoorResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockDoorResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6652,22 +6649,22 @@ - (void)unlockDoor:(NSString *)pin completionHandler:(ResponseHandler)completion if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin completionHandler:(ResponseHandler)completionHandler +- (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin responseHandler:(ResponseHandler)responseHandler { CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge * onSuccess - = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPDoorLockClusterUnlockWithTimeoutResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6681,22 +6678,22 @@ - (void)unlockWithTimeout:(uint16_t)timeoutInSeconds pin:(NSString *)pin complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLockState:(ResponseHandler)completionHandler +- (void)readAttributeLockStateWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6708,24 +6705,24 @@ - (void)readAttributeLockState:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLockState:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLockStateWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6737,11 +6734,11 @@ - (void)configureAttributeLockState:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLockState:(ResponseHandler)reportHandler +- (void)reportAttributeLockStateWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -6760,18 +6757,18 @@ - (void)reportAttributeLockState:(ResponseHandler)reportHandler } } -- (void)readAttributeLockType:(ResponseHandler)completionHandler +- (void)readAttributeLockTypeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6783,23 +6780,22 @@ - (void)readAttributeLockType:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler +- (void)readAttributeActuatorEnabledWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6811,22 +6807,22 @@ - (void)readAttributeActuatorEnabled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6838,7 +6834,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -6856,21 +6852,21 @@ @implementation CHIPGeneralCommissioning } - (void)armFailSafe:(uint16_t)expiryLengthSeconds - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterArmFailSafeResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6882,22 +6878,22 @@ - (void)armFailSafe:(uint16_t)expiryLengthSeconds if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)commissioningComplete:(ResponseHandler)completionHandler +- (void)commissioningComplete:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterCommissioningCompleteResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6909,26 +6905,26 @@ - (void)commissioningComplete:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setRegulatoryConfig:(uint8_t)location countryCode:(NSString *)countryCode breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge * onSuccess - = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGeneralCommissioningClusterSetRegulatoryConfigResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6943,23 +6939,23 @@ - (void)setRegulatoryConfig:(uint8_t)location if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricId:(ResponseHandler)completionHandler +- (void)readAttributeFabricIdWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6971,22 +6967,22 @@ - (void)readAttributeFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler +- (void)readAttributeBreadcrumbWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -6998,22 +6994,22 @@ - (void)readAttributeBreadcrumb:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBreadcrumbWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7025,22 +7021,22 @@ - (void)writeAttributeBreadcrumb:(uint64_t)value completionHandler:(ResponseHand if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7052,7 +7048,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7069,19 +7065,19 @@ @implementation CHIPGroupKeyManagement return &_cppCluster; } -- (void)readAttributeGroups:(ResponseHandler)completionHandler +- (void)readAttributeGroupsWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupsAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupsAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7093,23 +7089,23 @@ - (void)readAttributeGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeGroupKeys:(ResponseHandler)completionHandler +- (void)readAttributeGroupKeysWithResponseHandler:(ResponseHandler)responseHandler { CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge * onSuccess - = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupKeyManagementGroupKeysAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7121,22 +7117,22 @@ - (void)readAttributeGroupKeys:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7148,7 +7144,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7165,19 +7161,19 @@ @implementation CHIPGroups return &_cppCluster; } -- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterAddGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterAddGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterAddGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7191,21 +7187,21 @@ - (void)addGroup:(uint16_t)groupId groupName:(NSString *)groupName completionHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName completionHandler:(ResponseHandler)completionHandler +- (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7219,22 +7215,22 @@ - (void)addGroupIfIdentifying:(uint16_t)groupId groupName:(NSString *)groupName if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList completionHandler:(ResponseHandler)completionHandler +- (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterGetGroupMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7246,21 +7242,21 @@ - (void)getGroupMembership:(uint8_t)groupCount groupList:(uint16_t)groupList com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllGroups:(ResponseHandler)completionHandler +- (void)removeAllGroups:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7272,22 +7268,22 @@ - (void)removeAllGroups:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterRemoveGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterRemoveGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7299,22 +7295,22 @@ - (void)removeGroup:(uint16_t)groupId completionHandler:(ResponseHandler)complet if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)viewGroup:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPGroupsClusterViewGroupResponseCallbackBridge * onSuccess - = new CHIPGroupsClusterViewGroupResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPGroupsClusterViewGroupResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7326,22 +7322,22 @@ - (void)viewGroup:(uint16_t)groupId completionHandler:(ResponseHandler)completio if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7353,22 +7349,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7380,7 +7376,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7397,18 +7393,18 @@ @implementation CHIPIdentify return &_cppCluster; } -- (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)completionHandler +- (void)identify:(uint16_t)identifyTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7420,22 +7416,22 @@ - (void)identify:(uint16_t)identifyTime completionHandler:(ResponseHandler)compl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)identifyQuery:(ResponseHandler)completionHandler +- (void)identifyQuery:(ResponseHandler)responseHandler { CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge * onSuccess - = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPIdentifyClusterIdentifyQueryResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7447,22 +7443,22 @@ - (void)identifyQuery:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler +- (void)readAttributeIdentifyTimeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7474,22 +7470,22 @@ - (void)readAttributeIdentifyTime:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeIdentifyTimeWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7501,22 +7497,22 @@ - (void)writeAttributeIdentifyTime:(uint16_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7528,7 +7524,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7546,21 +7542,21 @@ @implementation CHIPLevelControl } - (void)move:(uint8_t)moveMode - rate:(uint8_t)rate - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + rate:(uint8_t)rate + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7572,25 +7568,25 @@ - (void)move:(uint8_t)moveMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)moveToLevel:(uint8_t)level - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7603,23 +7599,21 @@ - (void)moveToLevel:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveToLevelWithOnOff:(uint8_t)level - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler +- (void)moveToLevelWithOnOff:(uint8_t)level transitionTime:(uint16_t)transitionTime responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7631,21 +7625,21 @@ - (void)moveToLevelWithOnOff:(uint8_t)level if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(ResponseHandler)completionHandler +- (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7657,26 +7651,26 @@ - (void)moveWithOnOff:(uint8_t)moveMode rate:(uint8_t)rate completionHandler:(Re if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)step:(uint8_t)stepMode - stepSize:(uint8_t)stepSize - transitionTime:(uint16_t)transitionTime - optionMask:(uint8_t)optionMask - optionOverride:(uint8_t)optionOverride - completionHandler:(ResponseHandler)completionHandler + stepSize:(uint8_t)stepSize + transitionTime:(uint16_t)transitionTime + optionMask:(uint8_t)optionMask + optionOverride:(uint8_t)optionOverride + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7689,24 +7683,24 @@ - (void)step:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)stepWithOnOff:(uint8_t)stepMode stepSize:(uint8_t)stepSize transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7718,21 +7712,21 @@ - (void)stepWithOnOff:(uint8_t)stepMode if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completionHandler:(ResponseHandler)completionHandler +- (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7744,21 +7738,21 @@ - (void)stop:(uint8_t)optionMask optionOverride:(uint8_t)optionOverride completi if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)stopWithOnOff:(ResponseHandler)completionHandler +- (void)stopWithOnOff:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7770,22 +7764,22 @@ - (void)stopWithOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler +- (void)readAttributeCurrentLevelWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7797,25 +7791,25 @@ - (void)readAttributeCurrentLevel:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentLevel:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentLevelWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7828,11 +7822,11 @@ - (void)configureAttributeCurrentLevel:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentLevelWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -7851,18 +7845,18 @@ - (void)reportAttributeCurrentLevel:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7874,7 +7868,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7891,18 +7885,18 @@ @implementation CHIPLowPower return &_cppCluster; } -- (void)sleep:(ResponseHandler)completionHandler +- (void)sleep:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7914,22 +7908,22 @@ - (void)sleep:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7941,7 +7935,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -7961,19 +7955,19 @@ @implementation CHIPNetworkCommissioning - (void)addThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -7986,26 +7980,26 @@ - (void)addThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)addWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterAddWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8019,25 +8013,25 @@ - (void)addWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)disableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterDisableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8050,25 +8044,25 @@ - (void)disableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)enableNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterEnableNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8081,21 +8075,21 @@ - (void)enableNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler:(ResponseHandler)completionHandler +- (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8107,25 +8101,25 @@ - (void)getLastNetworkCommissioningResult:(uint32_t)timeoutMs completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeNetwork:(NSData *)networkID breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterRemoveNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8138,25 +8132,25 @@ - (void)removeNetwork:(NSData *)networkID if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)scanNetworks:(NSData *)ssid - breadcrumb:(uint64_t)breadcrumb - timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + breadcrumb:(uint64_t)breadcrumb + timeoutMs:(uint32_t)timeoutMs + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterScanNetworksResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8169,25 +8163,25 @@ - (void)scanNetworks:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateThreadNetwork:(NSData *)operationalDataset breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateThreadNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8200,26 +8194,26 @@ - (void)updateThreadNetwork:(NSData *)operationalDataset if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)updateWiFiNetwork:(NSData *)ssid credentials:(NSData *)credentials breadcrumb:(uint64_t)breadcrumb timeoutMs:(uint32_t)timeoutMs - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge * onSuccess - = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPNetworkCommissioningClusterUpdateWiFiNetworkResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8233,22 +8227,22 @@ - (void)updateWiFiNetwork:(NSData *)ssid if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8260,7 +8254,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8277,18 +8271,18 @@ @implementation CHIPOnOff return &_cppCluster; } -- (void)off:(ResponseHandler)completionHandler +- (void)off:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8300,21 +8294,21 @@ - (void)off:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)on:(ResponseHandler)completionHandler +- (void)on:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8326,21 +8320,21 @@ - (void)on:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)toggle:(ResponseHandler)completionHandler +- (void)toggle:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8352,23 +8346,22 @@ - (void)toggle:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOnOff:(ResponseHandler)completionHandler +- (void)readAttributeOnOffWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8380,24 +8373,24 @@ - (void)readAttributeOnOff:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeOnOff:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeOnOffWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8409,11 +8402,11 @@ - (void)configureAttributeOnOff:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeOnOff:(ResponseHandler)reportHandler +- (void)reportAttributeOnOffWithResponseHandler:(ResponseHandler)reportHandler { CHIPBooleanAttributeCallbackBridge * onReport = new CHIPBooleanAttributeCallbackBridge(reportHandler, [self callbackQueue], true); @@ -8433,18 +8426,18 @@ - (void)reportAttributeOnOff:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8456,7 +8449,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8473,19 +8466,19 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)completionHandler +- (void)getFabricId:(ResponseHandler)responseHandler { CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8497,24 +8490,24 @@ - (void)getFabricId:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - completionHandler:(ResponseHandler)completionHandler + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8526,21 +8519,21 @@ - (void)removeFabric:(uint64_t)fabricId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)completionHandler +- (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8554,23 +8547,23 @@ - (void)updateFabricLabel:(NSString *)label completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeFabricsList:(ResponseHandler)completionHandler +- (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler { CHIPOperationalCredentialsFabricsListAttributeCallbackBridge * onSuccess - = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPOperationalCredentialsFabricsListAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8582,22 +8575,22 @@ - (void)readAttributeFabricsList:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8609,7 +8602,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8626,18 +8619,18 @@ @implementation CHIPPumpConfigurationAndControl return &_cppCluster; } -- (void)readAttributeMaxPressure:(ResponseHandler)completionHandler +- (void)readAttributeMaxPressureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8649,22 +8642,22 @@ - (void)readAttributeMaxPressure:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler +- (void)readAttributeMaxSpeedWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8676,22 +8669,22 @@ - (void)readAttributeMaxSpeed:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxFlow:(ResponseHandler)completionHandler +- (void)readAttributeMaxFlowWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8703,22 +8696,22 @@ - (void)readAttributeMaxFlow:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8730,22 +8723,22 @@ - (void)readAttributeEffectiveOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler +- (void)readAttributeEffectiveControlModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8757,22 +8750,22 @@ - (void)readAttributeEffectiveControlMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCapacity:(ResponseHandler)completionHandler +- (void)readAttributeCapacityWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8784,25 +8777,25 @@ - (void)readAttributeCapacity:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCapacity:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCapacityWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8815,11 +8808,11 @@ - (void)configureAttributeCapacity:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCapacity:(ResponseHandler)reportHandler +- (void)reportAttributeCapacityWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -8838,18 +8831,18 @@ - (void)reportAttributeCapacity:(ResponseHandler)reportHandler } } -- (void)readAttributeOperationMode:(ResponseHandler)completionHandler +- (void)readAttributeOperationModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8861,22 +8854,22 @@ - (void)readAttributeOperationMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOperationModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8888,22 +8881,22 @@ - (void)writeAttributeOperationMode:(uint8_t)value completionHandler:(ResponseHa if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8915,7 +8908,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -8933,25 +8926,25 @@ @implementation CHIPScenes } - (void)addScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - sceneName:(NSString *)sceneName - clusterId:(uint16_t)clusterId - length:(uint8_t)length - value:(uint8_t)value - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + sceneName:(NSString *)sceneName + clusterId:(uint16_t)clusterId + length:(uint8_t)length + value:(uint8_t)value + responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterAddSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterAddSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterAddSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8966,22 +8959,22 @@ - (void)addScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)getSceneMembership:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterGetSceneMembershipResponseCallbackBridge * onSuccess - = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterGetSceneMembershipResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -8993,24 +8986,24 @@ - (void)getSceneMembership:(uint16_t)groupId completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)recallScene:(uint16_t)groupId - sceneId:(uint8_t)sceneId - transitionTime:(uint16_t)transitionTime - completionHandler:(ResponseHandler)completionHandler + sceneId:(uint8_t)sceneId + transitionTime:(uint16_t)transitionTime + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9022,22 +9015,22 @@ - (void)recallScene:(uint16_t)groupId if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)completionHandler +- (void)removeAllScenes:(uint16_t)groupId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveAllScenesResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveAllScenesResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9049,22 +9042,22 @@ - (void)removeAllScenes:(uint16_t)groupId completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterRemoveSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterRemoveSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9076,22 +9069,22 @@ - (void)removeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterStoreSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterStoreSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterStoreSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9103,22 +9096,22 @@ - (void)storeScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler: if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:(ResponseHandler)completionHandler +- (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId responseHandler:(ResponseHandler)responseHandler { CHIPScenesClusterViewSceneResponseCallbackBridge * onSuccess - = new CHIPScenesClusterViewSceneResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPScenesClusterViewSceneResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9130,22 +9123,22 @@ - (void)viewScene:(uint16_t)groupId sceneId:(uint8_t)sceneId completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneCount:(ResponseHandler)completionHandler +- (void)readAttributeSceneCountWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9157,22 +9150,22 @@ - (void)readAttributeSceneCount:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentScene:(ResponseHandler)completionHandler +- (void)readAttributeCurrentSceneWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9184,22 +9177,22 @@ - (void)readAttributeCurrentScene:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler +- (void)readAttributeCurrentGroupWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9211,23 +9204,22 @@ - (void)readAttributeCurrentGroup:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSceneValid:(ResponseHandler)completionHandler +- (void)readAttributeSceneValidWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9239,22 +9231,22 @@ - (void)readAttributeSceneValid:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeNameSupport:(ResponseHandler)completionHandler +- (void)readAttributeNameSupportWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9266,22 +9258,22 @@ - (void)readAttributeNameSupport:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9293,7 +9285,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9310,18 +9302,18 @@ @implementation CHIPSwitch return &_cppCluster; } -- (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler +- (void)readAttributeNumberOfPositionsWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9333,22 +9325,22 @@ - (void)readAttributeNumberOfPositions:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler +- (void)readAttributeCurrentPositionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9360,25 +9352,25 @@ - (void)readAttributeCurrentPosition:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeCurrentPosition:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(uint8_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeCurrentPositionWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(uint8_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9391,11 +9383,11 @@ - (void)configureAttributeCurrentPosition:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler +- (void)reportAttributeCurrentPositionWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt8uAttributeCallbackBridge * onReport = new CHIPInt8uAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -9414,18 +9406,18 @@ - (void)reportAttributeCurrentPosition:(ResponseHandler)reportHandler } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9437,7 +9429,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9454,18 +9446,18 @@ @implementation CHIPTemperatureMeasurement return &_cppCluster; } -- (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9477,25 +9469,25 @@ - (void)readAttributeMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeMeasuredValue:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeMeasuredValueWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9508,11 +9500,11 @@ - (void)configureAttributeMeasuredValue:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler +- (void)reportAttributeMeasuredValueWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -9531,18 +9523,18 @@ - (void)reportAttributeMeasuredValue:(ResponseHandler)reportHandler } } -- (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMinMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9554,22 +9546,22 @@ - (void)readAttributeMinMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler +- (void)readAttributeMaxMeasuredValueWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9581,22 +9573,22 @@ - (void)readAttributeMaxMeasuredValue:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9608,7 +9600,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -9625,18 +9617,18 @@ @implementation CHIPTestCluster return &_cppCluster; } -- (void)test:(ResponseHandler)completionHandler +- (void)test:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9648,21 +9640,21 @@ - (void)test:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testNotHandled:(ResponseHandler)completionHandler +- (void)testNotHandled:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9674,22 +9666,22 @@ - (void)testNotHandled:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)testSpecific:(ResponseHandler)completionHandler +- (void)testSpecific:(ResponseHandler)responseHandler { CHIPTestClusterClusterTestSpecificResponseCallbackBridge * onSuccess - = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterClusterTestSpecificResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9701,23 +9693,22 @@ - (void)testSpecific:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBoolean:(ResponseHandler)completionHandler +- (void)readAttributeBooleanWithResponseHandler:(ResponseHandler)responseHandler { - CHIPBooleanAttributeCallbackBridge * onSuccess - = new CHIPBooleanAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPBooleanAttributeCallbackBridge * onSuccess = new CHIPBooleanAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9729,22 +9720,22 @@ - (void)readAttributeBoolean:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBooleanWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9756,22 +9747,22 @@ - (void)writeAttributeBoolean:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap8:(ResponseHandler)completionHandler +- (void)readAttributeBitmap8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9783,22 +9774,22 @@ - (void)readAttributeBitmap8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9810,22 +9801,22 @@ - (void)writeAttributeBitmap8:(uint8_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap16:(ResponseHandler)completionHandler +- (void)readAttributeBitmap16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9837,22 +9828,22 @@ - (void)readAttributeBitmap16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9864,22 +9855,22 @@ - (void)writeAttributeBitmap16:(uint16_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap32:(ResponseHandler)completionHandler +- (void)readAttributeBitmap32WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9891,22 +9882,22 @@ - (void)readAttributeBitmap32:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap32WithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9918,22 +9909,22 @@ - (void)writeAttributeBitmap32:(uint32_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeBitmap64:(ResponseHandler)completionHandler +- (void)readAttributeBitmap64WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9945,22 +9936,22 @@ - (void)readAttributeBitmap64:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeBitmap64WithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9972,22 +9963,22 @@ - (void)writeAttributeBitmap64:(uint64_t)value completionHandler:(ResponseHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8u:(ResponseHandler)completionHandler +- (void)readAttributeInt8uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -9999,22 +9990,22 @@ - (void)readAttributeInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8uWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10026,22 +10017,22 @@ - (void)writeAttributeInt8u:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16u:(ResponseHandler)completionHandler +- (void)readAttributeInt16uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10053,22 +10044,22 @@ - (void)readAttributeInt16u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16uWithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10080,22 +10071,22 @@ - (void)writeAttributeInt16u:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32u:(ResponseHandler)completionHandler +- (void)readAttributeInt32uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32uAttributeCallbackBridge * onSuccess = new CHIPInt32uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10107,22 +10098,22 @@ - (void)readAttributeInt32u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32uWithValue:(uint32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10134,22 +10125,22 @@ - (void)writeAttributeInt32u:(uint32_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64u:(ResponseHandler)completionHandler +- (void)readAttributeInt64uWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64uAttributeCallbackBridge * onSuccess = new CHIPInt64uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10161,22 +10152,22 @@ - (void)readAttributeInt64u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64uWithValue:(uint64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10188,22 +10179,22 @@ - (void)writeAttributeInt64u:(uint64_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt8s:(ResponseHandler)completionHandler +- (void)readAttributeInt8sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8sAttributeCallbackBridge * onSuccess = new CHIPInt8sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10215,22 +10206,22 @@ - (void)readAttributeInt8s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt8sWithValue:(int8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10242,22 +10233,22 @@ - (void)writeAttributeInt8s:(int8_t)value completionHandler:(ResponseHandler)com if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt16s:(ResponseHandler)completionHandler +- (void)readAttributeInt16sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10269,22 +10260,22 @@ - (void)readAttributeInt16s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt16sWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10296,22 +10287,22 @@ - (void)writeAttributeInt16s:(int16_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt32s:(ResponseHandler)completionHandler +- (void)readAttributeInt32sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt32sAttributeCallbackBridge * onSuccess = new CHIPInt32sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10323,22 +10314,22 @@ - (void)readAttributeInt32s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt32sWithValue:(int32_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10350,22 +10341,22 @@ - (void)writeAttributeInt32s:(int32_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeInt64s:(ResponseHandler)completionHandler +- (void)readAttributeInt64sWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt64sAttributeCallbackBridge * onSuccess = new CHIPInt64sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10377,22 +10368,22 @@ - (void)readAttributeInt64s:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeInt64sWithValue:(int64_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10404,22 +10395,22 @@ - (void)writeAttributeInt64s:(int64_t)value completionHandler:(ResponseHandler)c if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum8:(ResponseHandler)completionHandler +- (void)readAttributeEnum8WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10431,22 +10422,22 @@ - (void)readAttributeEnum8:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum8WithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10458,22 +10449,22 @@ - (void)writeAttributeEnum8:(uint8_t)value completionHandler:(ResponseHandler)co if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeEnum16:(ResponseHandler)completionHandler +- (void)readAttributeEnum16WithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10485,22 +10476,22 @@ - (void)readAttributeEnum16:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeEnum16WithValue:(uint16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10512,23 +10503,23 @@ - (void)writeAttributeEnum16:(uint16_t)value completionHandler:(ResponseHandler) if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOctetString:(ResponseHandler)completionHandler +- (void)readAttributeOctetStringWithResponseHandler:(ResponseHandler)responseHandler { CHIPStringAttributeCallbackBridge * onSuccess - = new CHIPStringAttributeCallbackBridge(completionHandler, [self callbackQueue], true); + = new CHIPStringAttributeCallbackBridge(responseHandler, [self callbackQueue], true); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10540,22 +10531,22 @@ - (void)readAttributeOctetString:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOctetStringWithValue:(NSData *)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10568,23 +10559,23 @@ - (void)writeAttributeOctetString:(NSData *)value completionHandler:(ResponseHan if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeListInt8u:(ResponseHandler)completionHandler +- (void)readAttributeListInt8uWithResponseHandler:(ResponseHandler)responseHandler { CHIPTestClusterListInt8uAttributeCallbackBridge * onSuccess - = new CHIPTestClusterListInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + = new CHIPTestClusterListInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10596,22 +10587,22 @@ - (void)readAttributeListInt8u:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10623,7 +10614,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } @@ -10640,18 +10631,18 @@ @implementation CHIPThermostat return &_cppCluster; } -- (void)clearWeeklySchedule:(ResponseHandler)completionHandler +- (void)clearWeeklySchedule:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10663,21 +10654,21 @@ - (void)clearWeeklySchedule:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getRelayStatusLog:(ResponseHandler)completionHandler +- (void)getRelayStatusLog:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10689,23 +10680,21 @@ - (void)getRelayStatusLog:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)getWeeklySchedule:(uint8_t)daysToReturn - modeToReturn:(uint8_t)modeToReturn - completionHandler:(ResponseHandler)completionHandler +- (void)getWeeklySchedule:(uint8_t)daysToReturn modeToReturn:(uint8_t)modeToReturn responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10717,25 +10706,25 @@ - (void)getWeeklySchedule:(uint8_t)daysToReturn if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence dayOfWeekForSequence:(uint8_t)dayOfWeekForSequence modeForSequence:(uint8_t)modeForSequence payload:(uint8_t)payload - completionHandler:(ResponseHandler)completionHandler + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10748,21 +10737,21 @@ - (void)setWeeklySchedule:(uint8_t)numberOfTransitionsForSequence if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler:(ResponseHandler)completionHandler +- (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10774,22 +10763,22 @@ - (void)setpointRaiseLower:(uint8_t)mode amount:(int8_t)amount completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler +- (void)readAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10801,25 +10790,25 @@ - (void)readAttributeLocalTemperature:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)configureAttributeLocalTemperature:(uint16_t)minInterval - maxInterval:(uint16_t)maxInterval - change:(int16_t)change - completionHandler:(ResponseHandler)completionHandler +- (void)configureAttributeLocalTemperatureWithMinInterval:(uint16_t)minInterval + maxInterval:(uint16_t)maxInterval + change:(int16_t)change + responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10832,11 +10821,11 @@ - (void)configureAttributeLocalTemperature:(uint16_t)minInterval if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler +- (void)reportAttributeLocalTemperatureWithResponseHandler:(ResponseHandler)reportHandler { CHIPInt16sAttributeCallbackBridge * onReport = new CHIPInt16sAttributeCallbackBridge(reportHandler, [self callbackQueue], true); if (!onReport) { @@ -10855,18 +10844,18 @@ - (void)reportAttributeLocalTemperature:(ResponseHandler)reportHandler } } -- (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedCoolingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10878,22 +10867,22 @@ - (void)readAttributeOccupiedCoolingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedCoolingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10905,22 +10894,22 @@ - (void)writeAttributeOccupiedCoolingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler +- (void)readAttributeOccupiedHeatingSetpointWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16sAttributeCallbackBridge * onSuccess = new CHIPInt16sAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10932,22 +10921,22 @@ - (void)readAttributeOccupiedHeatingSetpoint:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeOccupiedHeatingSetpointWithValue:(int16_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10959,22 +10948,22 @@ - (void)writeAttributeOccupiedHeatingSetpoint:(int16_t)value completionHandler:( if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandler +- (void)readAttributeControlSequenceOfOperationWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -10986,22 +10975,22 @@ - (void)readAttributeControlSequenceOfOperation:(ResponseHandler)completionHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeControlSequenceOfOperationWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11013,22 +11002,22 @@ - (void)writeAttributeControlSequenceOfOperation:(uint8_t)value completionHandle if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeSystemMode:(ResponseHandler)completionHandler +- (void)readAttributeSystemModeWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt8uAttributeCallbackBridge * onSuccess = new CHIPInt8uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11040,22 +11029,22 @@ - (void)readAttributeSystemMode:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandler)completionHandler +- (void)writeAttributeSystemModeWithValue:(uint8_t)value responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11067,22 +11056,22 @@ - (void)writeAttributeSystemMode:(uint8_t)value completionHandler:(ResponseHandl if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)readAttributeClusterRevision:(ResponseHandler)completionHandler +- (void)readAttributeClusterRevisionWithResponseHandler:(ResponseHandler)responseHandler { - CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(completionHandler, [self callbackQueue]); + CHIPInt16uAttributeCallbackBridge * onSuccess = new CHIPInt16uAttributeCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } - CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(completionHandler, [self callbackQueue]); + CHIPDefaultFailureCallbackBridge * onFailure = new CHIPDefaultFailureCallbackBridge(responseHandler, [self callbackQueue]); if (!onFailure) { delete onSuccess; - completionHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); + responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; } @@ -11094,7 +11083,7 @@ - (void)readAttributeClusterRevision:(ResponseHandler)completionHandler if (err != CHIP_NO_ERROR) { delete onSuccess; delete onFailure; - completionHandler([CHIPError errorForCHIPErrorCode:err], nil); + responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } diff --git a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt index 39ceb1b58aca4c..65cff1ab733f9c 100644 --- a/src/darwin/Framework/CHIP/templates/clusters-tests.zapt +++ b/src/darwin/Framework/CHIP/templates/clusters-tests.zapt @@ -179,16 +179,16 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) {{#chip_client_clusters}} {{#chip_server_cluster_attributes}} -- (void)testSendCluster{{asCamelCased parent.name false}}ReadAttribute{{asCamelCased name false}} +- (void)testSendCluster{{asCamelCased parent.name false}}ReadAttribute{{asCamelCased name false}}WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asCamelCased parent.name false}}ReadAttribute{{asCamelCased name false}}"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"{{asCamelCased parent.name false}}ReadAttribute{{asCamelCased name false}}WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIP{{asCamelCased parent.name false}} * cluster = [[CHIP{{asCamelCased parent.name false}} alloc] initWithDevice:device endpoint:{{asExpectedEndpointForCluster (asCamelCased parent.name false)}} queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttribute{{asCamelCased name false}}:^(NSError * err, NSDictionary * values) { + [cluster readAttribute{{asCamelCased name false}}WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"{{asCamelCased parent.name false}} {{asCamelCased name false}} Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -198,9 +198,9 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) } {{#if (isWritableAttribute)}} -- (void)testSendCluster{{asCamelCased parent.name false}}WriteAttribute{{asCamelCased name false}} +- (void)testSendCluster{{asCamelCased parent.name false}}WriteAttribute{{asCamelCased name false}}WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"{{asCamelCased parent.name false}}WriteAttribute{{asCamelCased name false}}"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"{{asCamelCased parent.name false}}WriteAttribute{{asCamelCased name false}}WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -208,7 +208,7 @@ CHIPDevice * GetPairedDevice(uint64_t deviceId) XCTAssertNotNil(cluster); {{asObjectiveCBasicType type}} value = {{asTestValue}}; - [cluster writeAttribute{{asCamelCased name false}}:value completionHandler:^(NSError * err, NSDictionary * values) { + [cluster writeAttribute{{asCamelCased name false}}WithValue:value responseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"{{asCamelCased parent.name false}} {{asCamelCased name false}} Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; diff --git a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m index 1e4ce429a93b10..690f6ddc6d68ac 100644 --- a/src/darwin/Framework/CHIPTests/CHIPClustersTests.m +++ b/src/darwin/Framework/CHIPTests/CHIPClustersTests.m @@ -178,16 +178,17 @@ - (void)testSendClusterTestSpecificCommand [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeVendorName +- (void)testSendClusterApplicationBasicReadAttributeVendorNameWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorName"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorNameWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorName:^(NSError * err, NSDictionary * values) { + [cluster readAttributeVendorNameWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic VendorName Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -196,16 +197,16 @@ - (void)testSendClusterApplicationBasicReadAttributeVendorName [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeVendorId +- (void)testSendClusterApplicationBasicReadAttributeVendorIdWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorId"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeVendorIdWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorId:^(NSError * err, NSDictionary * values) { + [cluster readAttributeVendorIdWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic VendorId Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -214,16 +215,17 @@ - (void)testSendClusterApplicationBasicReadAttributeVendorId [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeApplicationName +- (void)testSendClusterApplicationBasicReadAttributeApplicationNameWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationName"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationNameWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeApplicationName:^(NSError * err, NSDictionary * values) { + [cluster readAttributeApplicationNameWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic ApplicationName Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -232,16 +234,17 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationName [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeProductId +- (void)testSendClusterApplicationBasicReadAttributeProductIdWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeProductId"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeProductIdWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductId:^(NSError * err, NSDictionary * values) { + [cluster readAttributeProductIdWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic ProductId Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -250,16 +253,17 @@ - (void)testSendClusterApplicationBasicReadAttributeProductId [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeApplicationId +- (void)testSendClusterApplicationBasicReadAttributeApplicationIdWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationId"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationIdWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeApplicationId:^(NSError * err, NSDictionary * values) { + [cluster readAttributeApplicationIdWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic ApplicationId Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -268,16 +272,17 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationId [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeCatalogVendorId +- (void)testSendClusterApplicationBasicReadAttributeCatalogVendorIdWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeCatalogVendorId"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeCatalogVendorIdWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCatalogVendorId:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCatalogVendorIdWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic CatalogVendorId Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -286,16 +291,17 @@ - (void)testSendClusterApplicationBasicReadAttributeCatalogVendorId [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeApplicationSatus +- (void)testSendClusterApplicationBasicReadAttributeApplicationSatusWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationSatus"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeApplicationSatusWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeApplicationSatus:^(NSError * err, NSDictionary * values) { + [cluster readAttributeApplicationSatusWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic ApplicationSatus Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -304,16 +310,17 @@ - (void)testSendClusterApplicationBasicReadAttributeApplicationSatus [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterApplicationBasicReadAttributeClusterRevision +- (void)testSendClusterApplicationBasicReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ApplicationBasicReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ApplicationBasicReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPApplicationBasic * cluster = [[CHIPApplicationBasic alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ApplicationBasic ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -322,16 +329,17 @@ - (void)testSendClusterApplicationBasicReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBarrierControlReadAttributeBarrierMovingState +- (void)testSendClusterBarrierControlReadAttributeBarrierMovingStateWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlReadAttributeBarrierMovingState"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BarrierControlReadAttributeBarrierMovingStateWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBarrierMovingState:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBarrierMovingStateWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"BarrierControl BarrierMovingState Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -340,16 +348,17 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierMovingState [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatus +- (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatusWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlReadAttributeBarrierSafetyStatus"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BarrierControlReadAttributeBarrierSafetyStatusWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBarrierSafetyStatus:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBarrierSafetyStatusWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"BarrierControl BarrierSafetyStatus Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -358,16 +367,17 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierSafetyStatus [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBarrierControlReadAttributeBarrierCapabilities +- (void)testSendClusterBarrierControlReadAttributeBarrierCapabilitiesWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlReadAttributeBarrierCapabilities"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BarrierControlReadAttributeBarrierCapabilitiesWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBarrierCapabilities:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBarrierCapabilitiesWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"BarrierControl BarrierCapabilities Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -376,16 +386,17 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierCapabilities [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBarrierControlReadAttributeBarrierPosition +- (void)testSendClusterBarrierControlReadAttributeBarrierPositionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlReadAttributeBarrierPosition"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BarrierControlReadAttributeBarrierPositionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBarrierPosition:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBarrierPositionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"BarrierControl BarrierPosition Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -394,16 +405,17 @@ - (void)testSendClusterBarrierControlReadAttributeBarrierPosition [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBarrierControlReadAttributeClusterRevision +- (void)testSendClusterBarrierControlReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BarrierControlReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BarrierControlReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBarrierControl * cluster = [[CHIPBarrierControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"BarrierControl ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -412,16 +424,17 @@ - (void)testSendClusterBarrierControlReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeInteractionModelVersion +- (void)testSendClusterBasicReadAttributeInteractionModelVersionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeInteractionModelVersion"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BasicReadAttributeInteractionModelVersionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInteractionModelVersion:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInteractionModelVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic InteractionModelVersion Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -430,16 +443,16 @@ - (void)testSendClusterBasicReadAttributeInteractionModelVersion [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeVendorName +- (void)testSendClusterBasicReadAttributeVendorNameWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeVendorName"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeVendorNameWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorName:^(NSError * err, NSDictionary * values) { + [cluster readAttributeVendorNameWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic VendorName Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -448,16 +461,16 @@ - (void)testSendClusterBasicReadAttributeVendorName [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeVendorID +- (void)testSendClusterBasicReadAttributeVendorIDWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeVendorID"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeVendorIDWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeVendorID:^(NSError * err, NSDictionary * values) { + [cluster readAttributeVendorIDWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic VendorID Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -466,16 +479,16 @@ - (void)testSendClusterBasicReadAttributeVendorID [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeProductName +- (void)testSendClusterBasicReadAttributeProductNameWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductName"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductNameWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductName:^(NSError * err, NSDictionary * values) { + [cluster readAttributeProductNameWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ProductName Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -484,16 +497,16 @@ - (void)testSendClusterBasicReadAttributeProductName [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeProductID +- (void)testSendClusterBasicReadAttributeProductIDWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductID"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductIDWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductID:^(NSError * err, NSDictionary * values) { + [cluster readAttributeProductIDWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ProductID Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -502,16 +515,16 @@ - (void)testSendClusterBasicReadAttributeProductID [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeUserLabel +- (void)testSendClusterBasicReadAttributeUserLabelWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeUserLabel"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeUserLabelWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeUserLabel:^(NSError * err, NSDictionary * values) { + [cluster readAttributeUserLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic UserLabel Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -520,9 +533,9 @@ - (void)testSendClusterBasicReadAttributeUserLabel [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicWriteAttributeUserLabel +- (void)testSendClusterBasicWriteAttributeUserLabelWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeUserLabel"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeUserLabelWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -530,25 +543,25 @@ - (void)testSendClusterBasicWriteAttributeUserLabel XCTAssertNotNil(cluster); NSString * value = @"Test"; - [cluster writeAttributeUserLabel:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Basic UserLabel Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeUserLabelWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Basic UserLabel Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeLocation +- (void)testSendClusterBasicReadAttributeLocationWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeLocation"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeLocationWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLocation:^(NSError * err, NSDictionary * values) { + [cluster readAttributeLocationWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic Location Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -557,9 +570,9 @@ - (void)testSendClusterBasicReadAttributeLocation [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicWriteAttributeLocation +- (void)testSendClusterBasicWriteAttributeLocationWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeLocation"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeLocationWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -567,25 +580,25 @@ - (void)testSendClusterBasicWriteAttributeLocation XCTAssertNotNil(cluster); NSString * value = @"Test"; - [cluster writeAttributeLocation:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Basic Location Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeLocationWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Basic Location Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeHardwareVersion +- (void)testSendClusterBasicReadAttributeHardwareVersionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeHardwareVersion"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeHardwareVersionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeHardwareVersion:^(NSError * err, NSDictionary * values) { + [cluster readAttributeHardwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic HardwareVersion Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -594,16 +607,17 @@ - (void)testSendClusterBasicReadAttributeHardwareVersion [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeHardwareVersionString +- (void)testSendClusterBasicReadAttributeHardwareVersionStringWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeHardwareVersionString"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BasicReadAttributeHardwareVersionStringWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeHardwareVersionString:^(NSError * err, NSDictionary * values) { + [cluster readAttributeHardwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic HardwareVersionString Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -612,16 +626,16 @@ - (void)testSendClusterBasicReadAttributeHardwareVersionString [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeSoftwareVersion +- (void)testSendClusterBasicReadAttributeSoftwareVersionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeSoftwareVersion"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeSoftwareVersionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSoftwareVersion:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSoftwareVersionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic SoftwareVersion Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -630,16 +644,17 @@ - (void)testSendClusterBasicReadAttributeSoftwareVersion [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeSoftwareVersionString +- (void)testSendClusterBasicReadAttributeSoftwareVersionStringWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeSoftwareVersionString"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"BasicReadAttributeSoftwareVersionStringWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSoftwareVersionString:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSoftwareVersionStringWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic SoftwareVersionString Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -648,16 +663,16 @@ - (void)testSendClusterBasicReadAttributeSoftwareVersionString [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeManufacturingDate +- (void)testSendClusterBasicReadAttributeManufacturingDateWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeManufacturingDate"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeManufacturingDateWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeManufacturingDate:^(NSError * err, NSDictionary * values) { + [cluster readAttributeManufacturingDateWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ManufacturingDate Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -666,16 +681,16 @@ - (void)testSendClusterBasicReadAttributeManufacturingDate [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributePartNumber +- (void)testSendClusterBasicReadAttributePartNumberWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributePartNumber"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributePartNumberWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePartNumber:^(NSError * err, NSDictionary * values) { + [cluster readAttributePartNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic PartNumber Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -684,16 +699,16 @@ - (void)testSendClusterBasicReadAttributePartNumber [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeProductURL +- (void)testSendClusterBasicReadAttributeProductURLWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductURL"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductURLWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductURL:^(NSError * err, NSDictionary * values) { + [cluster readAttributeProductURLWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ProductURL Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -702,16 +717,16 @@ - (void)testSendClusterBasicReadAttributeProductURL [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeProductLabel +- (void)testSendClusterBasicReadAttributeProductLabelWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductLabel"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeProductLabelWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeProductLabel:^(NSError * err, NSDictionary * values) { + [cluster readAttributeProductLabelWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ProductLabel Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -720,16 +735,16 @@ - (void)testSendClusterBasicReadAttributeProductLabel [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeSerialNumber +- (void)testSendClusterBasicReadAttributeSerialNumberWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeSerialNumber"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeSerialNumberWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSerialNumber:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSerialNumberWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic SerialNumber Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -738,16 +753,16 @@ - (void)testSendClusterBasicReadAttributeSerialNumber [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeLocalConfigDisabled +- (void)testSendClusterBasicReadAttributeLocalConfigDisabledWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeLocalConfigDisabled"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeLocalConfigDisabledWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLocalConfigDisabled:^(NSError * err, NSDictionary * values) { + [cluster readAttributeLocalConfigDisabledWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic LocalConfigDisabled Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -756,9 +771,9 @@ - (void)testSendClusterBasicReadAttributeLocalConfigDisabled [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicWriteAttributeLocalConfigDisabled +- (void)testSendClusterBasicWriteAttributeLocalConfigDisabledWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeLocalConfigDisabled"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicWriteAttributeLocalConfigDisabledWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -766,25 +781,25 @@ - (void)testSendClusterBasicWriteAttributeLocalConfigDisabled XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeLocalConfigDisabled:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Basic LocalConfigDisabled Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeLocalConfigDisabledWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Basic LocalConfigDisabled Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBasicReadAttributeClusterRevision +- (void)testSendClusterBasicReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BasicReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBasic * cluster = [[CHIPBasic alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Basic ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -793,16 +808,16 @@ - (void)testSendClusterBasicReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterBindingReadAttributeClusterRevision +- (void)testSendClusterBindingReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"BindingReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPBinding * cluster = [[CHIPBinding alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Binding ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -811,16 +826,16 @@ - (void)testSendClusterBindingReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCurrentHue +- (void)testSendClusterColorControlReadAttributeCurrentHueWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentHue"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentHueWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentHue:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentHueWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CurrentHue Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -829,16 +844,17 @@ - (void)testSendClusterColorControlReadAttributeCurrentHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCurrentSaturation +- (void)testSendClusterColorControlReadAttributeCurrentSaturationWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentSaturation"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeCurrentSaturationWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentSaturation:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentSaturationWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CurrentSaturation Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -847,16 +863,17 @@ - (void)testSendClusterColorControlReadAttributeCurrentSaturation [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeRemainingTime +- (void)testSendClusterColorControlReadAttributeRemainingTimeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeRemainingTime"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeRemainingTimeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeRemainingTime:^(NSError * err, NSDictionary * values) { + [cluster readAttributeRemainingTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl RemainingTime Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -865,16 +882,16 @@ - (void)testSendClusterColorControlReadAttributeRemainingTime [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCurrentX +- (void)testSendClusterColorControlReadAttributeCurrentXWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentXWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentX:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentXWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CurrentX Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -883,16 +900,16 @@ - (void)testSendClusterColorControlReadAttributeCurrentX [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCurrentY +- (void)testSendClusterColorControlReadAttributeCurrentYWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCurrentYWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentY:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentYWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CurrentY Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -901,16 +918,17 @@ - (void)testSendClusterColorControlReadAttributeCurrentY [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeDriftCompensation +- (void)testSendClusterColorControlReadAttributeDriftCompensationWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeDriftCompensation"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeDriftCompensationWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeDriftCompensation:^(NSError * err, NSDictionary * values) { + [cluster readAttributeDriftCompensationWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl DriftCompensation Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -919,16 +937,17 @@ - (void)testSendClusterColorControlReadAttributeDriftCompensation [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCompensationText +- (void)testSendClusterColorControlReadAttributeCompensationTextWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCompensationText"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeCompensationTextWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCompensationText:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCompensationTextWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CompensationText Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -937,16 +956,17 @@ - (void)testSendClusterColorControlReadAttributeCompensationText [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorTemperature +- (void)testSendClusterColorControlReadAttributeColorTemperatureWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorTemperature"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorTemperatureWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorTemperature:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorTemperatureWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorTemperature Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -955,16 +975,16 @@ - (void)testSendClusterColorControlReadAttributeColorTemperature [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorMode +- (void)testSendClusterColorControlReadAttributeColorModeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -973,16 +993,17 @@ - (void)testSendClusterColorControlReadAttributeColorMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorControlOptions +- (void)testSendClusterColorControlReadAttributeColorControlOptionsWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorControlOptions"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorControlOptionsWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorControlOptions:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorControlOptionsWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorControlOptions Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -991,9 +1012,9 @@ - (void)testSendClusterColorControlReadAttributeColorControlOptions [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorControlOptions +- (void)testSendClusterColorControlWriteAttributeColorControlOptionsWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorControlOptions"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorControlOptionsWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1001,25 +1022,26 @@ - (void)testSendClusterColorControlWriteAttributeColorControlOptions XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeColorControlOptions:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorControlOptions Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorControlOptionsWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorControlOptions Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeNumberOfPrimaries +- (void)testSendClusterColorControlReadAttributeNumberOfPrimariesWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeNumberOfPrimaries"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeNumberOfPrimariesWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNumberOfPrimaries:^(NSError * err, NSDictionary * values) { + [cluster readAttributeNumberOfPrimariesWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl NumberOfPrimaries Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1028,16 +1050,16 @@ - (void)testSendClusterColorControlReadAttributeNumberOfPrimaries [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary1X +- (void)testSendClusterColorControlReadAttributePrimary1XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary1X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary1XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary1X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1046,16 +1068,16 @@ - (void)testSendClusterColorControlReadAttributePrimary1X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary1Y +- (void)testSendClusterColorControlReadAttributePrimary1YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary1Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary1YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary1Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1064,16 +1086,17 @@ - (void)testSendClusterColorControlReadAttributePrimary1Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary1Intensity +- (void)testSendClusterColorControlReadAttributePrimary1IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary1Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary1IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary1Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary1IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary1Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1082,16 +1105,16 @@ - (void)testSendClusterColorControlReadAttributePrimary1Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary2X +- (void)testSendClusterColorControlReadAttributePrimary2XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary2X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary2XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary2X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1100,16 +1123,16 @@ - (void)testSendClusterColorControlReadAttributePrimary2X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary2Y +- (void)testSendClusterColorControlReadAttributePrimary2YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary2Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary2YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary2Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1118,16 +1141,17 @@ - (void)testSendClusterColorControlReadAttributePrimary2Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary2Intensity +- (void)testSendClusterColorControlReadAttributePrimary2IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary2Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary2IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary2Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary2IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary2Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1136,16 +1160,16 @@ - (void)testSendClusterColorControlReadAttributePrimary2Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary3X +- (void)testSendClusterColorControlReadAttributePrimary3XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary3X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary3XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary3X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1154,16 +1178,16 @@ - (void)testSendClusterColorControlReadAttributePrimary3X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary3Y +- (void)testSendClusterColorControlReadAttributePrimary3YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary3Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary3YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary3Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1172,16 +1196,17 @@ - (void)testSendClusterColorControlReadAttributePrimary3Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary3Intensity +- (void)testSendClusterColorControlReadAttributePrimary3IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary3Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary3IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary3Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary3IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary3Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1190,16 +1215,16 @@ - (void)testSendClusterColorControlReadAttributePrimary3Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary4X +- (void)testSendClusterColorControlReadAttributePrimary4XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary4X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary4XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary4X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1208,16 +1233,16 @@ - (void)testSendClusterColorControlReadAttributePrimary4X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary4Y +- (void)testSendClusterColorControlReadAttributePrimary4YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary4Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary4YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary4Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1226,16 +1251,17 @@ - (void)testSendClusterColorControlReadAttributePrimary4Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary4Intensity +- (void)testSendClusterColorControlReadAttributePrimary4IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary4Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary4IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary4Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary4IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary4Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1244,16 +1270,16 @@ - (void)testSendClusterColorControlReadAttributePrimary4Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary5X +- (void)testSendClusterColorControlReadAttributePrimary5XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary5X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary5XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary5X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1262,16 +1288,16 @@ - (void)testSendClusterColorControlReadAttributePrimary5X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary5Y +- (void)testSendClusterColorControlReadAttributePrimary5YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary5Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary5YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary5Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1280,16 +1306,17 @@ - (void)testSendClusterColorControlReadAttributePrimary5Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary5Intensity +- (void)testSendClusterColorControlReadAttributePrimary5IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary5Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary5IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary5Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary5IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary5Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1298,16 +1325,16 @@ - (void)testSendClusterColorControlReadAttributePrimary5Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary6X +- (void)testSendClusterColorControlReadAttributePrimary6XWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6X"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6XWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary6X:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary6XWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary6X Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1316,16 +1343,16 @@ - (void)testSendClusterColorControlReadAttributePrimary6X [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary6Y +- (void)testSendClusterColorControlReadAttributePrimary6YWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6Y"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6YWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary6Y:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary6YWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary6Y Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1334,16 +1361,17 @@ - (void)testSendClusterColorControlReadAttributePrimary6Y [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributePrimary6Intensity +- (void)testSendClusterColorControlReadAttributePrimary6IntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributePrimary6Intensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributePrimary6IntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePrimary6Intensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributePrimary6IntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl Primary6Intensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1352,16 +1380,16 @@ - (void)testSendClusterColorControlReadAttributePrimary6Intensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeWhitePointX +- (void)testSendClusterColorControlReadAttributeWhitePointXWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeWhitePointX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeWhitePointXWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeWhitePointX:^(NSError * err, NSDictionary * values) { + [cluster readAttributeWhitePointXWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl WhitePointX Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1370,9 +1398,9 @@ - (void)testSendClusterColorControlReadAttributeWhitePointX [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeWhitePointX +- (void)testSendClusterColorControlWriteAttributeWhitePointXWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointXWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1380,25 +1408,25 @@ - (void)testSendClusterColorControlWriteAttributeWhitePointX XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeWhitePointX:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl WhitePointX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeWhitePointXWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl WhitePointX Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeWhitePointY +- (void)testSendClusterColorControlReadAttributeWhitePointYWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeWhitePointY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeWhitePointYWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeWhitePointY:^(NSError * err, NSDictionary * values) { + [cluster readAttributeWhitePointYWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl WhitePointY Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1407,9 +1435,9 @@ - (void)testSendClusterColorControlReadAttributeWhitePointY [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeWhitePointY +- (void)testSendClusterColorControlWriteAttributeWhitePointYWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeWhitePointYWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1417,25 +1445,25 @@ - (void)testSendClusterColorControlWriteAttributeWhitePointY XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeWhitePointY:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl WhitePointY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeWhitePointYWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl WhitePointY Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointRX +- (void)testSendClusterColorControlReadAttributeColorPointRXWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointRX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointRXWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointRX:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointRXWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointRX Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1444,9 +1472,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointRX [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointRX +- (void)testSendClusterColorControlWriteAttributeColorPointRXWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRXWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1454,25 +1482,25 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRX XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointRX:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointRX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointRXWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointRX Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointRY +- (void)testSendClusterColorControlReadAttributeColorPointRYWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointRY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointRYWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointRY:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointRYWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointRY Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1481,9 +1509,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointRY [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointRY +- (void)testSendClusterColorControlWriteAttributeColorPointRYWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRYWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1491,25 +1519,26 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRY XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointRY:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointRY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointRYWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointRY Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointRIntensity +- (void)testSendClusterColorControlReadAttributeColorPointRIntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointRIntensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorPointRIntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointRIntensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointRIntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1518,9 +1547,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointRIntensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointRIntensity +- (void)testSendClusterColorControlWriteAttributeColorPointRIntensityWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRIntensity"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointRIntensityWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1528,25 +1557,25 @@ - (void)testSendClusterColorControlWriteAttributeColorPointRIntensity XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeColorPointRIntensity:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointRIntensityWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointRIntensity Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointGX +- (void)testSendClusterColorControlReadAttributeColorPointGXWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointGX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointGXWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointGX:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointGXWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointGX Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1555,9 +1584,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointGX [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointGX +- (void)testSendClusterColorControlWriteAttributeColorPointGXWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGXWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1565,25 +1594,25 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGX XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointGX:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointGX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointGXWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointGX Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointGY +- (void)testSendClusterColorControlReadAttributeColorPointGYWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointGY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointGYWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointGY:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointGYWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointGY Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1592,9 +1621,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointGY [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointGY +- (void)testSendClusterColorControlWriteAttributeColorPointGYWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGYWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1602,25 +1631,26 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGY XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointGY:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointGY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointGYWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointGY Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointGIntensity +- (void)testSendClusterColorControlReadAttributeColorPointGIntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointGIntensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorPointGIntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointGIntensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointGIntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1629,9 +1659,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointGIntensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointGIntensity +- (void)testSendClusterColorControlWriteAttributeColorPointGIntensityWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGIntensity"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointGIntensityWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1639,25 +1669,25 @@ - (void)testSendClusterColorControlWriteAttributeColorPointGIntensity XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeColorPointGIntensity:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointGIntensityWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointGIntensity Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointBX +- (void)testSendClusterColorControlReadAttributeColorPointBXWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointBX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointBXWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointBX:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointBXWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointBX Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1666,9 +1696,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointBX [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointBX +- (void)testSendClusterColorControlWriteAttributeColorPointBXWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBX"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBXWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1676,25 +1706,25 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBX XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointBX:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointBX Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointBXWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointBX Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointBY +- (void)testSendClusterColorControlReadAttributeColorPointBYWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointBY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointBYWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointBY:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointBYWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointBY Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1703,9 +1733,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointBY [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointBY +- (void)testSendClusterColorControlWriteAttributeColorPointBYWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBY"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBYWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1713,25 +1743,26 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBY XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeColorPointBY:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointBY Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointBYWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointBY Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorPointBIntensity +- (void)testSendClusterColorControlReadAttributeColorPointBIntensityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorPointBIntensity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorPointBIntensityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorPointBIntensity:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorPointBIntensityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1740,9 +1771,9 @@ - (void)testSendClusterColorControlReadAttributeColorPointBIntensity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeColorPointBIntensity +- (void)testSendClusterColorControlWriteAttributeColorPointBIntensityWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBIntensity"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeColorPointBIntensityWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1750,25 +1781,26 @@ - (void)testSendClusterColorControlWriteAttributeColorPointBIntensity XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeColorPointBIntensity:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeColorPointBIntensityWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl ColorPointBIntensity Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeEnhancedCurrentHue +- (void)testSendClusterColorControlReadAttributeEnhancedCurrentHueWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeEnhancedCurrentHue"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeEnhancedCurrentHueWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnhancedCurrentHue:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEnhancedCurrentHueWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl EnhancedCurrentHue Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1777,16 +1809,17 @@ - (void)testSendClusterColorControlReadAttributeEnhancedCurrentHue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeEnhancedColorMode +- (void)testSendClusterColorControlReadAttributeEnhancedColorModeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeEnhancedColorMode"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeEnhancedColorModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnhancedColorMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEnhancedColorModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl EnhancedColorMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1795,16 +1828,17 @@ - (void)testSendClusterColorControlReadAttributeEnhancedColorMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorLoopActive +- (void)testSendClusterColorControlReadAttributeColorLoopActiveWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorLoopActive"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorLoopActiveWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopActive:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorLoopActiveWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorLoopActive Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1813,16 +1847,17 @@ - (void)testSendClusterColorControlReadAttributeColorLoopActive [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorLoopDirection +- (void)testSendClusterColorControlReadAttributeColorLoopDirectionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorLoopDirection"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorLoopDirectionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopDirection:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorLoopDirectionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorLoopDirection Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1831,16 +1866,17 @@ - (void)testSendClusterColorControlReadAttributeColorLoopDirection [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorLoopTime +- (void)testSendClusterColorControlReadAttributeColorLoopTimeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorLoopTime"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorLoopTimeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorLoopTime:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorLoopTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorLoopTime Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1849,16 +1885,17 @@ - (void)testSendClusterColorControlReadAttributeColorLoopTime [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorCapabilities +- (void)testSendClusterColorControlReadAttributeColorCapabilitiesWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorCapabilities"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorCapabilitiesWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorCapabilities:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorCapabilitiesWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorCapabilities Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1867,16 +1904,17 @@ - (void)testSendClusterColorControlReadAttributeColorCapabilities [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMin +- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMinWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMin"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMinWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorTempPhysicalMin:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorTempPhysicalMinWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorTempPhysicalMin Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1885,16 +1923,17 @@ - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMin [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMax +- (void)testSendClusterColorControlReadAttributeColorTempPhysicalMaxWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMax"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeColorTempPhysicalMaxWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeColorTempPhysicalMax:^(NSError * err, NSDictionary * values) { + [cluster readAttributeColorTempPhysicalMaxWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ColorTempPhysicalMax Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1903,16 +1942,17 @@ - (void)testSendClusterColorControlReadAttributeColorTempPhysicalMax [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMireds +- (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeCoupleColorTempToLevelMinMireds"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCoupleColorTempToLevelMinMireds:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCoupleColorTempToLevelMinMiredsWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl CoupleColorTempToLevelMinMireds Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1921,16 +1961,17 @@ - (void)testSendClusterColorControlReadAttributeCoupleColorTempToLevelMinMireds [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMireds +- (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMiredsWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeStartUpColorTemperatureMireds"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeStartUpColorTemperatureMiredsWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeStartUpColorTemperatureMireds:^(NSError * err, NSDictionary * values) { + [cluster readAttributeStartUpColorTemperatureMiredsWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1939,9 +1980,10 @@ - (void)testSendClusterColorControlReadAttributeStartUpColorTemperatureMireds [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMireds +- (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlWriteAttributeStartUpColorTemperatureMireds"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlWriteAttributeStartUpColorTemperatureMiredsWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1949,25 +1991,26 @@ - (void)testSendClusterColorControlWriteAttributeStartUpColorTemperatureMireds XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeStartUpColorTemperatureMireds:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"ColorControl StartUpColorTemperatureMireds Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterColorControlReadAttributeClusterRevision +- (void)testSendClusterColorControlReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ColorControlReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ColorControlReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPColorControl * cluster = [[CHIPColorControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"ColorControl ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1976,16 +2019,16 @@ - (void)testSendClusterColorControlReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDescriptorReadAttributeDeviceList +- (void)testSendClusterDescriptorReadAttributeDeviceListWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeDeviceList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeDeviceListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeDeviceList:^(NSError * err, NSDictionary * values) { + [cluster readAttributeDeviceListWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Descriptor DeviceList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -1994,16 +2037,16 @@ - (void)testSendClusterDescriptorReadAttributeDeviceList [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDescriptorReadAttributeServerList +- (void)testSendClusterDescriptorReadAttributeServerListWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeServerList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeServerListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeServerList:^(NSError * err, NSDictionary * values) { + [cluster readAttributeServerListWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Descriptor ServerList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2012,16 +2055,16 @@ - (void)testSendClusterDescriptorReadAttributeServerList [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDescriptorReadAttributeClientList +- (void)testSendClusterDescriptorReadAttributeClientListWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeClientList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeClientListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClientList:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClientListWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Descriptor ClientList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2030,16 +2073,16 @@ - (void)testSendClusterDescriptorReadAttributeClientList [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDescriptorReadAttributePartsList +- (void)testSendClusterDescriptorReadAttributePartsListWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributePartsList"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributePartsListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributePartsList:^(NSError * err, NSDictionary * values) { + [cluster readAttributePartsListWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Descriptor PartsList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2048,16 +2091,17 @@ - (void)testSendClusterDescriptorReadAttributePartsList [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDescriptorReadAttributeClusterRevision +- (void)testSendClusterDescriptorReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DescriptorReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"DescriptorReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDescriptor * cluster = [[CHIPDescriptor alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Descriptor ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2066,16 +2110,16 @@ - (void)testSendClusterDescriptorReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDoorLockReadAttributeLockState +- (void)testSendClusterDoorLockReadAttributeLockStateWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockState"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockStateWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLockState:^(NSError * err, NSDictionary * values) { + [cluster readAttributeLockStateWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"DoorLock LockState Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2084,16 +2128,16 @@ - (void)testSendClusterDoorLockReadAttributeLockState [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDoorLockReadAttributeLockType +- (void)testSendClusterDoorLockReadAttributeLockTypeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockType"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeLockTypeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLockType:^(NSError * err, NSDictionary * values) { + [cluster readAttributeLockTypeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"DoorLock LockType Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2102,16 +2146,16 @@ - (void)testSendClusterDoorLockReadAttributeLockType [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDoorLockReadAttributeActuatorEnabled +- (void)testSendClusterDoorLockReadAttributeActuatorEnabledWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeActuatorEnabled"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeActuatorEnabledWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeActuatorEnabled:^(NSError * err, NSDictionary * values) { + [cluster readAttributeActuatorEnabledWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"DoorLock ActuatorEnabled Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2120,16 +2164,16 @@ - (void)testSendClusterDoorLockReadAttributeActuatorEnabled [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterDoorLockReadAttributeClusterRevision +- (void)testSendClusterDoorLockReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"DoorLockReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPDoorLock * cluster = [[CHIPDoorLock alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"DoorLock ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2138,16 +2182,17 @@ - (void)testSendClusterDoorLockReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGeneralCommissioningReadAttributeFabricId +- (void)testSendClusterGeneralCommissioningReadAttributeFabricIdWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningReadAttributeFabricId"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"GeneralCommissioningReadAttributeFabricIdWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFabricId:^(NSError * err, NSDictionary * values) { + [cluster readAttributeFabricIdWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GeneralCommissioning FabricId Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2156,16 +2201,17 @@ - (void)testSendClusterGeneralCommissioningReadAttributeFabricId [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumb +- (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumbWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningReadAttributeBreadcrumb"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"GeneralCommissioningReadAttributeBreadcrumbWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBreadcrumb:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBreadcrumbWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2174,9 +2220,9 @@ - (void)testSendClusterGeneralCommissioningReadAttributeBreadcrumb [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumb +- (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumbWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningWriteAttributeBreadcrumb"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningWriteAttributeBreadcrumbWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2184,25 +2230,26 @@ - (void)testSendClusterGeneralCommissioningWriteAttributeBreadcrumb XCTAssertNotNil(cluster); uint64_t value = 0x0000000000000000; - [cluster writeAttributeBreadcrumb:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBreadcrumbWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"GeneralCommissioning Breadcrumb Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGeneralCommissioningReadAttributeClusterRevision +- (void)testSendClusterGeneralCommissioningReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GeneralCommissioningReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"GeneralCommissioningReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGeneralCommissioning * cluster = [[CHIPGeneralCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GeneralCommissioning ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2211,16 +2258,16 @@ - (void)testSendClusterGeneralCommissioningReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroups +- (void)testSendClusterGroupKeyManagementReadAttributeGroupsWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroups"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupsWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeGroups:^(NSError * err, NSDictionary * values) { + [cluster readAttributeGroupsWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GroupKeyManagement Groups Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2229,16 +2276,17 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroups [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeys +- (void)testSendClusterGroupKeyManagementReadAttributeGroupKeysWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeys"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeGroupKeysWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeGroupKeys:^(NSError * err, NSDictionary * values) { + [cluster readAttributeGroupKeysWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GroupKeyManagement GroupKeys Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2247,16 +2295,17 @@ - (void)testSendClusterGroupKeyManagementReadAttributeGroupKeys [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupKeyManagementReadAttributeClusterRevision +- (void)testSendClusterGroupKeyManagementReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupKeyManagementReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"GroupKeyManagementReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGroupKeyManagement * cluster = [[CHIPGroupKeyManagement alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"GroupKeyManagement ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2265,16 +2314,16 @@ - (void)testSendClusterGroupKeyManagementReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupsReadAttributeNameSupport +- (void)testSendClusterGroupsReadAttributeNameSupportWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeNameSupport"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeNameSupportWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNameSupport:^(NSError * err, NSDictionary * values) { + [cluster readAttributeNameSupportWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Groups NameSupport Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2283,16 +2332,16 @@ - (void)testSendClusterGroupsReadAttributeNameSupport [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterGroupsReadAttributeClusterRevision +- (void)testSendClusterGroupsReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"GroupsReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPGroups * cluster = [[CHIPGroups alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Groups ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2301,16 +2350,16 @@ - (void)testSendClusterGroupsReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterIdentifyReadAttributeIdentifyTime +- (void)testSendClusterIdentifyReadAttributeIdentifyTimeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeIdentifyTimeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeIdentifyTime:^(NSError * err, NSDictionary * values) { + [cluster readAttributeIdentifyTimeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Identify IdentifyTime Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2319,9 +2368,9 @@ - (void)testSendClusterIdentifyReadAttributeIdentifyTime [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterIdentifyWriteAttributeIdentifyTime +- (void)testSendClusterIdentifyWriteAttributeIdentifyTimeWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyWriteAttributeIdentifyTime"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyWriteAttributeIdentifyTimeWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2329,25 +2378,25 @@ - (void)testSendClusterIdentifyWriteAttributeIdentifyTime XCTAssertNotNil(cluster); uint16_t value = 0x0000; - [cluster writeAttributeIdentifyTime:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Identify IdentifyTime Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeIdentifyTimeWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Identify IdentifyTime Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterIdentifyReadAttributeClusterRevision +- (void)testSendClusterIdentifyReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"IdentifyReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPIdentify * cluster = [[CHIPIdentify alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Identify ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2356,16 +2405,16 @@ - (void)testSendClusterIdentifyReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterLevelControlReadAttributeCurrentLevel +- (void)testSendClusterLevelControlReadAttributeCurrentLevelWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeCurrentLevel"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeCurrentLevelWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentLevel:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentLevelWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"LevelControl CurrentLevel Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2374,16 +2423,17 @@ - (void)testSendClusterLevelControlReadAttributeCurrentLevel [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterLevelControlReadAttributeClusterRevision +- (void)testSendClusterLevelControlReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"LevelControlReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"LevelControlReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPLevelControl * cluster = [[CHIPLevelControl alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"LevelControl ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2392,16 +2442,16 @@ - (void)testSendClusterLevelControlReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterLowPowerReadAttributeClusterRevision +- (void)testSendClusterLowPowerReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"LowPowerReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"LowPowerReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPLowPower * cluster = [[CHIPLowPower alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"LowPower ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2410,16 +2460,17 @@ - (void)testSendClusterLowPowerReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterNetworkCommissioningReadAttributeClusterRevision +- (void)testSendClusterNetworkCommissioningReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"NetworkCommissioningReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"NetworkCommissioningReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPNetworkCommissioning * cluster = [[CHIPNetworkCommissioning alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"NetworkCommissioning ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2428,16 +2479,16 @@ - (void)testSendClusterNetworkCommissioningReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOnOffReadAttributeOnOff +- (void)testSendClusterOnOffReadAttributeOnOffWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnOff"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeOnOffWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOnOff:^(NSError * err, NSDictionary * values) { + [cluster readAttributeOnOffWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"OnOff OnOff Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2446,16 +2497,16 @@ - (void)testSendClusterOnOffReadAttributeOnOff [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOnOffReadAttributeClusterRevision +- (void)testSendClusterOnOffReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"OnOffReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPOnOff * cluster = [[CHIPOnOff alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"OnOff ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2464,16 +2515,17 @@ - (void)testSendClusterOnOffReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOperationalCredentialsReadAttributeFabricsList +- (void)testSendClusterOperationalCredentialsReadAttributeFabricsListWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"OperationalCredentialsReadAttributeFabricsList"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"OperationalCredentialsReadAttributeFabricsListWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeFabricsList:^(NSError * err, NSDictionary * values) { + [cluster readAttributeFabricsListWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"OperationalCredentials FabricsList Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2482,16 +2534,17 @@ - (void)testSendClusterOperationalCredentialsReadAttributeFabricsList [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterOperationalCredentialsReadAttributeClusterRevision +- (void)testSendClusterOperationalCredentialsReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"OperationalCredentialsReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"OperationalCredentialsReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPOperationalCredentials * cluster = [[CHIPOperationalCredentials alloc] initWithDevice:device endpoint:0 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"OperationalCredentials ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2500,9 +2553,10 @@ - (void)testSendClusterOperationalCredentialsReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressure +- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressureWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxPressure"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxPressureWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2511,7 +2565,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressure queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxPressure:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMaxPressureWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl MaxPressure Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2520,9 +2574,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxPressure [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeed +- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeedWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxSpeed"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxSpeedWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2531,7 +2586,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeed queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxSpeed:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMaxSpeedWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl MaxSpeed Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2540,9 +2595,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxSpeed [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlow +- (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlowWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxFlow"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeMaxFlowWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2551,7 +2607,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlow queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxFlow:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMaxFlowWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl MaxFlow Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2560,10 +2616,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeMaxFlow [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperationMode +- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperationModeWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveOperationMode"]; + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveOperationModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2572,7 +2628,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperatio queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveOperationMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEffectiveOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl EffectiveOperationMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2581,10 +2637,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveOperatio [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlMode +- (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlModeWithResponseHandler { XCTestExpectation * expectation = - [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveControlMode"]; + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeEffectiveControlModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2593,7 +2649,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlM queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEffectiveControlMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEffectiveControlModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl EffectiveControlMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2602,9 +2658,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeEffectiveControlM [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacity +- (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacityWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeCapacity"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeCapacityWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2613,7 +2670,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacity queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCapacity:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCapacityWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl Capacity Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2622,9 +2679,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeCapacity [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationMode +- (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationModeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeOperationMode"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeOperationModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2633,7 +2691,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationMode queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOperationMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeOperationModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2642,9 +2700,10 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeOperationMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationMode +- (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationModeWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeOperationMode"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlWriteAttributeOperationModeWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2654,18 +2713,19 @@ - (void)testSendClusterPumpConfigurationAndControlWriteAttributeOperationMode XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeOperationMode:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeOperationModeWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"PumpConfigurationAndControl OperationMode Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevision +- (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"PumpConfigurationAndControlReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2674,7 +2734,7 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevision queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"PumpConfigurationAndControl ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2683,16 +2743,16 @@ - (void)testSendClusterPumpConfigurationAndControlReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeSceneCount +- (void)testSendClusterScenesReadAttributeSceneCountWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneCount"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneCountWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSceneCount:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSceneCountWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes SceneCount Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2701,16 +2761,16 @@ - (void)testSendClusterScenesReadAttributeSceneCount [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeCurrentScene +- (void)testSendClusterScenesReadAttributeCurrentSceneWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentScene"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentSceneWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentScene:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentSceneWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes CurrentScene Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2719,16 +2779,16 @@ - (void)testSendClusterScenesReadAttributeCurrentScene [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeCurrentGroup +- (void)testSendClusterScenesReadAttributeCurrentGroupWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentGroup"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeCurrentGroupWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentGroup:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentGroupWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes CurrentGroup Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2737,16 +2797,16 @@ - (void)testSendClusterScenesReadAttributeCurrentGroup [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeSceneValid +- (void)testSendClusterScenesReadAttributeSceneValidWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneValid"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeSceneValidWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSceneValid:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSceneValidWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes SceneValid Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2755,16 +2815,16 @@ - (void)testSendClusterScenesReadAttributeSceneValid [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeNameSupport +- (void)testSendClusterScenesReadAttributeNameSupportWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeNameSupport"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeNameSupportWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNameSupport:^(NSError * err, NSDictionary * values) { + [cluster readAttributeNameSupportWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes NameSupport Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2773,16 +2833,16 @@ - (void)testSendClusterScenesReadAttributeNameSupport [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterScenesReadAttributeClusterRevision +- (void)testSendClusterScenesReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ScenesReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPScenes * cluster = [[CHIPScenes alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Scenes ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2791,16 +2851,16 @@ - (void)testSendClusterScenesReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterSwitchReadAttributeNumberOfPositions +- (void)testSendClusterSwitchReadAttributeNumberOfPositionsWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeNumberOfPositions"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeNumberOfPositionsWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeNumberOfPositions:^(NSError * err, NSDictionary * values) { + [cluster readAttributeNumberOfPositionsWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Switch NumberOfPositions Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2809,16 +2869,16 @@ - (void)testSendClusterSwitchReadAttributeNumberOfPositions [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterSwitchReadAttributeCurrentPosition +- (void)testSendClusterSwitchReadAttributeCurrentPositionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeCurrentPosition"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeCurrentPositionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeCurrentPosition:^(NSError * err, NSDictionary * values) { + [cluster readAttributeCurrentPositionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Switch CurrentPosition Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2827,16 +2887,16 @@ - (void)testSendClusterSwitchReadAttributeCurrentPosition [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterSwitchReadAttributeClusterRevision +- (void)testSendClusterSwitchReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeClusterRevision"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"SwitchReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPSwitch * cluster = [[CHIPSwitch alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Switch ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2845,16 +2905,17 @@ - (void)testSendClusterSwitchReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValue +- (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValueWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMeasuredValue"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMeasuredValueWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMeasuredValue:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TemperatureMeasurement MeasuredValue Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2863,16 +2924,17 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMeasuredValue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValue +- (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValueWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMinMeasuredValue"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMinMeasuredValueWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMinMeasuredValue:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMinMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TemperatureMeasurement MinMeasuredValue Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2881,16 +2943,17 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMinMeasuredValue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValue +- (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValueWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMaxMeasuredValue"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"TemperatureMeasurementReadAttributeMaxMeasuredValueWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeMaxMeasuredValue:^(NSError * err, NSDictionary * values) { + [cluster readAttributeMaxMeasuredValueWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TemperatureMeasurement MaxMeasuredValue Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2899,16 +2962,17 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeMaxMeasuredValue [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevision +- (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TemperatureMeasurementReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"TemperatureMeasurementReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTemperatureMeasurement * cluster = [[CHIPTemperatureMeasurement alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TemperatureMeasurement ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2917,16 +2981,16 @@ - (void)testSendClusterTemperatureMeasurementReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeBoolean +- (void)testSendClusterTestClusterReadAttributeBooleanWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBoolean"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBooleanWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBoolean:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBooleanWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Boolean Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2935,9 +2999,9 @@ - (void)testSendClusterTestClusterReadAttributeBoolean [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeBoolean +- (void)testSendClusterTestClusterWriteAttributeBooleanWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBoolean"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBooleanWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2945,25 +3009,25 @@ - (void)testSendClusterTestClusterWriteAttributeBoolean XCTAssertNotNil(cluster); uint8_t value = 0; - [cluster writeAttributeBoolean:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Boolean Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBooleanWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Boolean Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeBitmap8 +- (void)testSendClusterTestClusterReadAttributeBitmap8WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap8"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap8WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap8:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBitmap8WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Bitmap8 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -2972,9 +3036,9 @@ - (void)testSendClusterTestClusterReadAttributeBitmap8 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeBitmap8 +- (void)testSendClusterTestClusterWriteAttributeBitmap8WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap8"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap8WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2982,25 +3046,25 @@ - (void)testSendClusterTestClusterWriteAttributeBitmap8 XCTAssertNotNil(cluster); uint8_t value = 0; - [cluster writeAttributeBitmap8:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Bitmap8 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBitmap8WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeBitmap16 +- (void)testSendClusterTestClusterReadAttributeBitmap16WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap16"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap16WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap16:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBitmap16WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Bitmap16 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3009,9 +3073,9 @@ - (void)testSendClusterTestClusterReadAttributeBitmap16 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeBitmap16 +- (void)testSendClusterTestClusterWriteAttributeBitmap16WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap16"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap16WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3019,25 +3083,25 @@ - (void)testSendClusterTestClusterWriteAttributeBitmap16 XCTAssertNotNil(cluster); uint16_t value = 0; - [cluster writeAttributeBitmap16:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Bitmap16 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBitmap16WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeBitmap32 +- (void)testSendClusterTestClusterReadAttributeBitmap32WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap32"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap32WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap32:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBitmap32WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Bitmap32 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3046,9 +3110,9 @@ - (void)testSendClusterTestClusterReadAttributeBitmap32 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeBitmap32 +- (void)testSendClusterTestClusterWriteAttributeBitmap32WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap32"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap32WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3056,25 +3120,25 @@ - (void)testSendClusterTestClusterWriteAttributeBitmap32 XCTAssertNotNil(cluster); uint32_t value = 0; - [cluster writeAttributeBitmap32:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Bitmap32 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBitmap32WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap32 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeBitmap64 +- (void)testSendClusterTestClusterReadAttributeBitmap64WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap64"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeBitmap64WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeBitmap64:^(NSError * err, NSDictionary * values) { + [cluster readAttributeBitmap64WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Bitmap64 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3083,9 +3147,9 @@ - (void)testSendClusterTestClusterReadAttributeBitmap64 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeBitmap64 +- (void)testSendClusterTestClusterWriteAttributeBitmap64WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap64"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeBitmap64WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3093,25 +3157,25 @@ - (void)testSendClusterTestClusterWriteAttributeBitmap64 XCTAssertNotNil(cluster); uint64_t value = 0; - [cluster writeAttributeBitmap64:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Bitmap64 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeBitmap64WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Bitmap64 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt8u +- (void)testSendClusterTestClusterReadAttributeInt8uWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8uWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8u:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int8u Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3120,9 +3184,9 @@ - (void)testSendClusterTestClusterReadAttributeInt8u [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt8u +- (void)testSendClusterTestClusterWriteAttributeInt8uWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8uWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3130,25 +3194,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt8u XCTAssertNotNil(cluster); uint8_t value = 0; - [cluster writeAttributeInt8u:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int8u Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt8uWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt16u +- (void)testSendClusterTestClusterReadAttributeInt16uWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16uWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16u:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt16uWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int16u Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3157,9 +3221,9 @@ - (void)testSendClusterTestClusterReadAttributeInt16u [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt16u +- (void)testSendClusterTestClusterWriteAttributeInt16uWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16uWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3167,25 +3231,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt16u XCTAssertNotNil(cluster); uint16_t value = 0; - [cluster writeAttributeInt16u:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int16u Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt16uWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt32u +- (void)testSendClusterTestClusterReadAttributeInt32uWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32uWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32u:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt32uWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int32u Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3194,9 +3258,9 @@ - (void)testSendClusterTestClusterReadAttributeInt32u [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt32u +- (void)testSendClusterTestClusterWriteAttributeInt32uWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32uWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3204,25 +3268,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt32u XCTAssertNotNil(cluster); uint32_t value = 0; - [cluster writeAttributeInt32u:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int32u Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt32uWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt64u +- (void)testSendClusterTestClusterReadAttributeInt64uWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64uWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64u:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt64uWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int64u Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3231,9 +3295,9 @@ - (void)testSendClusterTestClusterReadAttributeInt64u [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt64u +- (void)testSendClusterTestClusterWriteAttributeInt64uWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64uWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3241,25 +3305,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt64u XCTAssertNotNil(cluster); uint64_t value = 0; - [cluster writeAttributeInt64u:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int64u Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt64uWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64u Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt8s +- (void)testSendClusterTestClusterReadAttributeInt8sWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt8sWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt8s:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt8sWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int8s Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3268,9 +3332,9 @@ - (void)testSendClusterTestClusterReadAttributeInt8s [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt8s +- (void)testSendClusterTestClusterWriteAttributeInt8sWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt8sWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3278,25 +3342,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt8s XCTAssertNotNil(cluster); int8_t value = 0; - [cluster writeAttributeInt8s:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int8s Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt8sWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int8s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt16s +- (void)testSendClusterTestClusterReadAttributeInt16sWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt16sWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt16s:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt16sWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int16s Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3305,9 +3369,9 @@ - (void)testSendClusterTestClusterReadAttributeInt16s [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt16s +- (void)testSendClusterTestClusterWriteAttributeInt16sWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt16sWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3315,25 +3379,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt16s XCTAssertNotNil(cluster); int16_t value = 0; - [cluster writeAttributeInt16s:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int16s Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt16sWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int16s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt32s +- (void)testSendClusterTestClusterReadAttributeInt32sWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt32sWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt32s:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt32sWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int32s Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3342,9 +3406,9 @@ - (void)testSendClusterTestClusterReadAttributeInt32s [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt32s +- (void)testSendClusterTestClusterWriteAttributeInt32sWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt32sWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3352,25 +3416,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt32s XCTAssertNotNil(cluster); int32_t value = 0; - [cluster writeAttributeInt32s:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int32s Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt32sWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int32s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeInt64s +- (void)testSendClusterTestClusterReadAttributeInt64sWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeInt64sWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeInt64s:^(NSError * err, NSDictionary * values) { + [cluster readAttributeInt64sWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Int64s Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3379,9 +3443,9 @@ - (void)testSendClusterTestClusterReadAttributeInt64s [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeInt64s +- (void)testSendClusterTestClusterWriteAttributeInt64sWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64s"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeInt64sWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3389,25 +3453,25 @@ - (void)testSendClusterTestClusterWriteAttributeInt64s XCTAssertNotNil(cluster); int64_t value = 0; - [cluster writeAttributeInt64s:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Int64s Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeInt64sWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Int64s Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeEnum8 +- (void)testSendClusterTestClusterReadAttributeEnum8WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum8"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum8WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum8:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEnum8WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Enum8 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3416,9 +3480,9 @@ - (void)testSendClusterTestClusterReadAttributeEnum8 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeEnum8 +- (void)testSendClusterTestClusterWriteAttributeEnum8WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum8"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum8WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3426,25 +3490,25 @@ - (void)testSendClusterTestClusterWriteAttributeEnum8 XCTAssertNotNil(cluster); uint8_t value = 0; - [cluster writeAttributeEnum8:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Enum8 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeEnum8WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum8 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeEnum16 +- (void)testSendClusterTestClusterReadAttributeEnum16WithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum16"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeEnum16WithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeEnum16:^(NSError * err, NSDictionary * values) { + [cluster readAttributeEnum16WithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster Enum16 Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3453,9 +3517,9 @@ - (void)testSendClusterTestClusterReadAttributeEnum16 [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeEnum16 +- (void)testSendClusterTestClusterWriteAttributeEnum16WithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum16"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeEnum16WithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3463,25 +3527,25 @@ - (void)testSendClusterTestClusterWriteAttributeEnum16 XCTAssertNotNil(cluster); uint16_t value = 0; - [cluster writeAttributeEnum16:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster Enum16 Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeEnum16WithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster Enum16 Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeOctetString +- (void)testSendClusterTestClusterReadAttributeOctetStringWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeOctetString"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeOctetStringWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOctetString:^(NSError * err, NSDictionary * values) { + [cluster readAttributeOctetStringWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster OctetString Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3490,9 +3554,9 @@ - (void)testSendClusterTestClusterReadAttributeOctetString [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterWriteAttributeOctetString +- (void)testSendClusterTestClusterWriteAttributeOctetStringWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeOctetString"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterWriteAttributeOctetStringWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3500,25 +3564,25 @@ - (void)testSendClusterTestClusterWriteAttributeOctetString XCTAssertNotNil(cluster); NSData * value = [@"Test" dataUsingEncoding:NSUTF8StringEncoding]; - [cluster writeAttributeOctetString:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"TestCluster OctetString Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeOctetStringWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"TestCluster OctetString Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeListInt8u +- (void)testSendClusterTestClusterReadAttributeListInt8uWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeListInt8u"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeListInt8uWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeListInt8u:^(NSError * err, NSDictionary * values) { + [cluster readAttributeListInt8uWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster ListInt8u Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3527,16 +3591,17 @@ - (void)testSendClusterTestClusterReadAttributeListInt8u [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterTestClusterReadAttributeClusterRevision +- (void)testSendClusterTestClusterReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"TestClusterReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"TestClusterReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPTestCluster * cluster = [[CHIPTestCluster alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"TestCluster ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3545,16 +3610,17 @@ - (void)testSendClusterTestClusterReadAttributeClusterRevision [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeLocalTemperature +- (void)testSendClusterThermostatReadAttributeLocalTemperatureWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeLocalTemperature"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeLocalTemperatureWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeLocalTemperature:^(NSError * err, NSDictionary * values) { + [cluster readAttributeLocalTemperatureWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat LocalTemperature Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3563,16 +3629,17 @@ - (void)testSendClusterThermostatReadAttributeLocalTemperature [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeOccupiedCoolingSetpoint +- (void)testSendClusterThermostatReadAttributeOccupiedCoolingSetpointWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeOccupiedCoolingSetpoint"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeOccupiedCoolingSetpointWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOccupiedCoolingSetpoint:^(NSError * err, NSDictionary * values) { + [cluster readAttributeOccupiedCoolingSetpointWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat OccupiedCoolingSetpoint Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3581,9 +3648,9 @@ - (void)testSendClusterThermostatReadAttributeOccupiedCoolingSetpoint [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatWriteAttributeOccupiedCoolingSetpoint +- (void)testSendClusterThermostatWriteAttributeOccupiedCoolingSetpointWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeOccupiedCoolingSetpoint"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeOccupiedCoolingSetpointWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3591,25 +3658,26 @@ - (void)testSendClusterThermostatWriteAttributeOccupiedCoolingSetpoint XCTAssertNotNil(cluster); int16_t value = 0; - [cluster writeAttributeOccupiedCoolingSetpoint:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat OccupiedCoolingSetpoint Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeOccupiedCoolingSetpointWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat OccupiedCoolingSetpoint Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeOccupiedHeatingSetpoint +- (void)testSendClusterThermostatReadAttributeOccupiedHeatingSetpointWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeOccupiedHeatingSetpoint"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeOccupiedHeatingSetpointWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeOccupiedHeatingSetpoint:^(NSError * err, NSDictionary * values) { + [cluster readAttributeOccupiedHeatingSetpointWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat OccupiedHeatingSetpoint Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3618,9 +3686,9 @@ - (void)testSendClusterThermostatReadAttributeOccupiedHeatingSetpoint [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatWriteAttributeOccupiedHeatingSetpoint +- (void)testSendClusterThermostatWriteAttributeOccupiedHeatingSetpointWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeOccupiedHeatingSetpoint"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeOccupiedHeatingSetpointWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3628,25 +3696,26 @@ - (void)testSendClusterThermostatWriteAttributeOccupiedHeatingSetpoint XCTAssertNotNil(cluster); int16_t value = 0; - [cluster writeAttributeOccupiedHeatingSetpoint:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat OccupiedHeatingSetpoint Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeOccupiedHeatingSetpointWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat OccupiedHeatingSetpoint Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeControlSequenceOfOperation +- (void)testSendClusterThermostatReadAttributeControlSequenceOfOperationWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeControlSequenceOfOperation"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeControlSequenceOfOperationWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeControlSequenceOfOperation:^(NSError * err, NSDictionary * values) { + [cluster readAttributeControlSequenceOfOperationWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat ControlSequenceOfOperation Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3655,9 +3724,10 @@ - (void)testSendClusterThermostatReadAttributeControlSequenceOfOperation [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatWriteAttributeControlSequenceOfOperation +- (void)testSendClusterThermostatWriteAttributeControlSequenceOfOperationWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeControlSequenceOfOperation"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatWriteAttributeControlSequenceOfOperationWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3665,25 +3735,25 @@ - (void)testSendClusterThermostatWriteAttributeControlSequenceOfOperation XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeControlSequenceOfOperation:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat ControlSequenceOfOperation Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeControlSequenceOfOperationWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat ControlSequenceOfOperation Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeSystemMode +- (void)testSendClusterThermostatReadAttributeSystemModeWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeSystemMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeSystemModeWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeSystemMode:^(NSError * err, NSDictionary * values) { + [cluster readAttributeSystemModeWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat SystemMode Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; @@ -3692,9 +3762,9 @@ - (void)testSendClusterThermostatReadAttributeSystemMode [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatWriteAttributeSystemMode +- (void)testSendClusterThermostatWriteAttributeSystemModeWithValue { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeSystemMode"]; + XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatWriteAttributeSystemModeWithValue"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); @@ -3702,25 +3772,26 @@ - (void)testSendClusterThermostatWriteAttributeSystemMode XCTAssertNotNil(cluster); uint8_t value = 0x00; - [cluster writeAttributeSystemMode:value - completionHandler:^(NSError * err, NSDictionary * values) { - NSLog(@"Thermostat SystemMode Error: %@", err); - XCTAssertEqual(err.code, 0); - [expectation fulfill]; - }]; + [cluster writeAttributeSystemModeWithValue:value + responseHandler:^(NSError * err, NSDictionary * values) { + NSLog(@"Thermostat SystemMode Error: %@", err); + XCTAssertEqual(err.code, 0); + [expectation fulfill]; + }]; [self waitForExpectationsWithTimeout:kTimeoutInSeconds handler:nil]; } -- (void)testSendClusterThermostatReadAttributeClusterRevision +- (void)testSendClusterThermostatReadAttributeClusterRevisionWithResponseHandler { - XCTestExpectation * expectation = [self expectationWithDescription:@"ThermostatReadAttributeClusterRevision"]; + XCTestExpectation * expectation = + [self expectationWithDescription:@"ThermostatReadAttributeClusterRevisionWithResponseHandler"]; CHIPDevice * device = GetPairedDevice(kDeviceId); dispatch_queue_t queue = dispatch_get_main_queue(); CHIPThermostat * cluster = [[CHIPThermostat alloc] initWithDevice:device endpoint:1 queue:queue]; XCTAssertNotNil(cluster); - [cluster readAttributeClusterRevision:^(NSError * err, NSDictionary * values) { + [cluster readAttributeClusterRevisionWithResponseHandler:^(NSError * err, NSDictionary * values) { NSLog(@"Thermostat ClusterRevision Error: %@", err); XCTAssertEqual(err.code, 0); [expectation fulfill]; From 9b06b05f61559089188e8164e9451983cb62ff1c Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 4 May 2021 12:34:42 -0700 Subject: [PATCH 21/31] Disable CRMP if we send/receive messages not over UDP transport (#6407) * Disable CRMP if we send/receive messages not over UDP transport * Declare reliableTransmissionRequested when it is first use --- src/messaging/ExchangeContext.cpp | 12 +++++++++++- src/messaging/ExchangeMessageDispatch.cpp | 4 ++-- src/messaging/ExchangeMessageDispatch.h | 2 +- src/messaging/ReliableMessageMgr.cpp | 6 +++--- .../SessionEstablishmentExchangeDispatch.h | 6 +++--- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 92fb9873db8009..52672579ccf529 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -123,7 +123,17 @@ CHIP_ERROR ExchangeContext::SendMessageImpl(Protocols::Id protocolId, uint8_t ms // an error arising below. at the end, we have to close it. Retain(); - bool reliableTransmissionRequested = !sendFlags.Has(SendMessageFlags::kNoAutoRequestAck); + bool reliableTransmissionRequested = true; + + // If sending via UDP and NoAutoRequestAck send flag is not specificed, request reliable transmission. + if (state && state->GetPeerAddress().GetTransportType() != Transport::Type::kUdp) + { + reliableTransmissionRequested = false; + } + else + { + reliableTransmissionRequested = !sendFlags.Has(SendMessageFlags::kNoAutoRequestAck); + } ExchangeMessageDispatch * dispatch = GetMessageDispatch(); ApplicationExchangeDispatch defaultDispatch; diff --git a/src/messaging/ExchangeMessageDispatch.cpp b/src/messaging/ExchangeMessageDispatch.cpp index 0429eb62fa530a..5afc11d71cd525 100644 --- a/src/messaging/ExchangeMessageDispatch.cpp +++ b/src/messaging/ExchangeMessageDispatch.cpp @@ -65,7 +65,7 @@ CHIP_ERROR ExchangeMessageDispatch::SendMessage(SecureSessionHandle session, uin #endif } - if (!IsTransportReliable() && reliableMessageContext->AutoRequestAck() && mReliableMessageMgr != nullptr && + if (IsReliableTransmissionAllowed() && reliableMessageContext->AutoRequestAck() && mReliableMessageMgr != nullptr && isReliableTransmission) { payloadHeader.SetNeedsAck(true); @@ -105,7 +105,7 @@ CHIP_ERROR ExchangeMessageDispatch::OnMessageReceived(const PayloadHeader & payl ReturnErrorCodeIf(!MessagePermitted(payloadHeader.GetProtocolID().GetProtocolId(), payloadHeader.GetMessageType()), CHIP_ERROR_INVALID_ARGUMENT); - if (!IsTransportReliable()) + if (IsReliableTransmissionAllowed()) { if (payloadHeader.IsAckMsg() && payloadHeader.GetAckId().HasValue()) { diff --git a/src/messaging/ExchangeMessageDispatch.h b/src/messaging/ExchangeMessageDispatch.h index e48e1151d9106f..ef2cb596b28445 100644 --- a/src/messaging/ExchangeMessageDispatch.h +++ b/src/messaging/ExchangeMessageDispatch.h @@ -63,7 +63,7 @@ class ExchangeMessageDispatch virtual CHIP_ERROR SendMessageImpl(SecureSessionHandle session, PayloadHeader & payloadHeader, System::PacketBufferHandle && message, EncryptedPacketBufferHandle * retainedMessage) = 0; - virtual bool IsTransportReliable() { return false; } + virtual bool IsReliableTransmissionAllowed() { return true; } private: ReliableMessageMgr * mReliableMessageMgr = nullptr; diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 53fb46ad2d5a67..76f4b858ecc5d8 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -344,11 +344,11 @@ CHIP_ERROR ReliableMessageMgr::SendFromRetransTable(RetransTableEntry * entry) VerifyOrReturnError(rc != nullptr, err); - const ExchangeMessageDispatch * transport = rc->GetExchangeContext()->GetMessageDispatch(); - VerifyOrExit(transport != nullptr, err = CHIP_ERROR_INCORRECT_STATE); + const ExchangeMessageDispatch * dispatcher = rc->GetExchangeContext()->GetMessageDispatch(); + VerifyOrExit(dispatcher != nullptr, err = CHIP_ERROR_INCORRECT_STATE); err = - transport->ResendMessage(rc->GetExchangeContext()->GetSecureSession(), std::move(entry->retainedBuf), &entry->retainedBuf); + dispatcher->ResendMessage(rc->GetExchangeContext()->GetSecureSession(), std::move(entry->retainedBuf), &entry->retainedBuf); SuccessOrExit(err); // Update the counters diff --git a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h index 3d78091ab3a335..b222d7b318ab7b 100644 --- a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h +++ b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.h @@ -57,10 +57,10 @@ class SessionEstablishmentExchangeDispatch : public Messaging::ExchangeMessageDi bool MessagePermitted(uint16_t protocol, uint8_t type) override; - bool IsTransportReliable() override + bool IsReliableTransmissionAllowed() override { - // If the underlying transport is not UDP. - return (mPeerAddress.GetTransportType() != Transport::Type::kUdp); + // If the underlying transport is UDP. + return (mPeerAddress.GetTransportType() == Transport::Type::kUdp); } private: From 0f443b8502f530ddb79e480d372ce5ec53749e01 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 4 May 2021 14:21:10 -0700 Subject: [PATCH 22/31] Delete RendezvousSession, and move code to controller and server (#6437) * Delete RendezvousSession, and move code to controller and server * some cleanup * some more cleanup * fix Android build * more fixes to Android build * update commented out code --- .../commands/pairing/PairingCommand.cpp | 6 +- .../commands/pairing/PairingCommand.h | 2 +- scripts/tools/memory/README.md | 2 +- src/app/server/RendezvousServer.cpp | 132 +++++++----- src/app/server/RendezvousServer.h | 37 ++-- src/app/server/Server.cpp | 9 +- src/channel/ChannelContext.cpp | 13 -- src/channel/ChannelContext.h | 4 - src/controller/CHIPDeviceController.cpp | 92 ++++---- src/controller/CHIPDeviceController.h | 23 +- .../java/AndroidDeviceControllerWrapper.cpp | 2 +- .../java/AndroidDeviceControllerWrapper.h | 2 +- ...Controller-ScriptDevicePairingDelegate.cpp | 2 - ...ceController-ScriptDevicePairingDelegate.h | 1 - .../CHIP/CHIPDevicePairingDelegateBridge.h | 4 +- .../CHIP/CHIPDevicePairingDelegateBridge.mm | 8 +- src/protocols/secure_channel/BUILD.gn | 2 - .../secure_channel/RendezvousSession.cpp | 204 ------------------ .../secure_channel/RendezvousSession.h | 134 ------------ src/transport/BUILD.gn | 1 - src/transport/RendezvousSessionDelegate.h | 47 ---- src/transport/SessionEstablishmentDelegate.h | 17 -- 22 files changed, 183 insertions(+), 561 deletions(-) delete mode 100644 src/protocols/secure_channel/RendezvousSession.cpp delete mode 100644 src/protocols/secure_channel/RendezvousSession.h delete mode 100644 src/transport/RendezvousSessionDelegate.h diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index 1d478c6b7801e5..8c48633dca2c7d 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -108,14 +108,14 @@ CHIP_ERROR PairingCommand::Unpair(NodeId remoteId) return mCommissioner.UnpairDevice(remoteId); } -void PairingCommand::OnStatusUpdate(RendezvousSessionDelegate::Status status) +void PairingCommand::OnStatusUpdate(DevicePairingDelegate::Status status) { switch (status) { - case RendezvousSessionDelegate::Status::SecurePairingSuccess: + case DevicePairingDelegate::Status::SecurePairingSuccess: ChipLogProgress(chipTool, "Secure Pairing Success"); break; - case RendezvousSessionDelegate::Status::SecurePairingFailed: + case DevicePairingDelegate::Status::SecurePairingFailed: ChipLogError(chipTool, "Secure Pairing Failed"); break; } diff --git a/examples/chip-tool/commands/pairing/PairingCommand.h b/examples/chip-tool/commands/pairing/PairingCommand.h index 485156a9170413..d0471386e7bd50 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.h +++ b/examples/chip-tool/commands/pairing/PairingCommand.h @@ -97,7 +97,7 @@ class PairingCommand : public Command, CHIP_ERROR Run(PersistentStorage & storage, NodeId localId, NodeId remoteId) override; /////////// DevicePairingDelegate Interface ///////// - void OnStatusUpdate(chip::RendezvousSessionDelegate::Status status) override; + void OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) override; void OnPairingComplete(CHIP_ERROR error) override; void OnPairingDeleted(CHIP_ERROR error) override; diff --git a/scripts/tools/memory/README.md b/scripts/tools/memory/README.md index 4997892b1c0af7..b2546ebe14dcdc 100644 --- a/scripts/tools/memory/README.md +++ b/scripts/tools/memory/README.md @@ -165,7 +165,7 @@ Example: $ diffsyms.py --demangle ${IMAGE1} ${IMAGE2} symbol a b chip::Inet::InetLayer::NewUDPEndPoint(chip::Inet::UDPEndPoint**) 196 194 -chip::Transport::BLE::Init(chip::RendezvousSessionDelegate*, chip::RendezvousParameters const&) 80 100 +chip::Transport::BLE::Init(chip::DevicePairingDelegate*, chip::RendezvousParameters const&) 80 100 ``` ### block.py diff --git a/src/app/server/RendezvousServer.cpp b/src/app/server/RendezvousServer.cpp index 89f66f65929bb4..f0ec390bb139eb 100644 --- a/src/app/server/RendezvousServer.cpp +++ b/src/app/server/RendezvousServer.cpp @@ -33,76 +33,112 @@ using namespace ::chip::Transport; using namespace ::chip::DeviceLayer; namespace chip { - -RendezvousServer::RendezvousServer() : mRendezvousSession(this) {} +static constexpr uint32_t kSpake2p_Iteration_Count = 100; +static const char * kSpake2pKeyExchangeSalt = "SPAKE2P Key Salt"; CHIP_ERROR RendezvousServer::WaitForPairing(const RendezvousParameters & params, Messaging::ExchangeManager * exchangeManager, TransportMgrBase * transportMgr, SecureSessionMgr * sessionMgr, Transport::AdminPairingInfo * admin) { - return mRendezvousSession.Init(params, exchangeManager, transportMgr, sessionMgr, admin); + VerifyOrReturnError(transportMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(exchangeManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(sessionMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(admin != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(params.HasSetupPINCode() || params.HasPASEVerifier(), CHIP_ERROR_INVALID_ARGUMENT); + +#if CONFIG_NETWORK_LAYER_BLE + VerifyOrReturnError(params.HasAdvertisementDelegate(), CHIP_ERROR_INVALID_ARGUMENT); +#endif + + mAdvDelegate = params.GetAdvertisementDelegate(); + + // Note: Since BLE is only used for initial setup, enable BLE advertisement in rendezvous session can be expected. + if (params.GetPeerAddress().GetTransportType() == Transport::Type::kBle) +#if CONFIG_NETWORK_LAYER_BLE + { + ReturnErrorOnFailure(GetAdvertisementDelegate()->StartAdvertisement()); + } +#else + { + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } +#endif + mSessionMgr = sessionMgr; + mAdmin = admin; + mExchangeManager = exchangeManager; + + ReturnErrorOnFailure(mExchangeManager->RegisterUnsolicitedMessageHandlerForType( + Protocols::SecureChannel::MsgType::PBKDFParamRequest, &mPairingSession)); + + if (params.HasPASEVerifier()) + { + ReturnErrorOnFailure(mPairingSession.WaitForPairing(params.GetPASEVerifier(), mNextKeyId++, this)); + } + else + { + ReturnErrorOnFailure(mPairingSession.WaitForPairing(params.GetSetupPINCode(), kSpake2p_Iteration_Count, + reinterpret_cast(kSpake2pKeyExchangeSalt), + strlen(kSpake2pKeyExchangeSalt), mNextKeyId++, this)); + } + + ReturnErrorOnFailure(mPairingSession.MessageDispatch().Init(transportMgr)); + mPairingSession.MessageDispatch().SetPeerAddress(params.GetPeerAddress()); + + return CHIP_NO_ERROR; } -void RendezvousServer::OnRendezvousError(CHIP_ERROR err) +void RendezvousServer::Cleanup() { - ChipLogProgress(AppServer, "OnRendezvousError: %s", ErrorStr(err)); + mExchangeManager->UnregisterUnsolicitedMessageHandlerForType(Protocols::SecureChannel::MsgType::PBKDFParamRequest); + + if (HasAdvertisementDelegate()) + { + GetAdvertisementDelegate()->StopAdvertisement(); + } } -void RendezvousServer::OnRendezvousConnectionOpened() +void RendezvousServer::OnSessionEstablishmentError(CHIP_ERROR err) { - ChipLogProgress(AppServer, "OnRendezvousConnectionOpened"); + Cleanup(); + + ChipLogProgress(AppServer, "OnSessionEstablishmentError: %s", ErrorStr(err)); + ChipLogProgress(AppServer, "Failed in SPAKE2+ handshake"); + + if (mDelegate != nullptr) + { + mDelegate->OnRendezvousStopped(); + } } -void RendezvousServer::OnRendezvousConnectionClosed() +void RendezvousServer::OnSessionEstablished() { - ChipLogProgress(AppServer, "OnRendezvousConnectionClosed"); -} + CHIP_ERROR err = + mSessionMgr->NewPairing(Optional::Value(mPairingSession.PeerConnection().GetPeerAddress()), + mPairingSession.PeerConnection().GetPeerNodeId(), &mPairingSession, + SecureSessionMgr::PairingDirection::kResponder, mAdmin->GetAdminId(), nullptr); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Ble, "Failed in setting up secure channel: err %s", ErrorStr(err)); + OnSessionEstablishmentError(err); + return; + } + + ChipLogProgress(AppServer, "Device completed SPAKE2+ handshake"); + if (mDelegate != nullptr) + { + mDelegate->OnRendezvousStarted(); + } -void RendezvousServer::OnRendezvousMessageReceived(const PacketHeader & packetHeader, const PeerAddress & peerAddress, - System::PacketBufferHandle buffer) -{} + Cleanup(); -void RendezvousServer::OnRendezvousComplete() -{ ChipLogProgress(AppServer, "Device completed Rendezvous process"); - StorablePeerConnection connection(mRendezvousSession.GetPairingSession(), mRendezvousSession.GetAdminId()); + StorablePeerConnection connection(mPairingSession, mAdmin->GetAdminId()); VerifyOrReturn(mStorage != nullptr, ChipLogError(AppServer, "Storage delegate is not available. Cannot store the connection state")); VerifyOrReturn(connection.StoreIntoKVS(*mStorage) == CHIP_NO_ERROR, ChipLogError(AppServer, "Failed to store the connection state")); - uint16_t nextKeyId = mRendezvousSession.GetNextKeyId(); - mStorage->SyncSetKeyValue(kStorablePeerConnectionCountKey, &nextKeyId, sizeof(nextKeyId)); -} - -void RendezvousServer::OnRendezvousStatusUpdate(Status status, CHIP_ERROR err) -{ - VerifyOrExit(err == CHIP_NO_ERROR, ChipLogError(AppServer, "OnRendezvousStatusUpdate: %s", chip::ErrorStr(err))); - - switch (status) - { - case RendezvousSessionDelegate::SecurePairingSuccess: - ChipLogProgress(AppServer, "Device completed SPAKE2+ handshake"); - if (mDelegate != nullptr) - { - mDelegate->OnRendezvousStarted(); - } - break; - - case RendezvousSessionDelegate::SecurePairingFailed: - ChipLogProgress(AppServer, "Failed in SPAKE2+ handshake"); - if (mDelegate != nullptr) - { - mDelegate->OnRendezvousStopped(); - } - break; - - default: - break; - }; - -exit: - return; + mStorage->SyncSetKeyValue(kStorablePeerConnectionCountKey, &mNextKeyId, sizeof(mNextKeyId)); } } // namespace chip diff --git a/src/app/server/RendezvousServer.h b/src/app/server/RendezvousServer.h index 49b38906c04674..0a0b89424bcf37 100644 --- a/src/app/server/RendezvousServer.h +++ b/src/app/server/RendezvousServer.h @@ -21,15 +21,13 @@ #include #include #include -#include +#include namespace chip { -class RendezvousServer : public RendezvousSessionDelegate +class RendezvousServer : public SessionEstablishmentDelegate { public: - RendezvousServer(); - CHIP_ERROR WaitForPairing(const RendezvousParameters & params, Messaging::ExchangeManager * exchangeManager, TransportMgrBase * transportMgr, SecureSessionMgr * sessionMgr, Transport::AdminPairingInfo * admin); @@ -41,21 +39,30 @@ class RendezvousServer : public RendezvousSessionDelegate return CHIP_NO_ERROR; } - //////////////// RendezvousSessionDelegate Implementation /////////////////// + //////////// SessionEstablishmentDelegate Implementation /////////////// + void OnSessionEstablishmentError(CHIP_ERROR error) override; + void OnSessionEstablished() override; + + void Cleanup(); - void OnRendezvousConnectionOpened() override; - void OnRendezvousConnectionClosed() override; - void OnRendezvousError(CHIP_ERROR err) override; - void OnRendezvousMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle buffer) override; - void OnRendezvousComplete() override; - void OnRendezvousStatusUpdate(Status status, CHIP_ERROR err) override; - RendezvousSession * GetRendezvousSession() { return &mRendezvousSession; }; + uint16_t GetNextKeyId() const { return mNextKeyId; } + void SetNextKeyId(uint16_t id) { mNextKeyId = id; } private: - RendezvousSession mRendezvousSession; AppDelegate * mDelegate; - PersistentStorageDelegate * mStorage = nullptr; + PersistentStorageDelegate * mStorage = nullptr; + Messaging::ExchangeManager * mExchangeManager = nullptr; + + PASESession mPairingSession; + uint16_t mNextKeyId = 0; + SecureSessionMgr * mSessionMgr = nullptr; + + Transport::AdminPairingInfo * mAdmin = nullptr; + + const RendezvousAdvertisementDelegate * mAdvDelegate; + + bool HasAdvertisementDelegate() const { return mAdvDelegate != nullptr; } + const RendezvousAdvertisementDelegate * GetAdvertisementDelegate() const { return mAdvDelegate; } }; } // namespace chip diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index c300b4df8a9d64..be49257c525f1c 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -184,7 +184,7 @@ static CHIP_ERROR RestoreAllSessionsFromKVS(SecureSessionMgr & sessionMgr, Rende chip::Platform::Delete(session); - server.GetRendezvousSession()->SetNextKeyId(nextSessionKeyId); + server.SetNextKeyId(nextSessionKeyId); return CHIP_NO_ERROR; } @@ -262,9 +262,10 @@ class ServerRendezvousAdvertisementDelegate : public RendezvousAdvertisementDele { ReturnErrorOnFailure(chip::DeviceLayer::ConnectivityMgr().SetBLEAdvertisingEnabled(false)); } + + if (mDelegate != nullptr) { - if (mDelegate != nullptr) - mDelegate->OnPairingWindowClosed(); + mDelegate->OnPairingWindowClosed(); } AdminPairingInfo * admin = gAdminPairings.FindAdmin(mAdmin); @@ -429,7 +430,7 @@ CHIP_ERROR OpenDefaultPairingWindow(ResetAdmins resetAdmins, chip::PairingWindow if (resetAdmins == ResetAdmins::kYes) { - uint16_t nextKeyId = gRendezvousServer.GetRendezvousSession()->GetNextKeyId(); + uint16_t nextKeyId = gRendezvousServer.GetNextKeyId(); EraseAllAdminPairingsUpTo(gNextAvailableAdminId); EraseAllSessionsUpTo(nextKeyId); gNextAvailableAdminId = 0; diff --git a/src/channel/ChannelContext.cpp b/src/channel/ChannelContext.cpp index c7f5f607fa8353..df550c23504e30 100644 --- a/src/channel/ChannelContext.cpp +++ b/src/channel/ChannelContext.cpp @@ -251,19 +251,6 @@ void ChannelContext::HandleNodeIdResolve(CHIP_ERROR error, uint64_t nodeId, cons } } -// Session establishment -CHIP_ERROR ChannelContext::SendSessionEstablishmentMessage(const PacketHeader & header, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle msgIn) -{ - return mExchangeManager->GetSessionMgr()->GetTransportManager()->SendMessage(header, peerAddress, std::move(msgIn)); -} - -CHIP_ERROR ChannelContext::HandlePairingMessage(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle && msg) -{ - return CHIP_ERROR_INCORRECT_STATE; -} - void ChannelContext::EnterCasePairingState() { mStateVars.mPreparing.mState = PrepareState::kCasePairing; diff --git a/src/channel/ChannelContext.h b/src/channel/ChannelContext.h index 0b3420f19c24f3..5a97fee0bde2e9 100644 --- a/src/channel/ChannelContext.h +++ b/src/channel/ChannelContext.h @@ -111,10 +111,6 @@ class ChannelContext : public ReferenceCounted(this); - VerifyOrExit(mRendezvousSession != nullptr, err = CHIP_ERROR_NO_MEMORY); - mRendezvousSession->SetNextKeyId(mNextKeyId); - err = mRendezvousSession->Init(params.SetLocalNodeId(mLocalDeviceId).SetRemoteNodeId(remoteDeviceId), mExchangeMgr, - mTransportMgr, mSessionMgr, admin); + mIsIPRendezvous = (params.GetPeerAddress().GetTransportType() != Transport::Type::kBle); + + err = mPairingSession.MessageDispatch().Init(mTransportMgr); SuccessOrExit(err); + mPairingSession.MessageDispatch().SetPeerAddress(params.GetPeerAddress()); device->Init(GetControllerDeviceInitParams(), mListenPort, remoteDeviceId, peerAddress, admin->GetAdminId()); @@ -753,7 +753,10 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam } } #endif - mRendezvousSession->OnRendezvousConnectionOpened(); + exchangeCtxt = mExchangeMgr->NewContext(SecureSessionHandle(), &mPairingSession); + VerifyOrExit(exchangeCtxt != nullptr, err = CHIP_ERROR_INTERNAL); + + err = mPairingSession.Pair(params.GetPeerAddress(), params.GetSetupPINCode(), mNextKeyId++, exchangeCtxt, this); exit: if (err != CHIP_NO_ERROR) @@ -801,7 +804,7 @@ CHIP_ERROR DeviceCommissioner::PairTestDeviceWithoutSecurity(NodeId remoteDevice device->Serialize(serialized); - OnRendezvousComplete(); + OnSessionEstablished(); exit: if (testSecurePairingSecret != nullptr) @@ -865,17 +868,14 @@ CHIP_ERROR DeviceCommissioner::UnpairDevice(NodeId remoteDeviceId) void DeviceCommissioner::FreeRendezvousSession() { - if (mRendezvousSession != nullptr) - { - mNextKeyId = mRendezvousSession->GetNextKeyId(); - PersistNextKeyId(); - chip::Platform::Delete(mRendezvousSession); - mRendezvousSession = nullptr; - } + PersistNextKeyId(); } void DeviceCommissioner::RendezvousCleanup(CHIP_ERROR status) { + mRendezvousAdvDelegate.StopAdvertisement(); + mRendezvousAdvDelegate.RendezvousComplete(); + FreeRendezvousSession(); // TODO: make mStorageDelegate mandatory once all controller applications implement the interface. @@ -897,54 +897,52 @@ void DeviceCommissioner::RendezvousCleanup(CHIP_ERROR status) } } -void DeviceCommissioner::OnRendezvousError(CHIP_ERROR err) +void DeviceCommissioner::OnSessionEstablishmentError(CHIP_ERROR err) { + mSystemLayer->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); + + if (mPairingDelegate != nullptr) + { + mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingFailed); + } + RendezvousCleanup(err); } -void DeviceCommissioner::OnRendezvousComplete() +void DeviceCommissioner::OnSessionEstablished() { - VerifyOrReturn(mDeviceBeingPaired < kNumMaxActiveDevices, OnRendezvousError(CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR)); + VerifyOrReturn(mDeviceBeingPaired < kNumMaxActiveDevices, OnSessionEstablishmentError(CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR)); Device * device = &mActiveDevices[mDeviceBeingPaired]; - mPairedDevices.Insert(device->GetDeviceId()); - mPairedDevicesUpdated = true; - PersistDevice(device); + mPairingSession.PeerConnection().SetPeerNodeId(device->GetDeviceId()); - RendezvousCleanup(CHIP_NO_ERROR); -} - -void DeviceCommissioner::OnRendezvousStatusUpdate(RendezvousSessionDelegate::Status status, CHIP_ERROR err) -{ - Device * device = nullptr; - if (mDeviceBeingPaired >= kNumMaxActiveDevices) + CHIP_ERROR err = + mSessionMgr->NewPairing(Optional::Value(mPairingSession.PeerConnection().GetPeerAddress()), + mPairingSession.PeerConnection().GetPeerNodeId(), &mPairingSession, + SecureSessionMgr::PairingDirection::kInitiator, mAdminId, nullptr); + if (err != CHIP_NO_ERROR) { - ExitNow(); + ChipLogError(Ble, "Failed in setting up secure channel: err %s", ErrorStr(err)); + OnSessionEstablishmentError(err); + return; } - device = &mActiveDevices[mDeviceBeingPaired]; - switch (status) - { - case RendezvousSessionDelegate::SecurePairingSuccess: - ChipLogDetail(Controller, "Remote device completed SPAKE2+ handshake\n"); - mRendezvousSession->GetPairingSession().ToSerializable(device->GetPairing()); - mSystemLayer->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); - break; + ChipLogDetail(Controller, "Remote device completed SPAKE2+ handshake\n"); + mPairingSession.ToSerializable(device->GetPairing()); + mSystemLayer->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); - case RendezvousSessionDelegate::SecurePairingFailed: - ChipLogDetail(Controller, "Remote device failed in SPAKE2+ handshake\n"); - mSystemLayer->CancelTimer(OnSessionEstablishmentTimeoutCallback, this); - break; + mPairedDevices.Insert(device->GetDeviceId()); + mPairedDevicesUpdated = true; + + PersistDevice(device); - default: - break; - }; -exit: if (mPairingDelegate != nullptr) { - mPairingDelegate->OnStatusUpdate(status); + mPairingDelegate->OnStatusUpdate(DevicePairingDelegate::SecurePairingSuccess); } + + RendezvousCleanup(CHIP_NO_ERROR); } void DeviceCommissioner::PersistDeviceList() diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 315fc515af7444..a6c5ae9fb07736 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -35,11 +35,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -85,13 +84,19 @@ class DLL_EXPORT DevicePairingDelegate public: virtual ~DevicePairingDelegate() {} + enum Status : uint8_t + { + SecurePairingSuccess = 0, + SecurePairingFailed, + }; + /** * @brief * Called when the pairing reaches a certain stage. * * @param status Current status of pairing */ - virtual void OnStatusUpdate(RendezvousSessionDelegate::Status status) {} + virtual void OnStatusUpdate(DevicePairingDelegate::Status status) {} /** * @brief @@ -294,7 +299,7 @@ class DeviceCommissionerRendezvousAdvertisementDelegate : public RendezvousAdver * required to provide write access to the persistent storage, where the paired device information * will be stored. */ -class DLL_EXPORT DeviceCommissioner : public DeviceController, public RendezvousSessionDelegate +class DLL_EXPORT DeviceCommissioner : public DeviceController, public SessionEstablishmentDelegate { public: DeviceCommissioner(); @@ -348,10 +353,9 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, public Rendezvous */ CHIP_ERROR UnpairDevice(NodeId remoteDeviceId); - //////////// RendezvousSessionDelegate Implementation /////////////// - void OnRendezvousError(CHIP_ERROR err) override; - void OnRendezvousComplete() override; - void OnRendezvousStatusUpdate(RendezvousSessionDelegate::Status status, CHIP_ERROR err) override; + //////////// SessionEstablishmentDelegate Implementation /////////////// + void OnSessionEstablishmentError(CHIP_ERROR error) override; + void OnSessionEstablished() override; void RendezvousCleanup(CHIP_ERROR status); @@ -370,7 +374,6 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, public Rendezvous private: DevicePairingDelegate * mPairingDelegate; - RendezvousSession * mRendezvousSession; /* This field is an index in mActiveDevices list. The object at this index in the list contains the device object that's tracking the state of the device that's being paired. @@ -403,6 +406,8 @@ class DLL_EXPORT DeviceCommissioner : public DeviceController, public Rendezvous static void OnSessionEstablishmentTimeoutCallback(System::Layer * aLayer, void * aAppState, System::Error aError); uint16_t mNextKeyId = 0; + + PASESession mPairingSession; }; } // namespace Controller diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index 965d8f7d813f7d..9685260e014e82 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -215,7 +215,7 @@ AndroidDeviceControllerWrapper * AndroidDeviceControllerWrapper::AllocateNew(Jav return wrapper.release(); } -void AndroidDeviceControllerWrapper::OnStatusUpdate(chip::RendezvousSessionDelegate::Status status) +void AndroidDeviceControllerWrapper::OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) { CallVoidInt(GetJavaEnv(), mJavaObjectRef, "onStatusUpdate", static_cast(status)); } diff --git a/src/controller/java/AndroidDeviceControllerWrapper.h b/src/controller/java/AndroidDeviceControllerWrapper.h index 23ee074b386b4c..a057c9ab7b34c0 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.h +++ b/src/controller/java/AndroidDeviceControllerWrapper.h @@ -41,7 +41,7 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel void SetJavaObjectRef(JavaVM * vm, jobject obj); // DevicePairingDelegate implementation - void OnStatusUpdate(chip::RendezvousSessionDelegate::Status status) override; + void OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) override; void OnPairingComplete(CHIP_ERROR error) override; void OnPairingDeleted(CHIP_ERROR error) override; diff --git a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp index 4217c4d218838c..db530aa98f0035 100644 --- a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp +++ b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp @@ -19,8 +19,6 @@ #include "ChipDeviceController-ScriptDevicePairingDelegate.h" -#include - namespace chip { namespace Controller { diff --git a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.h b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.h index a08e8f877b803d..66bc38228b1135 100644 --- a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.h +++ b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.h @@ -26,7 +26,6 @@ #pragma once #include -#include namespace chip { namespace Controller { diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h index be73e3b3e1838f..c7ae4779ccb0c8 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.h @@ -32,7 +32,7 @@ class CHIPDevicePairingDelegateBridge : public chip::Controller::DevicePairingDe void setDelegate(id delegate, dispatch_queue_t queue); - void OnStatusUpdate(chip::RendezvousSessionDelegate::Status status) override; + void OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) override; void OnPairingComplete(CHIP_ERROR error) override; @@ -44,7 +44,7 @@ class CHIPDevicePairingDelegateBridge : public chip::Controller::DevicePairingDe id mDelegate; dispatch_queue_t mQueue; - CHIPPairingStatus MapStatus(chip::RendezvousSessionDelegate::Status status); + CHIPPairingStatus MapStatus(chip::Controller::DevicePairingDelegate::Status status); }; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm index 11e69b1e067790..a0251ea14c30fb 100644 --- a/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/CHIPDevicePairingDelegateBridge.mm @@ -36,21 +36,21 @@ } } -CHIPPairingStatus CHIPDevicePairingDelegateBridge::MapStatus(chip::RendezvousSessionDelegate::Status status) +CHIPPairingStatus CHIPDevicePairingDelegateBridge::MapStatus(chip::Controller::DevicePairingDelegate::Status status) { CHIPPairingStatus rv = kUnknownStatus; switch (status) { - case chip::RendezvousSessionDelegate::Status::SecurePairingSuccess: + case chip::Controller::DevicePairingDelegate::Status::SecurePairingSuccess: rv = kSecurePairingSuccess; break; - case chip::RendezvousSessionDelegate::Status::SecurePairingFailed: + case chip::Controller::DevicePairingDelegate::Status::SecurePairingFailed: rv = kSecurePairingFailed; break; } return rv; } -void CHIPDevicePairingDelegateBridge::OnStatusUpdate(chip::RendezvousSessionDelegate::Status status) +void CHIPDevicePairingDelegateBridge::OnStatusUpdate(chip::Controller::DevicePairingDelegate::Status status) { NSLog(@"DevicePairingDelegate status updated: %d", status); diff --git a/src/protocols/secure_channel/BUILD.gn b/src/protocols/secure_channel/BUILD.gn index 07fee9e4cf55c3..79be1cbd38accc 100644 --- a/src/protocols/secure_channel/BUILD.gn +++ b/src/protocols/secure_channel/BUILD.gn @@ -9,8 +9,6 @@ static_library("secure_channel") { "PASESession.cpp", "PASESession.h", "RendezvousParameters.h", - "RendezvousSession.cpp", - "RendezvousSession.h", "SessionEstablishmentExchangeDispatch.cpp", "SessionEstablishmentExchangeDispatch.h", "StatusReport.cpp", diff --git a/src/protocols/secure_channel/RendezvousSession.cpp b/src/protocols/secure_channel/RendezvousSession.cpp deleted file mode 100644 index 04a599003f539c..00000000000000 --- a/src/protocols/secure_channel/RendezvousSession.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * - * Copyright (c) 2020-2021 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. - */ - -#include - -#include - -#include -#include -#include - -static constexpr uint32_t kSpake2p_Iteration_Count = 100; -static const char * kSpake2pKeyExchangeSalt = "SPAKE2P Key Salt"; - -using namespace chip::Inet; -using namespace chip::System; -using namespace chip::Transport; - -namespace chip { - -CHIP_ERROR RendezvousSession::Init(const RendezvousParameters & params, Messaging::ExchangeManager * exchangeManager, - TransportMgrBase * transportMgr, SecureSessionMgr * sessionMgr, - Transport::AdminPairingInfo * admin) -{ - mParams = params; - mTransportMgr = transportMgr; - VerifyOrReturnError(exchangeManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(mDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(sessionMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(admin != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(mParams.HasSetupPINCode() || mParams.HasPASEVerifier(), CHIP_ERROR_INVALID_ARGUMENT); -#if CONFIG_NETWORK_LAYER_BLE - VerifyOrReturnError(mParams.HasAdvertisementDelegate(), CHIP_ERROR_INVALID_ARGUMENT); -#endif - - mSecureSessionMgr = sessionMgr; - mAdmin = admin; - mExchangeManager = exchangeManager; - - // Note: Since BLE is only used for initial setup, enable BLE advertisement in rendezvous session can be expected. - if (params.GetPeerAddress().GetTransportType() == Transport::Type::kBle) -#if CONFIG_NETWORK_LAYER_BLE - { - ReturnErrorOnFailure(mParams.GetAdvertisementDelegate()->StartAdvertisement()); - } -#else - { - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; - } -#endif // CONFIG_NETWORK_LAYER_BLE - - if (!mParams.IsController()) - { - ReturnErrorOnFailure(mExchangeManager->RegisterUnsolicitedMessageHandlerForType( - Protocols::SecureChannel::MsgType::PBKDFParamRequest, &mPairingSession)); - - if (mParams.HasPASEVerifier()) - { - ReturnErrorOnFailure(WaitForPairing(mParams.GetPASEVerifier())); - } - else - { - ReturnErrorOnFailure(WaitForPairing(mParams.GetSetupPINCode())); - } - } - - // TODO: We should assume mTransportMgr not null for IP rendezvous. - if (mTransportMgr != nullptr) - { - ReturnErrorOnFailure(mPairingSession.MessageDispatch().Init(mTransportMgr)); - mPairingSession.MessageDispatch().SetPeerAddress(mParams.GetPeerAddress()); - } - - return CHIP_NO_ERROR; -} - -RendezvousSession::~RendezvousSession() -{ - mDelegate = nullptr; -} - -void RendezvousSession::OnSessionEstablished() -{ - SecureSessionMgr::PairingDirection direction = SecureSessionMgr::PairingDirection::kInitiator; - if (!mParams.IsController()) - { - direction = SecureSessionMgr::PairingDirection::kResponder; - } - - // TODO: Once Operational credentials are implemented, node id assignment should be done during opcreds configuration. - // - can use internal node ids (0xFFFF_FFFE_xxxx_xxx - spec still being defined) if a temporary - // node id is required for indexing - // - should only assign a final node id as part of setting operational credentials - if (!mParams.GetRemoteNodeId().HasValue()) - { - ChipLogError(Ble, "Missing node id in rendezvous parameters. Node ID is required until opcerts are implemented"); - } - - mPairingSession.PeerConnection().SetPeerNodeId(mParams.GetRemoteNodeId().ValueOr(kUndefinedNodeId)); - - CHIP_ERROR err = mSecureSessionMgr->NewPairing( - Optional::Value(mPairingSession.PeerConnection().GetPeerAddress()), - mPairingSession.PeerConnection().GetPeerNodeId(), &mPairingSession, direction, mAdmin->GetAdminId(), nullptr); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Ble, "Failed in setting up secure channel: err %s", ErrorStr(err)); - OnRendezvousError(err); - return; - } - - Cleanup(); - - if (mParams.HasAdvertisementDelegate()) - { - mParams.GetAdvertisementDelegate()->RendezvousComplete(); - } - - if (mDelegate != nullptr) - { - mDelegate->OnRendezvousStatusUpdate(RendezvousSessionDelegate::SecurePairingSuccess, CHIP_NO_ERROR); - mDelegate->OnRendezvousComplete(); - } -} - -void RendezvousSession::Cleanup() -{ - if (!mParams.IsController()) - { - mExchangeManager->UnregisterUnsolicitedMessageHandlerForType(Protocols::SecureChannel::MsgType::PBKDFParamRequest); - } - - if (mParams.HasAdvertisementDelegate()) - { - mParams.GetAdvertisementDelegate()->StopAdvertisement(); - } -} - -void RendezvousSession::OnRendezvousConnectionOpened() -{ - if (!mParams.IsController()) - { - return; - } - - CHIP_ERROR err = Pair(mParams.GetSetupPINCode()); - if (err != CHIP_NO_ERROR) - { - OnRendezvousError(err); - } -} - -void RendezvousSession::OnRendezvousConnectionClosed() {} - -void RendezvousSession::OnRendezvousError(CHIP_ERROR err) -{ - Cleanup(); - - if (mDelegate != nullptr) - { - mDelegate->OnRendezvousStatusUpdate(RendezvousSessionDelegate::SecurePairingFailed, err); - mDelegate->OnRendezvousError(err); - } -} - -void RendezvousSession::OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) -{} - -CHIP_ERROR RendezvousSession::WaitForPairing(uint32_t setupPINCode) -{ - return mPairingSession.WaitForPairing(setupPINCode, kSpake2p_Iteration_Count, - reinterpret_cast(kSpake2pKeyExchangeSalt), - strlen(kSpake2pKeyExchangeSalt), mNextKeyId++, this); -} - -CHIP_ERROR RendezvousSession::WaitForPairing(const PASEVerifier & verifier) -{ - return mPairingSession.WaitForPairing(verifier, mNextKeyId++, this); -} - -CHIP_ERROR RendezvousSession::Pair(uint32_t setupPINCode) -{ - Messaging::ExchangeContext * ctxt = mExchangeManager->NewContext(SecureSessionHandle(), &mPairingSession); - ReturnErrorCodeIf(ctxt == nullptr, CHIP_ERROR_INTERNAL); - - CHIP_ERROR err = mPairingSession.Pair(mParams.GetPeerAddress(), setupPINCode, mNextKeyId++, ctxt, this); - return err; -} - -} // namespace chip diff --git a/src/protocols/secure_channel/RendezvousSession.h b/src/protocols/secure_channel/RendezvousSession.h deleted file mode 100644 index 106a6de39034be..00000000000000 --- a/src/protocols/secure_channel/RendezvousSession.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * - * Copyright (c) 2020-2021 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. - */ - -/** - * @file - * This file defines the CHIP RendezvousSession object that maintains a Rendezvous session. - * - */ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -namespace chip { - -namespace DeviceLayer { -class CHIPDeviceEvent; -} - -class SecureSessionMgr; -class SecureSessionHandle; - -/** - * RendezvousSession establishes and maintains the first connection between - * a commissioner and a device. This connection is used in order to - * provide the necessary infos for a device to participate to the CHIP - * ecosystem. - * - * All the information transmitted over the underlying transport are - * encrypted upon establishment of an initial secure pairing session. - * - * In order to securely transmit the informations, RendezvousSession - * requires a setupPINCode to be shared between both ends. The - * setupPINCode can be configured using RendezvousParameters - * - * @dotfile dots/Rendezvous/RendezvousSessionGeneral.dot - * - * The state of the secure pairing session setup can be observed by passing a - * RendezvousSessionDelegate object to RendezvousSession. - * Both the commissioner and the device needs to bootstrap RendezvousSession - * using RendezvousParameters. - * - * @dotfile dots/Rendezvous/RendezvousSessionInit.dot - */ -class RendezvousSession : public SessionEstablishmentDelegate, public RendezvousSessionDelegate, public TransportMgrDelegate -{ -public: - RendezvousSession(RendezvousSessionDelegate * delegate) : mDelegate(delegate) {} - ~RendezvousSession() override; - - /** - * @brief - * Initialize the underlying transport using the RendezvousParameters passed in the constructor. - * - * @param params The RendezvousParameters - * @param exchangeManager The instance of exchange manager to create exchange contexts - * @param transportMgr The transport to use - * @param sessionMgr Pointer to secure session manager - * @param admin Pointer to a device administrator info that will be filled up on successful pairing - * @ return CHIP_ERROR The result of the initialization - */ - CHIP_ERROR Init(const RendezvousParameters & params, Messaging::ExchangeManager * exchangeManager, - TransportMgrBase * transportMgr, SecureSessionMgr * sessionMgr, Transport::AdminPairingInfo * admin); - - /** - * @brief - * Return the associated pairing session. - * - * @return PASESession The associated pairing session - */ - PASESession & GetPairingSession() { return mPairingSession; } - - Optional GetLocalNodeId() const { return mParams.GetLocalNodeId(); } - Optional GetRemoteNodeId() const { return mParams.GetRemoteNodeId(); } - - //////////// SessionEstablishmentDelegate Implementation /////////////// - void OnSessionEstablished() override; - - //////////// RendezvousSessionDelegate Implementation /////////////// - void OnRendezvousConnectionOpened() override; - void OnRendezvousConnectionClosed() override; - void OnRendezvousError(CHIP_ERROR err) override; - - //////////// TransportMgrDelegate Implementation /////////////// - void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) override; - - Transport::AdminId GetAdminId() const { return (mAdmin != nullptr) ? mAdmin->GetAdminId() : Transport::kUndefinedAdminId; } - - uint16_t GetNextKeyId() const { return mNextKeyId; } - void SetNextKeyId(uint16_t id) { mNextKeyId = id; } - -private: - CHIP_ERROR Pair(uint32_t setupPINCode); - CHIP_ERROR WaitForPairing(uint32_t setupPINCode); - CHIP_ERROR WaitForPairing(const PASEVerifier & verifier); - - RendezvousSessionDelegate * mDelegate = nullptr; ///< Underlying transport events - RendezvousParameters mParams; ///< Rendezvous configuration - - PASESession mPairingSession; - Messaging::ExchangeManager * mExchangeManager = nullptr; - TransportMgrBase * mTransportMgr; - uint16_t mNextKeyId = 0; - SecureSessionMgr * mSecureSessionMgr = nullptr; - - Transport::AdminPairingInfo * mAdmin = nullptr; - - void Cleanup(); -}; - -} // namespace chip diff --git a/src/transport/BUILD.gn b/src/transport/BUILD.gn index f06852cbb6ff81..b60f1f5134965c 100644 --- a/src/transport/BUILD.gn +++ b/src/transport/BUILD.gn @@ -24,7 +24,6 @@ static_library("transport") { "AdminPairingTable.h", "PeerConnectionState.h", "PeerConnections.h", - "RendezvousSessionDelegate.h", "SecureMessageCodec.cpp", "SecureMessageCodec.h", "SecureSession.cpp", diff --git a/src/transport/RendezvousSessionDelegate.h b/src/transport/RendezvousSessionDelegate.h deleted file mode 100644 index ee9c60b052d842..00000000000000 --- a/src/transport/RendezvousSessionDelegate.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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. - */ - -#pragma once - -#include -#include -#include -#include -#include - -namespace chip { - -class RendezvousSessionDelegate -{ -public: - virtual ~RendezvousSessionDelegate() {} - - enum Status : uint8_t - { - SecurePairingSuccess = 0, - SecurePairingFailed, - }; - - virtual void OnRendezvousConnectionOpened() {} - virtual void OnRendezvousConnectionClosed() {} - virtual void OnRendezvousError(CHIP_ERROR err) {} - virtual void OnRendezvousComplete() {} - virtual void OnRendezvousMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle buffer){}; - virtual void OnRendezvousStatusUpdate(Status status, CHIP_ERROR err) {} -}; -} // namespace chip diff --git a/src/transport/SessionEstablishmentDelegate.h b/src/transport/SessionEstablishmentDelegate.h index 3758d74445b5ee..9338167f51ee8b 100644 --- a/src/transport/SessionEstablishmentDelegate.h +++ b/src/transport/SessionEstablishmentDelegate.h @@ -34,23 +34,6 @@ namespace chip { class DLL_EXPORT SessionEstablishmentDelegate { public: - /** - * @brief - * Called when the session establishment process generates a new message that should be sent to peer. - * - * @param header the message header for the sent message - * @param peerAddress the destination of the message - * @param msgBuf the raw data for the message being sent - * @return CHIP_ERROR Error thrown when sending the message - * - * TODO: Rename function as per issue: https://github.com/project-chip/connectedhomeip/issues/4468 - */ - virtual CHIP_ERROR SendSessionEstablishmentMessage(const PacketHeader & header, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle msgBuf) - { - return CHIP_ERROR_NOT_IMPLEMENTED; - } - /** * @brief * Called when session establishment fails with an error From 0f2d916db13d81f0bb432659d90e08a734ac460f Mon Sep 17 00:00:00 2001 From: cecille Date: Tue, 4 May 2021 19:10:03 -0400 Subject: [PATCH 23/31] ESP32 all clusters - print QR code. (#6463) This gets printed earlier, but it's easier to find in the logs if we just print it when we go to the QR code screen. --- examples/all-clusters-app/esp32/main/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index f61078c12932d1..e4d52a609c8597 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -656,6 +656,7 @@ extern "C" void app_main() ->Item("QR Code", [=]() { ESP_LOGI(TAG, "Opening QR code screen"); + ESP_LOGI(TAG, "QR CODE Text: '%s'", qrCodeText.c_str()); ScreenManager::PushScreen(chip::Platform::New(qrCodeText)); }) ->Item("Setup", From 30daae2b38d8c07c5797f073942113b774f8f299 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 5 May 2021 07:21:05 +0200 Subject: [PATCH 24/31] Zap uint16 t for attribute store (#6446) * Use uint16_t instead of uint8_t for the size member of EmberAfAttributeMetadata * Update gen/ folders --- .../all-clusters-common/gen/callback-stub.cpp | 4 +- .../all-clusters-common/gen/callback.h | 54 +++++++------- .../bridge-common/gen/callback-stub.cpp | 4 +- .../bridge-app/bridge-common/gen/callback.h | 14 ++-- examples/chip-tool/gen/callback-stub.cpp | 4 +- examples/chip-tool/gen/callback.h | 68 +++++++++--------- .../lighting-common/gen/callback-stub.cpp | 4 +- .../lighting-common/gen/callback.h | 14 ++-- .../lock-common/gen/callback-stub.cpp | 4 +- examples/lock-app/lock-common/gen/callback.h | 12 ++-- .../esp32/main/gen/callback-stub.cpp | 4 +- .../esp32/main/gen/callback.h | 12 ++-- .../tv-app/tv-common/gen/callback-stub.cpp | 4 +- examples/tv-app/tv-common/gen/callback.h | 42 +++++------ .../window-app/common/gen/callback-stub.cpp | 4 +- examples/window-app/common/gen/callback.h | 6 +- .../ias-zone-server/ias-zone-server.cpp | 2 +- src/app/util/af-types.h | 4 +- src/app/util/af.h | 12 ++-- src/app/util/attribute-storage.cpp | 2 +- src/app/util/attribute-storage.h | 2 +- src/app/util/attribute-table.cpp | 12 ++-- src/app/util/util.cpp | 2 +- .../templates/app/callback-stub-src.zapt | 4 +- .../zap-templates/templates/app/callback.zapt | 6 +- src/controller/python/gen/callback-stub.cpp | 4 +- src/controller/python/gen/callback.h | 70 +++++++++---------- .../Framework/CHIP/gen/callback-stub.cpp | 4 +- src/darwin/Framework/CHIP/gen/callback.h | 48 ++++++------- 29 files changed, 213 insertions(+), 213 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp index 1bbe68114bb09c..3b4905d5be4c66 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/callback-stub.cpp @@ -544,7 +544,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -566,7 +566,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index dad543f3dde278..02cc3145eedc3f 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -302,7 +302,7 @@ void emberAfApplicationBasicClusterServerMessageSentCallback(EmberOutgoingMessag */ EmberAfStatus emberAfApplicationBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Basic Cluster Server Tick @@ -373,7 +373,7 @@ void emberAfBarrierControlClusterServerMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfBarrierControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Barrier Control Cluster Server Tick @@ -441,7 +441,7 @@ void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Server Tick @@ -511,7 +511,7 @@ void emberAfBindingClusterServerMessageSentCallback(EmberOutgoingMessageType typ * @param value Attribute value */ EmberAfStatus emberAfBindingClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Binding Cluster Server Tick @@ -581,7 +581,7 @@ void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfColorControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Color Control Cluster Server Tick @@ -651,7 +651,7 @@ void emberAfDescriptorClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfDescriptorClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Descriptor Cluster Server Tick @@ -721,7 +721,7 @@ void emberAfDoorLockClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfDoorLockClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Door Lock Cluster Server Tick @@ -792,7 +792,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -863,7 +863,7 @@ void emberAfGroupKeyManagementClusterServerMessageSentCallback(EmberOutgoingMess */ EmberAfStatus emberAfGroupKeyManagementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Group Key Management Cluster Server Tick @@ -933,7 +933,7 @@ void emberAfGroupsClusterServerMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfGroupsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Groups Cluster Server Tick @@ -1003,7 +1003,7 @@ void emberAfIasZoneClusterServerMessageSentCallback(EmberOutgoingMessageType typ * @param value Attribute value */ EmberAfStatus emberAfIasZoneClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief IAS Zone Cluster Server Tick @@ -1073,7 +1073,7 @@ void emberAfIdentifyClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfIdentifyClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Identify Cluster Server Tick @@ -1143,7 +1143,7 @@ void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Server Tick @@ -1213,7 +1213,7 @@ void emberAfLowPowerClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfLowPowerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Low Power Cluster Server Tick @@ -1284,7 +1284,7 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Server Tick @@ -1356,7 +1356,7 @@ void emberAfOtaSoftwareUpdateClientClusterServerMessageSentCallback(EmberOutgoin EmberAfStatus emberAfOtaSoftwareUpdateClientClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief OTA Software Update Client Cluster Server Tick * @@ -1427,7 +1427,7 @@ void emberAfOtaSoftwareUpdateServerClusterServerMessageSentCallback(EmberOutgoin EmberAfStatus emberAfOtaSoftwareUpdateServerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief OTA Software Update Server Cluster Server Tick * @@ -1494,7 +1494,7 @@ void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Server Tick @@ -1566,7 +1566,7 @@ void emberAfOperationalCredentialsClusterServerMessageSentCallback(EmberOutgoing EmberAfStatus emberAfOperationalCredentialsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Operational Credentials Cluster Server Tick * @@ -1638,7 +1638,7 @@ void emberAfPumpConfigurationAndControlClusterServerMessageSentCallback(EmberOut EmberAfStatus emberAfPumpConfigurationAndControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Pump Configuration and Control Cluster Server Tick * @@ -1707,7 +1707,7 @@ void emberAfScenesClusterServerMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfScenesClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Scenes Cluster Server Tick @@ -1777,7 +1777,7 @@ void emberAfSwitchClusterServerMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfSwitchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Switch Cluster Server Tick @@ -1849,7 +1849,7 @@ void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoing EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Temperature Measurement Cluster Server Tick * @@ -1918,7 +1918,7 @@ void emberAfTestClusterClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfTestClusterClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Test Cluster Cluster Server Tick @@ -1988,7 +1988,7 @@ void emberAfThermostatClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfThermostatClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Thermostat Cluster Server Tick @@ -3088,7 +3088,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -3107,7 +3107,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/bridge-app/bridge-common/gen/callback-stub.cpp b/examples/bridge-app/bridge-common/gen/callback-stub.cpp index fbfb4a965efa56..9472cfe4f1403e 100644 --- a/examples/bridge-app/bridge-common/gen/callback-stub.cpp +++ b/examples/bridge-app/bridge-common/gen/callback-stub.cpp @@ -384,7 +384,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -406,7 +406,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/bridge-app/bridge-common/gen/callback.h b/examples/bridge-app/bridge-common/gen/callback.h index ae79c2614e9d67..498399ab5d4e8e 100644 --- a/examples/bridge-app/bridge-common/gen/callback.h +++ b/examples/bridge-app/bridge-common/gen/callback.h @@ -139,7 +139,7 @@ void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Server Tick @@ -210,7 +210,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -280,7 +280,7 @@ void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Server Tick @@ -351,7 +351,7 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Server Tick @@ -419,7 +419,7 @@ void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Server Tick @@ -912,7 +912,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -931,7 +931,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/chip-tool/gen/callback-stub.cpp b/examples/chip-tool/gen/callback-stub.cpp index f37741eec41dcb..d56e6179ea5fa9 100644 --- a/examples/chip-tool/gen/callback-stub.cpp +++ b/examples/chip-tool/gen/callback-stub.cpp @@ -600,7 +600,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -622,7 +622,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/chip-tool/gen/callback.h b/examples/chip-tool/gen/callback.h index 68ef71ef130dcc..c070e6f9d17d03 100644 --- a/examples/chip-tool/gen/callback.h +++ b/examples/chip-tool/gen/callback.h @@ -357,7 +357,7 @@ void emberAfAccountLoginClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfAccountLoginClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Account Login Cluster Client Tick @@ -428,7 +428,7 @@ void emberAfApplicationBasicClusterClientMessageSentCallback(EmberOutgoingMessag */ EmberAfStatus emberAfApplicationBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Basic Cluster Client Tick @@ -499,7 +499,7 @@ void emberAfApplicationLauncherClusterClientMessageSentCallback(EmberOutgoingMes */ EmberAfStatus emberAfApplicationLauncherClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Launcher Cluster Client Tick @@ -569,7 +569,7 @@ void emberAfAudioOutputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfAudioOutputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Audio Output Cluster Client Tick @@ -640,7 +640,7 @@ void emberAfBarrierControlClusterClientMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfBarrierControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Barrier Control Cluster Client Tick @@ -708,7 +708,7 @@ void emberAfBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Client Tick @@ -778,7 +778,7 @@ void emberAfBindingClusterClientMessageSentCallback(EmberOutgoingMessageType typ * @param value Attribute value */ EmberAfStatus emberAfBindingClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Binding Cluster Client Tick @@ -848,7 +848,7 @@ void emberAfColorControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfColorControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Color Control Cluster Client Tick @@ -918,7 +918,7 @@ void emberAfContentLaunchClusterClientMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfContentLaunchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Content Launch Cluster Client Tick @@ -988,7 +988,7 @@ void emberAfDescriptorClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfDescriptorClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Descriptor Cluster Client Tick @@ -1058,7 +1058,7 @@ void emberAfDoorLockClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfDoorLockClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Door Lock Cluster Client Tick @@ -1129,7 +1129,7 @@ void emberAfGeneralCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Client Tick @@ -1200,7 +1200,7 @@ void emberAfGroupKeyManagementClusterClientMessageSentCallback(EmberOutgoingMess */ EmberAfStatus emberAfGroupKeyManagementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Group Key Management Cluster Client Tick @@ -1270,7 +1270,7 @@ void emberAfGroupsClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfGroupsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Groups Cluster Client Tick @@ -1340,7 +1340,7 @@ void emberAfIdentifyClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfIdentifyClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Identify Cluster Client Tick @@ -1410,7 +1410,7 @@ void emberAfKeypadInputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfKeypadInputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Keypad Input Cluster Client Tick @@ -1480,7 +1480,7 @@ void emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Client Tick @@ -1550,7 +1550,7 @@ void emberAfLowPowerClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfLowPowerClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Low Power Cluster Client Tick @@ -1620,7 +1620,7 @@ void emberAfMediaInputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfMediaInputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Input Cluster Client Tick @@ -1690,7 +1690,7 @@ void emberAfMediaPlaybackClusterClientMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfMediaPlaybackClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Playback Cluster Client Tick @@ -1761,7 +1761,7 @@ void emberAfNetworkCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Client Tick @@ -1829,7 +1829,7 @@ void emberAfOnOffClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Client Tick @@ -1901,7 +1901,7 @@ void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfOperationalCredentialsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Operational Credentials Cluster Client Tick * @@ -1973,7 +1973,7 @@ void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(EmberOut EmberAfStatus emberAfPumpConfigurationAndControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Pump Configuration and Control Cluster Client Tick * @@ -2042,7 +2042,7 @@ void emberAfScenesClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfScenesClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Scenes Cluster Client Tick @@ -2112,7 +2112,7 @@ void emberAfSwitchClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfSwitchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Switch Cluster Client Tick @@ -2182,7 +2182,7 @@ void emberAfTvChannelClusterClientMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfTvChannelClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief TV Channel Cluster Client Tick @@ -2253,7 +2253,7 @@ void emberAfTargetNavigatorClusterClientMessageSentCallback(EmberOutgoingMessage */ EmberAfStatus emberAfTargetNavigatorClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Target Navigator Cluster Client Tick @@ -2325,7 +2325,7 @@ void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Temperature Measurement Cluster Client Tick * @@ -2394,7 +2394,7 @@ void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Test Cluster Cluster Client Tick @@ -2464,7 +2464,7 @@ void emberAfThermostatClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfThermostatClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Thermostat Cluster Client Tick @@ -2534,7 +2534,7 @@ void emberAfWakeOnLanClusterClientMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfWakeOnLanClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Wake on LAN Cluster Client Tick @@ -3399,7 +3399,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -3418,7 +3418,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/lighting-app/lighting-common/gen/callback-stub.cpp b/examples/lighting-app/lighting-common/gen/callback-stub.cpp index fbfb4a965efa56..9472cfe4f1403e 100644 --- a/examples/lighting-app/lighting-common/gen/callback-stub.cpp +++ b/examples/lighting-app/lighting-common/gen/callback-stub.cpp @@ -384,7 +384,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -406,7 +406,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/lighting-app/lighting-common/gen/callback.h b/examples/lighting-app/lighting-common/gen/callback.h index ae79c2614e9d67..498399ab5d4e8e 100644 --- a/examples/lighting-app/lighting-common/gen/callback.h +++ b/examples/lighting-app/lighting-common/gen/callback.h @@ -139,7 +139,7 @@ void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Server Tick @@ -210,7 +210,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -280,7 +280,7 @@ void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Server Tick @@ -351,7 +351,7 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Server Tick @@ -419,7 +419,7 @@ void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Server Tick @@ -912,7 +912,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -931,7 +931,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/lock-app/lock-common/gen/callback-stub.cpp b/examples/lock-app/lock-common/gen/callback-stub.cpp index 2377bbfdff0cc2..57b45b9de6f3a5 100644 --- a/examples/lock-app/lock-common/gen/callback-stub.cpp +++ b/examples/lock-app/lock-common/gen/callback-stub.cpp @@ -376,7 +376,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -398,7 +398,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/lock-app/lock-common/gen/callback.h b/examples/lock-app/lock-common/gen/callback.h index 8d5f1c26b408c2..54949161f463d0 100644 --- a/examples/lock-app/lock-common/gen/callback.h +++ b/examples/lock-app/lock-common/gen/callback.h @@ -131,7 +131,7 @@ void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Server Tick @@ -202,7 +202,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -273,7 +273,7 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Server Tick @@ -341,7 +341,7 @@ void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Server Tick @@ -759,7 +759,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -778,7 +778,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp index 516f3eb3cbfbd8..0c0d2d146fd912 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp +++ b/examples/temperature-measurement-app/esp32/main/gen/callback-stub.cpp @@ -376,7 +376,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -398,7 +398,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/temperature-measurement-app/esp32/main/gen/callback.h b/examples/temperature-measurement-app/esp32/main/gen/callback.h index 82466588b77916..3b342e4bd85c9a 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/callback.h +++ b/examples/temperature-measurement-app/esp32/main/gen/callback.h @@ -131,7 +131,7 @@ void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Server Tick @@ -202,7 +202,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -273,7 +273,7 @@ void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Server Tick @@ -345,7 +345,7 @@ void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoing EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Temperature Measurement Cluster Server Tick * @@ -744,7 +744,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -763,7 +763,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/tv-app/tv-common/gen/callback-stub.cpp b/examples/tv-app/tv-common/gen/callback-stub.cpp index 952b0bd3dbed56..5c039a5353800f 100644 --- a/examples/tv-app/tv-common/gen/callback-stub.cpp +++ b/examples/tv-app/tv-common/gen/callback-stub.cpp @@ -496,7 +496,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -518,7 +518,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index b48e438e919777..81a954961484ca 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -253,7 +253,7 @@ void emberAfAccountLoginClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfAccountLoginClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Account Login Cluster Server Tick @@ -324,7 +324,7 @@ void emberAfApplicationBasicClusterServerMessageSentCallback(EmberOutgoingMessag */ EmberAfStatus emberAfApplicationBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Basic Cluster Server Tick @@ -395,7 +395,7 @@ void emberAfApplicationLauncherClusterServerMessageSentCallback(EmberOutgoingMes */ EmberAfStatus emberAfApplicationLauncherClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Launcher Cluster Server Tick @@ -465,7 +465,7 @@ void emberAfAudioOutputClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfAudioOutputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Audio Output Cluster Server Tick @@ -535,7 +535,7 @@ void emberAfColorControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfColorControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Color Control Cluster Server Tick @@ -605,7 +605,7 @@ void emberAfContentLaunchClusterServerMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfContentLaunchClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Content Launch Cluster Server Tick @@ -676,7 +676,7 @@ void emberAfGeneralCommissioningClusterServerMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Server Tick @@ -746,7 +746,7 @@ void emberAfGroupsClusterServerMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfGroupsClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Groups Cluster Server Tick @@ -816,7 +816,7 @@ void emberAfIdentifyClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfIdentifyClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Identify Cluster Server Tick @@ -886,7 +886,7 @@ void emberAfKeypadInputClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfKeypadInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Keypad Input Cluster Server Tick @@ -956,7 +956,7 @@ void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Server Tick @@ -1026,7 +1026,7 @@ void emberAfLowPowerClusterServerMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfLowPowerClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Low Power Cluster Server Tick @@ -1096,7 +1096,7 @@ void emberAfMediaInputClusterServerMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfMediaInputClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Input Cluster Server Tick @@ -1166,7 +1166,7 @@ void emberAfMediaPlaybackClusterServerMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfMediaPlaybackClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Playback Cluster Server Tick @@ -1234,7 +1234,7 @@ void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Server Tick @@ -1304,7 +1304,7 @@ void emberAfScenesClusterServerMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfScenesClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Scenes Cluster Server Tick @@ -1374,7 +1374,7 @@ void emberAfTvChannelClusterServerMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfTvChannelClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief TV Channel Cluster Server Tick @@ -1445,7 +1445,7 @@ void emberAfTargetNavigatorClusterServerMessageSentCallback(EmberOutgoingMessage */ EmberAfStatus emberAfTargetNavigatorClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Target Navigator Cluster Server Tick @@ -1515,7 +1515,7 @@ void emberAfWakeOnLanClusterServerMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfWakeOnLanClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Wake on LAN Cluster Server Tick @@ -2036,7 +2036,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -2055,7 +2055,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/examples/window-app/common/gen/callback-stub.cpp b/examples/window-app/common/gen/callback-stub.cpp index ca0fc68187729b..58431f99519b9f 100644 --- a/examples/window-app/common/gen/callback-stub.cpp +++ b/examples/window-app/common/gen/callback-stub.cpp @@ -352,7 +352,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -374,7 +374,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/examples/window-app/common/gen/callback.h b/examples/window-app/common/gen/callback.h index 0619b2326e979e..7108699ee67b78 100644 --- a/examples/window-app/common/gen/callback.h +++ b/examples/window-app/common/gen/callback.h @@ -110,7 +110,7 @@ void emberAfWindowCoveringClusterServerMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfWindowCoveringClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Window Covering Cluster Server Tick @@ -439,7 +439,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -458,7 +458,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/src/app/clusters/ias-zone-server/ias-zone-server.cpp b/src/app/clusters/ias-zone-server/ias-zone-server.cpp index 8cbf8d4b518743..af6d1f4a122654 100644 --- a/src/app/clusters/ias-zone-server/ias-zone-server.cpp +++ b/src/app/clusters/ias-zone-server/ias-zone-server.cpp @@ -211,7 +211,7 @@ static void enrollWithClient(EndpointId endpoint) } EmberAfStatus emberAfIasZoneClusterServerPreAttributeChangedCallback(EndpointId endpoint, AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { uint8_t i; diff --git a/src/app/util/af-types.h b/src/app/util/af-types.h index 31ae4f2e74b83a..c3eda9b1e21b68 100644 --- a/src/app/util/af-types.h +++ b/src/app/util/af-types.h @@ -171,7 +171,7 @@ typedef struct /** * Size of this attribute in bytes. */ - uint8_t size; + uint16_t size; /** * Attribute mask, tagging attribute with specific * functionality. See ATTRIBUTE_MASK_ macros defined @@ -1228,7 +1228,7 @@ typedef void (*EmberAfManufacturerSpecificClusterAttributeChangedCallback)(chip: * This function is called before an attribute changes. */ typedef EmberAfStatus (*EmberAfClusterPreAttributeChangedCallback)(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** diff --git a/src/app/util/af.h b/src/app/util/af.h index 312916b3bde02a..7a71ba4ac3fcaf 100644 --- a/src/app/util/af.h +++ b/src/app/util/af.h @@ -283,7 +283,7 @@ EmberAfStatus emberAfVerifyAttributeWrite(chip::EndpointId endpoint, chip::Clust * emberAfReadManufacturerSpecificServerAttribute */ EmberAfStatus emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t mask, - uint8_t * dataPtr, uint8_t readLength, EmberAfAttributeType * dataType); + uint8_t * dataPtr, uint16_t readLength, EmberAfAttributeType * dataType); /** * @brief Read the server attribute value, performing all the checks. @@ -298,7 +298,7 @@ EmberAfStatus emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cl * emberAfReadManufacturerSpecificServerAttribute */ EmberAfStatus emberAfReadServerAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, - uint8_t * dataPtr, uint8_t readLength); + uint8_t * dataPtr, uint16_t readLength); /** * @brief Read the client attribute value, performing all the checks. @@ -313,7 +313,7 @@ EmberAfStatus emberAfReadServerAttribute(chip::EndpointId endpoint, chip::Cluste * emberAfReadManufacturerSpecificServerAttribute */ EmberAfStatus emberAfReadClientAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, - uint8_t * dataPtr, uint8_t readLength); + uint8_t * dataPtr, uint16_t readLength); /** * @brief Read the manufacturer-specific server attribute value, performing all checks. @@ -328,7 +328,7 @@ EmberAfStatus emberAfReadClientAttribute(chip::EndpointId endpoint, chip::Cluste */ EmberAfStatus emberAfReadManufacturerSpecificServerAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint16_t manufacturerCode, - uint8_t * dataPtr, uint8_t readLength); + uint8_t * dataPtr, uint16_t readLength); /** * @brief Read the manufacturer-specific client attribute value, performing all checks. @@ -343,7 +343,7 @@ EmberAfStatus emberAfReadManufacturerSpecificServerAttribute(chip::EndpointId en */ EmberAfStatus emberAfReadManufacturerSpecificClientAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint16_t manufacturerCode, - uint8_t * dataPtr, uint8_t readLength); + uint8_t * dataPtr, uint16_t readLength); /** * @brief this function returns the size of the ZCL data in bytes. @@ -725,7 +725,7 @@ uint8_t emberAfGetLastSequenceNumber(void); * greater than 4 is being compared * 1, if val2 is smaller. */ -int8_t emberAfCompareValues(uint8_t * val1, uint8_t * val2, uint8_t len, bool signedNumber); +int8_t emberAfCompareValues(uint8_t * val1, uint8_t * val2, uint16_t len, bool signedNumber); /** * @brief populates the passed EUI64 with the local EUI64 MAC address. diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 07023bb5b17ff8..fd1e264455bcc9 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -281,7 +281,7 @@ void emAfClusterAttributeChangedCallback(EndpointId endpoint, ClusterId clusterI // This function is used to call the per-cluster pre-attribute changed callback EmberAfStatus emAfClusterPreAttributeChangedCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t clientServerMask, uint16_t manufacturerCode, - EmberAfAttributeType attributeType, uint8_t size, uint8_t * value) + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value) { EmberAfCluster * cluster = emberAfFindClusterWithMfgCode(endpoint, clusterId, clientServerMask, manufacturerCode); if (cluster == NULL) diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h index d9ac221e1e29a0..0a0911986ff9b2 100644 --- a/src/app/util/attribute-storage.h +++ b/src/app/util/attribute-storage.h @@ -176,7 +176,7 @@ void emAfClusterAttributeChangedCallback(chip::EndpointId endpoint, chip::Cluste // Calls the attribute changed callback for a specific cluster. EmberAfStatus emAfClusterPreAttributeChangedCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t clientServerMask, - uint16_t manufacturerCode, EmberAfAttributeType attributeType, uint8_t size, + uint16_t manufacturerCode, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); // Calls the default response callback for a specific cluster, and wraps emberAfClusterDefaultResponseWithMfgCodeCallback diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp index 2b19c6d3bf1287..c581ab5656be8e 100644 --- a/src/app/util/attribute-table.cpp +++ b/src/app/util/attribute-table.cpp @@ -137,33 +137,33 @@ EmberAfStatus emberAfVerifyAttributeWrite(EndpointId endpoint, ClusterId cluster } EmberAfStatus emberAfReadAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t mask, uint8_t * dataPtr, - uint8_t readLength, EmberAfAttributeType * dataType) + uint16_t readLength, EmberAfAttributeType * dataType) { return emAfReadAttribute(endpoint, cluster, attributeID, mask, EMBER_AF_NULL_MANUFACTURER_CODE, dataPtr, readLength, dataType); } EmberAfStatus emberAfReadServerAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr, - uint8_t readLength) + uint16_t readLength) { return emAfReadAttribute(endpoint, cluster, attributeID, CLUSTER_MASK_SERVER, EMBER_AF_NULL_MANUFACTURER_CODE, dataPtr, readLength, NULL); } EmberAfStatus emberAfReadClientAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, uint8_t * dataPtr, - uint8_t readLength) + uint16_t readLength) { return emAfReadAttribute(endpoint, cluster, attributeID, CLUSTER_MASK_CLIENT, EMBER_AF_NULL_MANUFACTURER_CODE, dataPtr, readLength, NULL); } EmberAfStatus emberAfReadManufacturerSpecificServerAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, - uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength) + uint16_t manufacturerCode, uint8_t * dataPtr, uint16_t readLength) { return emAfReadAttribute(endpoint, cluster, attributeID, CLUSTER_MASK_SERVER, manufacturerCode, dataPtr, readLength, NULL); } EmberAfStatus emberAfReadManufacturerSpecificClientAttribute(EndpointId endpoint, ClusterId cluster, AttributeId attributeID, - uint16_t manufacturerCode, uint8_t * dataPtr, uint8_t readLength) + uint16_t manufacturerCode, uint8_t * dataPtr, uint16_t readLength) { return emAfReadAttribute(endpoint, cluster, attributeID, CLUSTER_MASK_CLIENT, manufacturerCode, dataPtr, readLength, NULL); } @@ -532,7 +532,7 @@ EmberAfStatus emAfWriteAttribute(EndpointId endpoint, ClusterId cluster, Attribu EmberAfDefaultAttributeValue minv = metadata->defaultValue.ptrToMinMaxValue->minValue; EmberAfDefaultAttributeValue maxv = metadata->defaultValue.ptrToMinMaxValue->maxValue; bool isAttributeSigned = emberAfIsTypeSigned(metadata->attributeType); - uint8_t dataLen = emberAfAttributeSize(metadata); + uint16_t dataLen = emberAfAttributeSize(metadata); if (dataLen <= 2) { int8_t minR, maxR; diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 9f7477a4eeb1f2..c54c92731eca5f 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -933,7 +933,7 @@ void emberAfCopyLongString(uint8_t * dest, const uint8_t * src, uint16_t size) // You can pass in val1 as NULL, which will assume that it is // pointing to an array of all zeroes. This is used so that // default value of NULL is treated as all zeroes. -int8_t emberAfCompareValues(uint8_t * val1, uint8_t * val2, uint8_t len, bool signedNumber) +int8_t emberAfCompareValues(uint8_t * val1, uint8_t * val2, uint16_t len, bool signedNumber) { uint8_t i, j, k; if (signedNumber) diff --git a/src/app/zap-templates/templates/app/callback-stub-src.zapt b/src/app/zap-templates/templates/app/callback-stub-src.zapt index 2f87c9a405276e..e5a55c047aae24 100644 --- a/src/app/zap-templates/templates/app/callback-stub-src.zapt +++ b/src/app/zap-templates/templates/app/callback-stub-src.zapt @@ -349,7 +349,7 @@ bool __attribute__((weak)) emberAfMessageSentCallback( */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback( EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; @@ -372,7 +372,7 @@ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback( */ void __attribute__((weak)) emberAfPostAttributeChangeCallback( EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { } diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index 83bbd43a4b4353..cbb45dc72c0262 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -93,7 +93,7 @@ void emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}Message * @param size Attribute size * @param value Attribute value */ -EmberAfStatus emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}PreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, uint8_t size, uint8_t * value); +EmberAfStatus emberAf{{asCamelCased name false}}Cluster{{asCamelCased side false}}PreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief {{name}} Cluster {{asCamelCased side false}} Tick * @@ -398,7 +398,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -417,7 +417,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/src/controller/python/gen/callback-stub.cpp b/src/controller/python/gen/callback-stub.cpp index 857fb342e54abf..4e6856332f1f06 100644 --- a/src/controller/python/gen/callback-stub.cpp +++ b/src/controller/python/gen/callback-stub.cpp @@ -608,7 +608,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -630,7 +630,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/src/controller/python/gen/callback.h b/src/controller/python/gen/callback.h index 5f3c5701391605..16667fcb89ae82 100644 --- a/src/controller/python/gen/callback.h +++ b/src/controller/python/gen/callback.h @@ -365,7 +365,7 @@ void emberAfAccountLoginClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfAccountLoginClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Account Login Cluster Client Tick @@ -436,7 +436,7 @@ void emberAfApplicationBasicClusterClientMessageSentCallback(EmberOutgoingMessag */ EmberAfStatus emberAfApplicationBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Basic Cluster Client Tick @@ -507,7 +507,7 @@ void emberAfApplicationLauncherClusterClientMessageSentCallback(EmberOutgoingMes */ EmberAfStatus emberAfApplicationLauncherClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Launcher Cluster Client Tick @@ -577,7 +577,7 @@ void emberAfAudioOutputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfAudioOutputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Audio Output Cluster Client Tick @@ -648,7 +648,7 @@ void emberAfBarrierControlClusterClientMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfBarrierControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Barrier Control Cluster Client Tick @@ -716,7 +716,7 @@ void emberAfBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Client Tick @@ -786,7 +786,7 @@ void emberAfBindingClusterClientMessageSentCallback(EmberOutgoingMessageType typ * @param value Attribute value */ EmberAfStatus emberAfBindingClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Binding Cluster Client Tick @@ -856,7 +856,7 @@ void emberAfColorControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfColorControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Color Control Cluster Client Tick @@ -926,7 +926,7 @@ void emberAfContentLaunchClusterClientMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfContentLaunchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Content Launch Cluster Client Tick @@ -996,7 +996,7 @@ void emberAfDescriptorClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfDescriptorClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Descriptor Cluster Client Tick @@ -1066,7 +1066,7 @@ void emberAfDoorLockClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfDoorLockClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Door Lock Cluster Client Tick @@ -1137,7 +1137,7 @@ void emberAfGeneralCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Client Tick @@ -1208,7 +1208,7 @@ void emberAfGroupKeyManagementClusterClientMessageSentCallback(EmberOutgoingMess */ EmberAfStatus emberAfGroupKeyManagementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Group Key Management Cluster Client Tick @@ -1278,7 +1278,7 @@ void emberAfGroupsClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfGroupsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Groups Cluster Client Tick @@ -1348,7 +1348,7 @@ void emberAfIdentifyClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfIdentifyClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Identify Cluster Client Tick @@ -1418,7 +1418,7 @@ void emberAfKeypadInputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfKeypadInputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Keypad Input Cluster Client Tick @@ -1488,7 +1488,7 @@ void emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Client Tick @@ -1558,7 +1558,7 @@ void emberAfLowPowerClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfLowPowerClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Low Power Cluster Client Tick @@ -1628,7 +1628,7 @@ void emberAfMediaInputClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfMediaInputClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Input Cluster Client Tick @@ -1698,7 +1698,7 @@ void emberAfMediaPlaybackClusterClientMessageSentCallback(EmberOutgoingMessageTy * @param value Attribute value */ EmberAfStatus emberAfMediaPlaybackClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Media Playback Cluster Client Tick @@ -1769,7 +1769,7 @@ void emberAfNetworkCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Client Tick @@ -1837,7 +1837,7 @@ void emberAfOnOffClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Client Tick @@ -1909,7 +1909,7 @@ void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfOperationalCredentialsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Operational Credentials Cluster Client Tick * @@ -1981,7 +1981,7 @@ void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(EmberOut EmberAfStatus emberAfPumpConfigurationAndControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Pump Configuration and Control Cluster Client Tick * @@ -2050,7 +2050,7 @@ void emberAfScenesClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfScenesClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Scenes Cluster Client Tick @@ -2120,7 +2120,7 @@ void emberAfSwitchClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfSwitchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Switch Cluster Client Tick @@ -2190,7 +2190,7 @@ void emberAfTvChannelClusterClientMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfTvChannelClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief TV Channel Cluster Client Tick @@ -2261,7 +2261,7 @@ void emberAfTargetNavigatorClusterClientMessageSentCallback(EmberOutgoingMessage */ EmberAfStatus emberAfTargetNavigatorClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Target Navigator Cluster Client Tick @@ -2333,7 +2333,7 @@ void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Temperature Measurement Cluster Client Tick * @@ -2402,7 +2402,7 @@ void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Test Cluster Cluster Client Tick @@ -2472,7 +2472,7 @@ void emberAfThermostatClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfThermostatClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Thermostat Cluster Client Tick @@ -2542,7 +2542,7 @@ void emberAfWakeOnLanClusterClientMessageSentCallback(EmberOutgoingMessageType t * @param value Attribute value */ EmberAfStatus emberAfWakeOnLanClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Wake on LAN Cluster Client Tick @@ -2613,7 +2613,7 @@ void emberAfWindowCoveringClusterClientMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfWindowCoveringClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Window Covering Cluster Client Tick @@ -3452,7 +3452,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -3471,7 +3471,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * diff --git a/src/darwin/Framework/CHIP/gen/callback-stub.cpp b/src/darwin/Framework/CHIP/gen/callback-stub.cpp index de7b7758bd5a8a..feb9ba3ca6d82d 100644 --- a/src/darwin/Framework/CHIP/gen/callback-stub.cpp +++ b/src/darwin/Framework/CHIP/gen/callback-stub.cpp @@ -520,7 +520,7 @@ emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestin */ EmberAfStatus __attribute__((weak)) emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) { return EMBER_ZCL_STATUS_SUCCESS; } @@ -542,7 +542,7 @@ emberAfPreAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, Attr */ void __attribute__((weak)) emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, - uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) + uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value) {} /** @brief Read Attributes Response diff --git a/src/darwin/Framework/CHIP/gen/callback.h b/src/darwin/Framework/CHIP/gen/callback.h index a73a115fd733bf..debe93200a0140 100644 --- a/src/darwin/Framework/CHIP/gen/callback.h +++ b/src/darwin/Framework/CHIP/gen/callback.h @@ -278,7 +278,7 @@ void emberAfApplicationBasicClusterClientMessageSentCallback(EmberOutgoingMessag */ EmberAfStatus emberAfApplicationBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Application Basic Cluster Client Tick @@ -349,7 +349,7 @@ void emberAfBarrierControlClusterClientMessageSentCallback(EmberOutgoingMessageT */ EmberAfStatus emberAfBarrierControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Barrier Control Cluster Client Tick @@ -417,7 +417,7 @@ void emberAfBasicClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfBasicClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Basic Cluster Client Tick @@ -487,7 +487,7 @@ void emberAfBindingClusterClientMessageSentCallback(EmberOutgoingMessageType typ * @param value Attribute value */ EmberAfStatus emberAfBindingClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Binding Cluster Client Tick @@ -557,7 +557,7 @@ void emberAfColorControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfColorControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Color Control Cluster Client Tick @@ -627,7 +627,7 @@ void emberAfDescriptorClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfDescriptorClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Descriptor Cluster Client Tick @@ -697,7 +697,7 @@ void emberAfDoorLockClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfDoorLockClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Door Lock Cluster Client Tick @@ -768,7 +768,7 @@ void emberAfGeneralCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfGeneralCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief General Commissioning Cluster Client Tick @@ -839,7 +839,7 @@ void emberAfGroupKeyManagementClusterClientMessageSentCallback(EmberOutgoingMess */ EmberAfStatus emberAfGroupKeyManagementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Group Key Management Cluster Client Tick @@ -909,7 +909,7 @@ void emberAfGroupsClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfGroupsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Groups Cluster Client Tick @@ -979,7 +979,7 @@ void emberAfIdentifyClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfIdentifyClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Identify Cluster Client Tick @@ -1049,7 +1049,7 @@ void emberAfLevelControlClusterClientMessageSentCallback(EmberOutgoingMessageTyp * @param value Attribute value */ EmberAfStatus emberAfLevelControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Level Control Cluster Client Tick @@ -1119,7 +1119,7 @@ void emberAfLowPowerClusterClientMessageSentCallback(EmberOutgoingMessageType ty * @param value Attribute value */ EmberAfStatus emberAfLowPowerClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Low Power Cluster Client Tick @@ -1190,7 +1190,7 @@ void emberAfNetworkCommissioningClusterClientMessageSentCallback(EmberOutgoingMe */ EmberAfStatus emberAfNetworkCommissioningClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Network Commissioning Cluster Client Tick @@ -1258,7 +1258,7 @@ void emberAfOnOffClusterClientMessageSentCallback(EmberOutgoingMessageType type, * @param value Attribute value */ EmberAfStatus emberAfOnOffClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief On/off Cluster Client Tick @@ -1330,7 +1330,7 @@ void emberAfOperationalCredentialsClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfOperationalCredentialsClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Operational Credentials Cluster Client Tick * @@ -1402,7 +1402,7 @@ void emberAfPumpConfigurationAndControlClusterClientMessageSentCallback(EmberOut EmberAfStatus emberAfPumpConfigurationAndControlClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Pump Configuration and Control Cluster Client Tick * @@ -1471,7 +1471,7 @@ void emberAfScenesClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfScenesClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Scenes Cluster Client Tick @@ -1541,7 +1541,7 @@ void emberAfSwitchClusterClientMessageSentCallback(EmberOutgoingMessageType type * @param value Attribute value */ EmberAfStatus emberAfSwitchClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Switch Cluster Client Tick @@ -1613,7 +1613,7 @@ void emberAfTemperatureMeasurementClusterClientMessageSentCallback(EmberOutgoing EmberAfStatus emberAfTemperatureMeasurementClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, EmberAfAttributeType attributeType, - uint8_t size, uint8_t * value); + uint16_t size, uint8_t * value); /** @brief Temperature Measurement Cluster Client Tick * @@ -1682,7 +1682,7 @@ void emberAfTestClusterClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfTestClusterClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Test Cluster Cluster Client Tick @@ -1752,7 +1752,7 @@ void emberAfThermostatClusterClientMessageSentCallback(EmberOutgoingMessageType * @param value Attribute value */ EmberAfStatus emberAfThermostatClusterClientPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId, - EmberAfAttributeType attributeType, uint8_t size, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); /** @brief Thermostat Cluster Client Tick @@ -2456,7 +2456,7 @@ bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrD * @param value Ver.: always */ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Post Attribute Change @@ -2475,7 +2475,7 @@ EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip: * @param value Ver.: always */ void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId, - uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value); + uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint16_t size, uint8_t * value); /** @brief Read Attributes Response * From 4f2c3897e7d30f638f519242cd0dc19c5261d3e5 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 4 May 2021 22:28:07 -0700 Subject: [PATCH 25/31] Implement Docker best practices - Round 2 (#6388) * Pin versions for connectedhomeip/chip-build image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-efr32 image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-android image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-cirque image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-esp32 image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-esp32-qemu image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-k32w image Signed-off-by: Victor Morales * Pin versions for connectedhomeip/chip-build-nrf-platform image Signed-off-by: Victor Morales Co-authored-by: Victor Morales --- .../images/chip-build-android/Dockerfile | 8 +- .../images/chip-build-cirque/Dockerfile | 35 +++-- .../docker/images/chip-build-efr32/Dockerfile | 13 +- .../images/chip-build-esp32-qemu/Dockerfile | 9 +- .../docker/images/chip-build-esp32/Dockerfile | 13 +- .../docker/images/chip-build-k32w/Dockerfile | 14 +- .../images/chip-build-nrf-platform/Dockerfile | 26 ++-- .../docker/images/chip-build/Dockerfile | 140 +++++++++--------- 8 files changed, 134 insertions(+), 124 deletions(-) diff --git a/integrations/docker/images/chip-build-android/Dockerfile b/integrations/docker/images/chip-build-android/Dockerfile index fc6af8652b4981..afd635fdb96709 100644 --- a/integrations/docker/images/chip-build-android/Dockerfile +++ b/integrations/docker/images/chip-build-android/Dockerfile @@ -6,10 +6,10 @@ FROM connectedhomeip/chip-build:${VERSION} # doesn't work with JDK 11. RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - openjdk-8-jdk \ - rsync \ - swig \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + openjdk-8-jdk=8u292-b10-0ubuntu1~20.04 \ + rsync=3.1.3-8 \ + swig=4.0.1-5build1 \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-cirque/Dockerfile b/integrations/docker/images/chip-build-cirque/Dockerfile index d5ce966f4c3c5e..e8954de74b38f8 100644 --- a/integrations/docker/images/chip-build-cirque/Dockerfile +++ b/integrations/docker/images/chip-build-cirque/Dockerfile @@ -1,44 +1,47 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Bazel RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - curl gnupg \ - && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg \ - && mv bazel.gpg /etc/apt/trusted.gpg.d/ \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + curl=7.68.0-1ubuntu2.5 gnupg=2.2.19-3ubuntu2.1 \ + && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/bazel.gpg \ && echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - bazel \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + bazel=4.0.0 \ + && rm -rf /var/lib/apt/lists/ \ && : # aids diffs # Docker RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - curl gnupg-agent apt-transport-https ca-certificates \ - software-properties-common \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + curl=7.68.0-1ubuntu2.5 gnupg-agent=2.2.19-3ubuntu2.1 apt-transport-https=2.0.5 ca-certificates=20210119~20.04.1 \ + software-properties-common=0.98.9.4 \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ && add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - docker-ce docker-ce-cli containerd.io \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + docker-ce=5:20.10.6~3-0~ubuntu-focal docker-ce-cli=5:20.10.6~3-0~ubuntu-focal containerd.io=1.4.4-1 \ + && rm -rf /var/lib/apt/lists/ \ && : # aids diffs # Other Cirque prereqs RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - sudo socat psmisc tigervnc-standalone-server tigervnc-viewer \ - python3-pip python3-venv python3-setuptools libdbus-glib-1-dev \ - uuid-runtime libgirepository1.0-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + sudo=1.8.31-1ubuntu1.2 socat=1.7.3.3-2 psmisc=23.3-1 tigervnc-standalone-server=1.10.1+dfsg-3 tigervnc-viewer=1.10.1+dfsg-3 \ + python3-pip=20.0.2-5ubuntu1.3 python3-venv=3.8.2-0ubuntu2 python3-setuptools=45.2.0-1 libdbus-glib-1-dev=0.110-5fakssync1 \ + uuid-runtime=2.34-0.1ubuntu9.1 libgirepository1.0-dev=1.64.1-1~ubuntu20.04.1 \ + && rm -rf /var/lib/apt/lists/ \ && : # aids diffs COPY requirements_nogrpc.txt /requirements.txt RUN set -x \ - && pip3 install -r requirements.txt \ + && pip3 install --no-cache-dir -r requirements.txt \ && : # aids diffs diff --git a/integrations/docker/images/chip-build-efr32/Dockerfile b/integrations/docker/images/chip-build-efr32/Dockerfile index b744e687a73c1d..08535750735b7b 100644 --- a/integrations/docker/images/chip-build-efr32/Dockerfile +++ b/integrations/docker/images/chip-build-efr32/Dockerfile @@ -1,13 +1,12 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} - - - # GNU ARM Embedded toolchain, cross compiler for various platform builds RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - gcc-arm-none-eabi \ - binutils-arm-none-eabi \ - ccache + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + gcc-arm-none-eabi=15:9-2019-q4-0ubuntu1 \ + binutils-arm-none-eabi=2.34-4ubuntu1+13ubuntu1 \ + ccache=3.7.7-1 \ + && rm -rf /var/lib/apt/lists/ \ + && : # last line diff --git a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile index 6c7b0e523e1ad3..716b7c8272cad2 100644 --- a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile +++ b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile @@ -1,14 +1,13 @@ ARG VERSION=latest FROM connectedhomeip/chip-build-esp32:${VERSION} +WORKDIR /opt/espressif/qemu + # Setup QEMU emulator for ESP32 platform RUN set -x \ - && mkdir -p /opt/espressif \ - && git clone --progress --depth 1 --branch esp-develop-20210220 https://github.com/espressif/qemu.git /opt/espressif/qemu-src \ - && mkdir -p /opt/espressif/qemu \ - && (cd /opt/espressif/qemu \ + && git clone --depth 1 --branch esp-develop-20210220 https://github.com/espressif/qemu.git /opt/espressif/qemu-src \ && ../qemu-src/configure --target-list=xtensa-softmmu --enable-debug --enable-sanitizers --disable-strip --disable-user --disable-capstone --disable-vnc --disable-sdl --disable-gtk \ - && make -j8) \ + && make -j8 \ && : # last line ENV QEMU_ESP32_DIR=/opt/espressif/qemu diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 2894fa72a2aba9..efb50ee5ae54b3 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -1,16 +1,17 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} +WORKDIR /opt/espressif/esp-idf + # Setup the ESP-IDF RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y python libgcrypt20-dev \ - && mkdir -p /opt/espressif \ - && cd /opt/espressif \ - && git clone --progress -b release/v4.2 https://github.com/espressif/esp-idf.git \ - && cd esp-idf \ - && git submodule update --init --progress \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + python-is-python2=2.7.17-4 libgcrypt20-dev=1.8.5-5ubuntu1 \ + && git clone --depth=1 -b release/v4.2 https://github.com/espressif/esp-idf.git /opt/espressif/esp-idf \ + && git submodule update --init \ && IDF_TOOLS_PATH=/opt/espressif/tools ./install.sh \ + && rm -rf /var/lib/apt/lists/ \ && : # last line ENV IDF_PATH=/opt/espressif/esp-idf/ diff --git a/integrations/docker/images/chip-build-k32w/Dockerfile b/integrations/docker/images/chip-build-k32w/Dockerfile index d558f2c5cd3c56..08a87737d38e70 100644 --- a/integrations/docker/images/chip-build-k32w/Dockerfile +++ b/integrations/docker/images/chip-build-k32w/Dockerfile @@ -1,19 +1,19 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} +WORKDIR /opt/sdk + # Setup the K32W SDK RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y wget unzip \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + wget=1.20.3-1ubuntu1 unzip=6.0-25ubuntu1 \ && rm -rf /var/lib/apt/lists/ \ - && mkdir -p /opt/sdk \ - && cd /opt/sdk \ && wget https://mcuxpresso.nxp.com/eclipse/sdk/2.6.3/plugins/com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ && unzip com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ - && rm -rf com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ - && cd sdks \ - && unzip 5faab205f2663647c5c7ce05c382d2a8.zip \ - && rm -rf 5faab205f2663647c5c7ce05c382d2a8.zip \ + && unzip sdks/5faab205f2663647c5c7ce05c382d2a8.zip -d sdks/ \ + && rm -f com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ + && rm -f sdk/5faab205f2663647c5c7ce05c382d2a8.zip \ && : # last line ENV K32W061_SDK_ROOT=/opt/sdk/sdks diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index 5d93841fc05fa4..a8390bd528dd90 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -8,17 +8,19 @@ ARG NCS_REVISION=v1.5.0 # nRF Connect SDK dependencies # ================================================== +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +WORKDIR /opt/NordicSemiconductor/nRF5_tools/install + # Tools for building, flashing and accessing device logs RUN set -x \ && apt-get update \ - && apt-get install --no-install-recommends -fy device-tree-compiler \ - && (mkdir -p /opt/NordicSemiconductor/nRF5_tools/install && cd /opt/NordicSemiconductor/nRF5_tools/install \ + && apt-get install --no-install-recommends -fy device-tree-compiler=1.5.1-1 \ && curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz \ | tar zxvf - \ - && cd .. \ - && tar xvf install/JLink_Linux_V688a_x86_64.tgz \ - && tar xvf install/nRF-Command-Line-Tools_10_12_1.tar \ - && rm -rf ./install /var/lib/apt/lists/) \ + && tar xvf JLink_Linux_V688a_x86_64.tgz -C /opt/NordicSemiconductor/nRF5_tools/ \ + && tar xvf nRF-Command-Line-Tools_10_12_1.tar -C /opt/NordicSemiconductor/nRF5_tools/ \ + && rm -rf ./install /var/lib/apt/lists/ \ && : # last line ENV NRF5_TOOLS_ROOT=/opt/NordicSemiconductor/nRF5_tools @@ -26,26 +28,28 @@ ENV PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V688a_x86_64:${PATH} ENV PATH=${NRF5_TOOLS_ROOT}/mergehex:${NRF5_TOOLS_ROOT}/nrfjprog:${PATH} ENV LD_LIBRARY_PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V688a_x86_64:${LD_LIBRARY_PATH} +WORKDIR /opt/ARM-software + # GNU ARM Embedded toolchain, cross compiler for various platform builds RUN set -x \ - && (mkdir -p /opt/ARM-software && cd /opt/ARM-software \ && curl https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \ - | tar jxvf -) \ + | tar jxvf - \ && : # last line ENV ARM_GCC_INSTALL_ROOT=/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/ +WORKDIR /opt/NordicSemiconductor/nrfconnect + # ================================================== # nRF Connect SDK # ================================================== RUN set -x \ - && (mkdir -p /opt/NordicSemiconductor/nrfconnect && cd /opt/NordicSemiconductor/nrfconnect \ - && python3 -m pip install -U --no-cache-dir pip setuptools wheel cmake west \ + && python3 -m pip install -U --no-cache-dir pip==21.1 setuptools==56.0.0 wheel==0.36.2 cmake==3.18.4.post1 west==0.10.1 \ && west init -m https://github.com/nrfconnect/sdk-nrf --mr $NCS_REVISION \ && west update \ && python3 -m pip install --no-cache-dir -r zephyr/scripts/requirements.txt \ && python3 -m pip install --no-cache-dir -r nrf/scripts/requirements.txt \ - && python3 -m pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt) \ + && python3 -m pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt \ && echo "source /opt/NordicSemiconductor/nrfconnect/zephyr/zephyr-env.sh" >> ~/.bashrc \ && : # last line diff --git a/integrations/docker/images/chip-build/Dockerfile b/integrations/docker/images/chip-build/Dockerfile index 56913b71ad862e..1da02a0d559ebc 100644 --- a/integrations/docker/images/chip-build/Dockerfile +++ b/integrations/docker/images/chip-build/Dockerfile @@ -6,61 +6,62 @@ VOLUME "/var/source" # base build and check tools and libraries layer RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ - autoconf \ - automake \ - bison \ - bridge-utils \ - clang \ - clang-format \ - clang-tidy \ - curl \ - flex \ - g++ \ - git \ - gperf \ - iproute2 \ - jq \ - lcov \ - libavahi-client-dev \ - libavahi-common-dev \ - libcairo2-dev \ - libdbus-1-dev \ - libdbus-glib-1-dev \ - libgif-dev \ - libglib2.0-dev \ - libical-dev \ - libjpeg-dev \ - libdmalloc-dev \ - libmbedtls-dev \ - libncurses5-dev \ - libncursesw5-dev \ - libnspr4-dev \ - libpango1.0-dev \ - libpixman-1-dev \ - libreadline-dev \ - libssl-dev \ - libtool \ - libudev-dev \ - libusb-1.0-0 \ - libusb-dev \ - libxml2-dev \ - make \ - net-tools \ - ninja-build \ - openjdk-8-jdk \ - pkg-config \ - python3 \ - python3-dev \ - python3-pip \ - python3-venv \ - shellcheck \ - strace \ - systemd \ - udev \ - unzip \ - wget \ - zlib1g-dev \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ + autoconf=2.69-11.1 \ + automake=1:1.16.1-4ubuntu6 \ + bison=2:3.5.1+dfsg-1 \ + bridge-utils=1.6-2ubuntu1 \ + clang=1:10.0-50~exp1 \ + clang-format=1:10.0-50~exp1 \ + clang-tidy=1:10.0-50~exp1 \ + curl=7.68.0-1ubuntu2.5 \ + flex=2.6.4-6.2 \ + g++=4:9.3.0-1ubuntu2 \ + git=1:2.25.1-1ubuntu3.1 \ + gperf=3.1-1build1 \ + iproute2=5.5.0-1ubuntu1 \ + jq=1.6-1ubuntu0.20.04.1 \ + lcov=1.14-2 \ + libavahi-client-dev=0.7-4ubuntu7 \ + libavahi-common-dev=0.7-4ubuntu7 \ + libcairo2-dev=1.16.0-4ubuntu1 \ + libdbus-1-dev=1.12.16-2ubuntu2.1 \ + libdbus-glib-1-dev=0.110-5fakssync1 \ + libgif-dev=5.1.9-1 \ + libglib2.0-dev=2.64.6-1~ubuntu20.04.3 \ + libical-dev=3.0.8-1 \ + libjpeg-dev=8c-2ubuntu8 \ + libdmalloc-dev=5.5.2-14build1 \ + libmbedtls-dev=2.16.4-1ubuntu2 \ + libncurses5-dev=6.2-0ubuntu2 \ + libncursesw5-dev=6.2-0ubuntu2 \ + libnspr4-dev=2:4.25-1 \ + libpango1.0-dev=1.44.7-2ubuntu4 \ + libpixman-1-dev=0.38.4-0ubuntu1 \ + libreadline-dev=8.0-4 \ + libssl-dev=1.1.1f-1ubuntu2.3 \ + libtool=2.4.6-14 \ + libudev-dev=245.4-4ubuntu3.6 \ + libusb-1.0-0=2:1.0.23-2build1 \ + libusb-dev=2:0.1.12-32 \ + libxml2-dev=2.9.10+dfsg-5 \ + make=4.2.1-1.2 \ + net-tools=1.60+git20180626.aebd88e-1ubuntu1 \ + ninja-build=1.10.0-1build1 \ + openjdk-8-jdk=8u292-b10-0ubuntu1~20.04 \ + pkg-config=0.29.1-0ubuntu4 \ + python3=3.8.2-0ubuntu2 \ + python3-dev=3.8.2-0ubuntu2 \ + python3-pip=20.0.2-5ubuntu1.3 \ + python3-venv=3.8.2-0ubuntu2 \ + shellcheck=0.7.0-2build2 \ + strace=5.5-3ubuntu1 \ + systemd=245.4-4ubuntu3.6 \ + udev=245.4-4ubuntu3.6 \ + unzip=6.0-25ubuntu1 \ + wget=1.20.3-1ubuntu1 \ + xz-utils=5.2.4-1ubuntu1 \ + zlib1g-dev=1:1.2.11.dfsg-2ubuntu1.2 \ && rm -rf /var/lib/apt/lists/ \ && : # last line @@ -76,17 +77,24 @@ RUN set -x \ # Python 2 and PIP RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common=0.98.9.4 \ && add-apt-repository universe \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y python python2 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python2=2.7.17-2ubuntu4 \ && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \ && python2 get-pip.py \ && rm -rf /var/lib/apt/lists/ \ && : # last line RUN set -x \ - && pip3 install circleci attrs coloredlogs PyGithub pygit future \ - portpicker mobly \ + && pip3 install --no-cache-dir \ + circleci==1.2.2 \ + attrs==20.3.0 \ + coloredlogs==15.0 \ + PyGithub==1.55 \ + pygit==0.1 \ + future==0.18.2 \ + portpicker==1.3.1 \ + mobly==1.10.1 \ && : # last line # build and install gn @@ -102,7 +110,7 @@ RUN set -x \ # Install bloat comparison tools RUN set -x \ - && git clone https://github.com/google/bloaty.git \ + && git clone --depth=1 https://github.com/google/bloaty.git \ && mkdir -p bloaty/build \ && cd bloaty/build \ && cmake ../ \ @@ -115,13 +123,9 @@ RUN set -x \ # NodeJS: install a newer version than what apt-get would read # This installs the latest LTS version of nodejs RUN set -x \ - && mkdir node_js \ - && cd node_js \ - && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ - && tar xfvJ node-v12.19.0-linux-x64.tar.xz \ - && mv node-v12.19.0-linux-x64 /opt/ \ - && ln -s /opt/node-v12.19.0-linux-x64 /opt/node \ + && curl -o node.tgz -s https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ + && mkdir -p /opt/node \ + && tar xfJ node.tgz --strip-components=1 -C /opt/node \ && ln -s /opt/node/bin/* /usr/bin \ - && cd .. \ - && rm -rf node_js \ + && rm -f node.tgz \ && : # last line From 5f21fe281794e5c9adca16d78925c9483b521719 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 4 May 2021 22:29:22 -0700 Subject: [PATCH 26/31] Move PacketHeader encoding/decoding from various Transport wrappers to upper layer (#6333) * Move packetHeader decoding from transport to messaging * Move encoding from transport layer to messaging layer * Remove CRMP rewind * Address the review comments * remove extra return check. * Update src/transport/SecureSessionMgr.h Co-authored-by: Boris Zbarsky * Update src/transport/TransportMgr.h Co-authored-by: Boris Zbarsky * Update src/transport/raw/TCP.cpp Co-authored-by: Boris Zbarsky * Update src/transport/raw/Tuple.h Co-authored-by: Boris Zbarsky * Add UDP checking back Co-authored-by: Boris Zbarsky --- src/messaging/ExchangeMgr.cpp | 9 +++-- src/messaging/ExchangeMgr.h | 3 +- src/messaging/MessageCounterSync.cpp | 5 +-- src/messaging/tests/TestExchangeMgr.cpp | 4 +- .../tests/TestReliableMessageProtocol.cpp | 4 +- .../SessionEstablishmentExchangeDispatch.cpp | 6 ++- .../secure_channel/tests/TestCASESession.cpp | 4 +- .../secure_channel/tests/TestPASESession.cpp | 4 +- src/transport/SecureSessionMgr.cpp | 40 +++++++------------ src/transport/SecureSessionMgr.h | 10 ++--- src/transport/TransportMgr.h | 6 +-- src/transport/TransportMgrBase.cpp | 13 +++--- src/transport/TransportMgrBase.h | 6 +-- src/transport/raw/BLE.cpp | 16 +------- src/transport/raw/BLE.h | 3 +- src/transport/raw/Base.h | 9 ++--- src/transport/raw/TCP.cpp | 31 ++++---------- src/transport/raw/TCP.h | 2 +- src/transport/raw/Tuple.h | 15 ++++--- src/transport/raw/UDP.cpp | 11 +---- src/transport/raw/UDP.h | 3 +- src/transport/raw/tests/TestTCP.cpp | 15 ++++--- src/transport/raw/tests/TestUDP.cpp | 19 ++++++--- src/transport/tests/TestSecureSessionMgr.cpp | 10 ++--- 24 files changed, 101 insertions(+), 147 deletions(-) diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index 7387dcfe83da1d..368812de4043cb 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -369,10 +369,13 @@ void ExchangeManager::OnConnectionExpired(SecureSessionHandle session, SecureSes } } -void ExchangeManager::OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) +void ExchangeManager::OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) { - auto peer = header.GetSourceNodeId(); + PacketHeader header; + + ReturnOnFailure(header.DecodeAndConsume(msgBuf)); + + Optional peer = header.GetSourceNodeId(); if (!peer.HasValue()) { char addrBuffer[Transport::PeerAddress::kMaxToStringSize]; diff --git a/src/messaging/ExchangeMgr.h b/src/messaging/ExchangeMgr.h index 490f4b2cc89221..d5b7fa7ca6f3e7 100644 --- a/src/messaging/ExchangeMgr.h +++ b/src/messaging/ExchangeMgr.h @@ -251,8 +251,7 @@ class DLL_EXPORT ExchangeManager : public SecureSessionMgrDelegate, public Trans void OnConnectionExpired(SecureSessionHandle session, SecureSessionMgr * mgr) override; // TransportMgrDelegate interface for rendezvous sessions - void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) override; + void OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) override; CHIP_ERROR QueueReceivedMessageAndSync(Transport::PeerConnectionState * state, System::PacketBufferHandle msgBuf) override; }; diff --git a/src/messaging/MessageCounterSync.cpp b/src/messaging/MessageCounterSync.cpp index 0b4a8c9b90bfe1..9045be21f8e34b 100644 --- a/src/messaging/MessageCounterSync.cpp +++ b/src/messaging/MessageCounterSync.cpp @@ -207,10 +207,9 @@ void MessageCounterSyncMgr::ProcessPendingGroupMsgs(NodeId peerNodeId) if (packetHeader.GetSourceNodeId().HasValue() && packetHeader.GetSourceNodeId().Value() == peerNodeId) { - (entry.msgBuf)->ConsumeHead(headerSize); - // Reprocess message. - mExchangeMgr->GetSessionMgr()->HandleGroupMessageReceived(packetHeader, std::move(entry.msgBuf)); + mExchangeMgr->GetSessionMgr()->HandleGroupMessageReceived(packetHeader.GetEncryptionKeyID(), + std::move(entry.msgBuf)); // Explicitly free any buffer owned by this handle. The // HandleGroupMessageReceived() call should really handle this, but diff --git a/src/messaging/tests/TestExchangeMgr.cpp b/src/messaging/tests/TestExchangeMgr.cpp index 6a30ce4bdca45b..52ec85f5dc71d0 100644 --- a/src/messaging/tests/TestExchangeMgr.cpp +++ b/src/messaging/tests/TestExchangeMgr.cpp @@ -57,9 +57,9 @@ class LoopbackTransport : public Transport::Base /// Transports are required to have a constructor that takes exactly one argument CHIP_ERROR Init(const char * unused) { return CHIP_NO_ERROR; } - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { - HandleMessageReceived(header, address, std::move(msgBuf)); + HandleMessageReceived(address, std::move(msgBuf)); return CHIP_NO_ERROR; } diff --git a/src/messaging/tests/TestReliableMessageProtocol.cpp b/src/messaging/tests/TestReliableMessageProtocol.cpp index 7b602ba4384b54..5225a30236173f 100644 --- a/src/messaging/tests/TestReliableMessageProtocol.cpp +++ b/src/messaging/tests/TestReliableMessageProtocol.cpp @@ -65,10 +65,8 @@ class OutgoingTransport : public Transport::Base /// Transports are required to have a constructor that takes exactly one argument CHIP_ERROR Init(const char * unused) { return CHIP_NO_ERROR; } - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { - ReturnErrorOnFailure(header.EncodeBeforeData(msgBuf)); - gSendMessageCount++; return CHIP_NO_ERROR; diff --git a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp index 3eb32b6505af14..e0b38323325c2b 100644 --- a/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp +++ b/src/protocols/secure_channel/SessionEstablishmentExchangeDispatch.cpp @@ -32,10 +32,14 @@ CHIP_ERROR SessionEstablishmentExchangeDispatch::SendMessageImpl(SecureSessionHa System::PacketBufferHandle && message, EncryptedPacketBufferHandle * retainedMessage) { + PacketHeader packetHeader; + ReturnErrorOnFailure(payloadHeader.EncodeBeforeData(message)); + ReturnErrorOnFailure(packetHeader.EncodeBeforeData(message)); + if (mTransportMgr != nullptr) { - return mTransportMgr->SendMessage(PacketHeader(), mPeerAddress, std::move(message)); + return mTransportMgr->SendMessage(mPeerAddress, std::move(message)); } return CHIP_ERROR_INCORRECT_STATE; diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index ab6391c5a516c8..0bdb806a237818 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -52,11 +52,11 @@ using TestContext = chip::Test::MessagingContext; class LoopbackTransport : public Transport::Base { public: - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { ReturnErrorOnFailure(mMessageSendError); mSentMessageCount++; - HandleMessageReceived(header, address, std::move(msgBuf)); + HandleMessageReceived(address, std::move(msgBuf)); return CHIP_NO_ERROR; } diff --git a/src/protocols/secure_channel/tests/TestPASESession.cpp b/src/protocols/secure_channel/tests/TestPASESession.cpp index 74c9fc40f7125f..f4e4a6b9f6dfcf 100644 --- a/src/protocols/secure_channel/tests/TestPASESession.cpp +++ b/src/protocols/secure_channel/tests/TestPASESession.cpp @@ -44,11 +44,11 @@ using TestContext = chip::Test::MessagingContext; class LoopbackTransport : public Transport::Base { public: - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { ReturnErrorOnFailure(mMessageSendError); mSentMessageCount++; - HandleMessageReceived(header, address, std::move(msgBuf)); + HandleMessageReceived(address, std::move(msgBuf)); return CHIP_NO_ERROR; } diff --git a/src/transport/SecureSessionMgr.cpp b/src/transport/SecureSessionMgr.cpp index fcb7399494ca41..8d8876967e1902 100644 --- a/src/transport/SecureSessionMgr.cpp +++ b/src/transport/SecureSessionMgr.cpp @@ -130,7 +130,7 @@ CHIP_ERROR SecureSessionMgr::SendEncryptedMessage(SecureSessionHandle session, E VerifyOrReturnError(!msgBuf.IsNull(), CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(!msgBuf->HasChainedBuffer(), CHIP_ERROR_INVALID_MESSAGE_LENGTH); - // Advancing the start to encrypted header, since the transport will attach the packet header on top of it + // Advancing the start to encrypted header, since SendMessage will attach the packet header on top of it. PacketHeader packetHeader; ReturnErrorOnFailure(packetHeader.DecodeAndConsume(msgBuf)); @@ -145,9 +145,6 @@ CHIP_ERROR SecureSessionMgr::SendMessage(SecureSessionHandle session, PayloadHea { CHIP_ERROR err = CHIP_NO_ERROR; PeerConnectionState * state = nullptr; - uint8_t * msgStart = nullptr; - uint16_t msgLen = 0; - uint16_t headerSize = 0; NodeId localNodeId = mLocalNodeId; Transport::AdminPairingInfo * admin = nullptr; @@ -184,13 +181,8 @@ CHIP_ERROR SecureSessionMgr::SendMessage(SecureSessionHandle session, PayloadHea SuccessOrExit(err); } - // The start of buffer points to the beginning of the encrypted header, and the length of buffer - // contains both the encrypted header and encrypted data. - // Locally store the start and length of the retained buffer after accounting for the size of packet header. - headerSize = packetHeader.EncodeSizeBytes(); - - msgStart = static_cast(msgBuf->Start() - headerSize); - msgLen = static_cast(msgBuf->DataLength() + headerSize); + err = packetHeader.EncodeBeforeData(msgBuf); + SuccessOrExit(err); // Retain the packet buffer in case it's needed for retransmissions. if (bufferRetainSlot != nullptr) @@ -207,22 +199,18 @@ CHIP_ERROR SecureSessionMgr::SendMessage(SecureSessionHandle session, PayloadHea if (state->GetTransport() != nullptr) { ChipLogProgress(Inet, "Sending secure msg on connection specific transport"); - err = state->GetTransport()->SendMessage(packetHeader, state->GetPeerAddress(), std::move(msgBuf)); + err = state->GetTransport()->SendMessage(state->GetPeerAddress(), std::move(msgBuf)); } else { ChipLogProgress(Inet, "Sending secure msg on generic transport"); - err = mTransportMgr->SendMessage(packetHeader, state->GetPeerAddress(), std::move(msgBuf)); + err = mTransportMgr->SendMessage(state->GetPeerAddress(), std::move(msgBuf)); } ChipLogProgress(Inet, "Secure msg send status %s", ErrorStr(err)); SuccessOrExit(err); if (bufferRetainSlot != nullptr) { - // Rewind the start and len of the buffer back to pre-send state for following possible retransmition. - encryptedMsg->SetStart(msgStart); - encryptedMsg->SetDataLength(msgLen); - (*bufferRetainSlot) = std::move(encryptedMsg); } @@ -331,17 +319,20 @@ void SecureSessionMgr::CancelExpiryTimer() } } -void SecureSessionMgr::HandleGroupMessageReceived(const PacketHeader & packetHeader, System::PacketBufferHandle msgBuf) +void SecureSessionMgr::HandleGroupMessageReceived(uint16_t keyId, System::PacketBufferHandle msgBuf) { - PeerConnectionState * state = mPeerConnections.FindPeerConnectionState(packetHeader.GetEncryptionKeyID(), nullptr); + PeerConnectionState * state = mPeerConnections.FindPeerConnectionState(keyId, nullptr); VerifyOrReturn(state != nullptr, ChipLogError(Inet, "Failed to find the peer connection state")); - OnMessageReceived(packetHeader, state->GetPeerAddress(), std::move(msgBuf)); + OnMessageReceived(state->GetPeerAddress(), std::move(msgBuf)); } -void SecureSessionMgr::OnMessageReceived(const PacketHeader & packetHeader, const PeerAddress & peerAddress, - System::PacketBufferHandle msg) +void SecureSessionMgr::OnMessageReceived(const PeerAddress & peerAddress, System::PacketBufferHandle msg) { + PacketHeader packetHeader; + + ReturnOnFailure(packetHeader.DecodeAndConsume(msg)); + if (packetHeader.GetFlags().Has(Header::FlagValues::kSecure)) { SecureMessageDispatch(packetHeader, peerAddress, std::move(msg)); @@ -400,9 +391,8 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, // Queue the message as needed for sync with destination node. if (mCB != nullptr) { - // We should encode the packetHeader into the buffer before storing the buffer into the queue. - // The encoded packetHeader needs to be peeled off during re-processing after the peer message - // counter is synced. + // We should encode the packetHeader into the buffer before storing the buffer into the queue since the + // stored buffer will be re-processed by OnMessageReceived after the peer message counter is synced. ReturnOnFailure(packetHeader.EncodeBeforeData(msg)); err = mCB->QueueReceivedMessageAndSync(state, std::move(msg)); VerifyOrReturn(err == CHIP_NO_ERROR); diff --git a/src/transport/SecureSessionMgr.h b/src/transport/SecureSessionMgr.h index 8fd23673141ead..d206d73305f648 100644 --- a/src/transport/SecureSessionMgr.h +++ b/src/transport/SecureSessionMgr.h @@ -287,10 +287,10 @@ class DLL_EXPORT SecureSessionMgr : public TransportMgrDelegate * Called when a cached group message that was waiting for message counter * sync shold be reprocessed. * - * @param packetHeader The message header + * @param keyId The encryption Key ID of the message buffer * @param msgBuf The received message */ - void HandleGroupMessageReceived(const PacketHeader & packetHeader, System::PacketBufferHandle msgBuf); + void HandleGroupMessageReceived(uint16_t keyId, System::PacketBufferHandle msgBuf); /** * @brief @@ -317,12 +317,10 @@ class DLL_EXPORT SecureSessionMgr : public TransportMgrDelegate * @brief * Handle received secure message. Implements TransportMgrDelegate * - * @param header the received message header * @param source the source address of the package - * @param msgBuf the buffer of (encrypted) payload + * @param msgBuf the buffer containing a full CHIP message (except for the optional length field). */ - void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) override; + void OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) override; private: /** diff --git a/src/transport/TransportMgr.h b/src/transport/TransportMgr.h index 306a1602e87119..30e9803174a1bd 100644 --- a/src/transport/TransportMgr.h +++ b/src/transport/TransportMgr.h @@ -47,12 +47,10 @@ class TransportMgrDelegate * @brief * Handle received secure message. * - * @param header the received message header * @param source the source address of the package - * @param msgBuf the buffer of (encrypted) payload + * @param msgBuf the buffer containing a full CHIP message (except for the optional length field). */ - virtual void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) = 0; + virtual void OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) = 0; }; template diff --git a/src/transport/TransportMgrBase.cpp b/src/transport/TransportMgrBase.cpp index 0265e6369dc34b..a273a860bcc02c 100644 --- a/src/transport/TransportMgrBase.cpp +++ b/src/transport/TransportMgrBase.cpp @@ -22,10 +22,9 @@ namespace chip { -CHIP_ERROR TransportMgrBase::SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle && msgBuf) +CHIP_ERROR TransportMgrBase::SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle && msgBuf) { - return mTransport->SendMessage(header, address, std::move(msgBuf)); + return mTransport->SendMessage(address, std::move(msgBuf)); } void TransportMgrBase::Disconnect(const Transport::PeerAddress & address) @@ -51,19 +50,17 @@ void TransportMgrBase::Close() mTransport = nullptr; } -void TransportMgrBase::HandleMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle msg) +void TransportMgrBase::HandleMessageReceived(const Transport::PeerAddress & peerAddress, System::PacketBufferHandle msg) { if (mSecureSessionMgr != nullptr) { - mSecureSessionMgr->OnMessageReceived(packetHeader, peerAddress, std::move(msg)); + mSecureSessionMgr->OnMessageReceived(peerAddress, std::move(msg)); } else { char addrBuffer[Transport::PeerAddress::kMaxToStringSize]; peerAddress.ToString(addrBuffer); - ChipLogError(Inet, "%s message from %s is dropped since no corresponding handler is set in TransportMgr.", - packetHeader.GetFlags().Has(Header::FlagValues::kSecure) ? "Encrypted" : "Unencrypted", addrBuffer); + ChipLogError(Inet, "message from %s is dropped since no corresponding handler is set in TransportMgr.", addrBuffer); } } diff --git a/src/transport/TransportMgrBase.h b/src/transport/TransportMgrBase.h index fcb60080ce881c..3467eb27dfacff 100644 --- a/src/transport/TransportMgrBase.h +++ b/src/transport/TransportMgrBase.h @@ -35,8 +35,7 @@ class TransportMgrBase : public Transport::RawTransportDelegate public: CHIP_ERROR Init(Transport::Base * transport); - CHIP_ERROR SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle && msgBuf); + CHIP_ERROR SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle && msgBuf); void Close(); @@ -44,8 +43,7 @@ class TransportMgrBase : public Transport::RawTransportDelegate void SetSecureSessionMgr(TransportMgrDelegate * secureSessionMgr) { mSecureSessionMgr = secureSessionMgr; } - void HandleMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle msg) override; + void HandleMessageReceived(const Transport::PeerAddress & peerAddress, System::PacketBufferHandle msg) override; private: TransportMgrDelegate * mSecureSessionMgr = nullptr; diff --git a/src/transport/raw/BLE.cpp b/src/transport/raw/BLE.cpp index accd39c1fb2216..97c4c1ced4cec5 100644 --- a/src/transport/raw/BLE.cpp +++ b/src/transport/raw/BLE.cpp @@ -94,14 +94,11 @@ CHIP_ERROR BLEBase::SetEndPoint(Ble::BLEEndPoint * endPoint) return err; } -CHIP_ERROR BLEBase::SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle msgBuf) +CHIP_ERROR BLEBase::SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) { ReturnErrorCodeIf(address.GetTransportType() != Type::kBle, CHIP_ERROR_INVALID_ARGUMENT); ReturnErrorCodeIf(mState == State::kNotReady, CHIP_ERROR_INCORRECT_STATE); - ReturnErrorOnFailure(header.EncodeBeforeData(msgBuf)); - if (mState == State::kConnected) { ReturnErrorOnFailure(mBleEndPoint->Send(std::move(msgBuf))); @@ -163,16 +160,7 @@ void BLEBase::OnBleConnectionError(BLE_ERROR err) void BLEBase::OnEndPointMessageReceived(BLEEndPoint * endPoint, PacketBufferHandle buffer) { - CHIP_ERROR err = CHIP_NO_ERROR; - - PacketHeader header; - if ((err = header.DecodeAndConsume(buffer)) != CHIP_NO_ERROR) - { - ChipLogError(Inet, "Failed to receive BLE message: %s", ErrorStr(err)); - return; - } - - HandleMessageReceived(header, Transport::PeerAddress(Transport::Type::kBle), std::move(buffer)); + HandleMessageReceived(Transport::PeerAddress(Transport::Type::kBle), std::move(buffer)); } void BLEBase::OnEndPointConnectComplete(BLEEndPoint * endPoint, BLE_ERROR err) diff --git a/src/transport/raw/BLE.h b/src/transport/raw/BLE.h index fa367c57e606f7..556da5501df2ad 100644 --- a/src/transport/raw/BLE.h +++ b/src/transport/raw/BLE.h @@ -82,8 +82,7 @@ class DLL_EXPORT BLEBase : public Base, public Ble::BleLayerDelegate */ CHIP_ERROR Init(const BleListenParameters & param); - CHIP_ERROR SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle msgBuf) override; + CHIP_ERROR SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) override; bool CanSendToPeer(const Transport::PeerAddress & address) override { diff --git a/src/transport/raw/Base.h b/src/transport/raw/Base.h index 56d60624ce17f0..0f7950adf9ceee 100644 --- a/src/transport/raw/Base.h +++ b/src/transport/raw/Base.h @@ -37,8 +37,7 @@ class RawTransportDelegate { public: virtual ~RawTransportDelegate() {} - virtual void HandleMessageReceived(const PacketHeader & packetHeader, const Transport::PeerAddress & peerAddress, - System::PacketBufferHandle msg) = 0; + virtual void HandleMessageReceived(const Transport::PeerAddress & peerAddress, System::PacketBufferHandle msg) = 0; }; /** @@ -64,7 +63,7 @@ class Base * * On connection-oriented transports, sending a message implies connecting to the target first. */ - virtual CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) = 0; + virtual CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) = 0; /** * Determine if this transport can SendMessage to the specified peer address. @@ -88,9 +87,9 @@ class Base * Method used by subclasses to notify that a packet has been received after * any associated headers have been decoded. */ - void HandleMessageReceived(const PacketHeader & header, const PeerAddress & source, System::PacketBufferHandle && buffer) + void HandleMessageReceived(const PeerAddress & source, System::PacketBufferHandle && buffer) { - mDelegate->HandleMessageReceived(header, source, std::move(buffer)); + mDelegate->HandleMessageReceived(source, std::move(buffer)); } RawTransportDelegate * mDelegate; diff --git a/src/transport/raw/TCP.cpp b/src/transport/raw/TCP.cpp index 8b22b08c44a6a5..0949920f28a789 100644 --- a/src/transport/raw/TCP.cpp +++ b/src/transport/raw/TCP.cpp @@ -168,37 +168,25 @@ TCPBase::ActiveConnectionState * TCPBase::FindActiveConnection(const Inet::TCPEn return nullptr; } -CHIP_ERROR TCPBase::SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle msgBuf) +CHIP_ERROR TCPBase::SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) { // Sent buffer data format is: - // - packet size as a uint16_t (inludes size of header and actual data) - // - header + // - packet size as a uint16_t // - actual data - const size_t prefixSize = header.EncodeSizeBytes() + kPacketSizeBytes; VerifyOrReturnError(address.GetTransportType() == Type::kTcp, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(mState == State::kInitialized, CHIP_ERROR_INCORRECT_STATE); - VerifyOrReturnError(prefixSize + msgBuf->DataLength() <= std::numeric_limits::max(), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(kPacketSizeBytes + msgBuf->DataLength() <= std::numeric_limits::max(), + CHIP_ERROR_INVALID_ARGUMENT); - // The check above about prefixSize + msgBuf->DataLength() means prefixSize - // definitely fits in uint16_t. - VerifyOrReturnError(msgBuf->EnsureReservedSize(static_cast(prefixSize)), CHIP_ERROR_NO_MEMORY); + // The check above about kPacketSizeBytes + msgBuf->DataLength() means it definitely fits in uint16_t. + VerifyOrReturnError(msgBuf->EnsureReservedSize(static_cast(kPacketSizeBytes)), CHIP_ERROR_NO_MEMORY); - msgBuf->SetStart(msgBuf->Start() - prefixSize); - - // Length is actual data, without considering the length bytes themselves - VerifyOrReturnError(msgBuf->DataLength() >= kPacketSizeBytes, CHIP_ERROR_INTERNAL); + msgBuf->SetStart(msgBuf->Start() - kPacketSizeBytes); uint8_t * output = msgBuf->Start(); LittleEndian::Write16(output, static_cast(msgBuf->DataLength() - kPacketSizeBytes)); - uint16_t actualEncodedHeaderSize; - ReturnErrorOnFailure(header.Encode(output, msgBuf->DataLength(), &actualEncodedHeaderSize)); - - // header encoding has to match space that we allocated - VerifyOrReturnError(prefixSize == actualEncodedHeaderSize + kPacketSizeBytes, CHIP_ERROR_INTERNAL); - // Reuse existing connection if one exists, otherwise a new one // will be established ActiveConnectionState * connection = FindActiveConnection(address); @@ -360,10 +348,7 @@ CHIP_ERROR TCPBase::ProcessSingleMessage(const PeerAddress & peerAddress, Active message->SetDataLength(messageSize); } - PacketHeader header; - ReturnErrorOnFailure(header.DecodeAndConsume(message)); - - HandleMessageReceived(header, peerAddress, std::move(message)); + HandleMessageReceived(peerAddress, std::move(message)); return CHIP_NO_ERROR; } diff --git a/src/transport/raw/TCP.h b/src/transport/raw/TCP.h index 50e1d696ca4b7d..666c57d8f16d7c 100644 --- a/src/transport/raw/TCP.h +++ b/src/transport/raw/TCP.h @@ -163,7 +163,7 @@ class DLL_EXPORT TCPBase : public Base */ void Close() override; - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override; + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override; void Disconnect(const PeerAddress & address) override; diff --git a/src/transport/raw/Tuple.h b/src/transport/raw/Tuple.h index 1a13da7bc4a232..1526ca2d8577f2 100644 --- a/src/transport/raw/Tuple.h +++ b/src/transport/raw/Tuple.h @@ -81,9 +81,9 @@ template class Tuple : public Base { public: - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { - return SendMessageImpl<0>(header, address, std::move(msgBuf)); + return SendMessageImpl<0>(address, std::move(msgBuf)); } bool CanSendToPeer(const PeerAddress & address) override { return CanSendToPeerImpl<0>(address); } @@ -180,26 +180,25 @@ class Tuple : public Base * * @tparam N the index of the underlying transport to run SendMessage throug. * - * @param header the message header to send * @param address where to send the message - * @param msgBuf the data to send. + * @param msgBuf the message to send. Includes all CHIP message fields except optional length. */ template ::type * = nullptr> - CHIP_ERROR SendMessageImpl(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle && msgBuf) + CHIP_ERROR SendMessageImpl(const PeerAddress & address, System::PacketBufferHandle && msgBuf) { Base * base = &std::get(mTransports); if (base->CanSendToPeer(address)) { - return base->SendMessage(header, address, std::move(msgBuf)); + return base->SendMessage(address, std::move(msgBuf)); } - return SendMessageImpl(header, address, std::move(msgBuf)); + return SendMessageImpl(address, std::move(msgBuf)); } /** * SendMessageImpl when N is out of range. Always returns an error code. */ template = sizeof...(TransportTypes))>::type * = nullptr> - CHIP_ERROR SendMessageImpl(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) + CHIP_ERROR SendMessageImpl(const PeerAddress & address, System::PacketBufferHandle msgBuf) { return CHIP_ERROR_NO_MESSAGE_HANDLER; } diff --git a/src/transport/raw/UDP.cpp b/src/transport/raw/UDP.cpp index c78da4136a317b..1d442b72923915 100644 --- a/src/transport/raw/UDP.cpp +++ b/src/transport/raw/UDP.cpp @@ -85,7 +85,7 @@ void UDP::Close() mState = State::kNotReady; } -CHIP_ERROR UDP::SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) +CHIP_ERROR UDP::SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) { VerifyOrReturnError(address.GetTransportType() == Type::kUdp, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(mState == State::kInitialized, CHIP_ERROR_INCORRECT_STATE); @@ -98,8 +98,6 @@ CHIP_ERROR UDP::SendMessage(const PacketHeader & header, const Transport::PeerAd addrInfo.DestPort = address.GetPort(); addrInfo.Interface = address.GetInterface(); - ReturnErrorOnFailure(header.EncodeBeforeData(msgBuf)); - return mUDPEndPoint->SendMsg(&addrInfo, std::move(msgBuf)); } @@ -109,13 +107,8 @@ void UDP::OnUdpReceive(Inet::IPEndPointBasis * endPoint, System::PacketBufferHan UDP * udp = reinterpret_cast(endPoint->AppState); PeerAddress peerAddress = PeerAddress::UDP(pktInfo->SrcAddress, pktInfo->SrcPort); - PacketHeader header; - err = header.DecodeAndConsume(buffer); - SuccessOrExit(err); - - udp->HandleMessageReceived(header, peerAddress, std::move(buffer)); + udp->HandleMessageReceived(peerAddress, std::move(buffer)); -exit: if (err != CHIP_NO_ERROR) { ChipLogError(Inet, "Failed to receive UDP message: %s", ErrorStr(err)); diff --git a/src/transport/raw/UDP.h b/src/transport/raw/UDP.h index e77b60343ca426..b81fe8449bb1a6 100644 --- a/src/transport/raw/UDP.h +++ b/src/transport/raw/UDP.h @@ -110,8 +110,7 @@ class DLL_EXPORT UDP : public Base */ void Close() override; - CHIP_ERROR SendMessage(const PacketHeader & header, const Transport::PeerAddress & address, - System::PacketBufferHandle msgBuf) override; + CHIP_ERROR SendMessage(const Transport::PeerAddress & address, System::PacketBufferHandle msgBuf) override; bool CanSendToPeer(const Transport::PeerAddress & address) override { diff --git a/src/transport/raw/tests/TestTCP.cpp b/src/transport/raw/tests/TestTCP.cpp index cd801b7997c918..8e30309b56132e 100644 --- a/src/transport/raw/tests/TestTCP.cpp +++ b/src/transport/raw/tests/TestTCP.cpp @@ -89,12 +89,12 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate mCallback = callback; mCallbackData = callback_data; } - void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) override + void OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) override { - NL_TEST_ASSERT(mSuite, header.GetSourceNodeId() == Optional::Value(kSourceNodeId)); - NL_TEST_ASSERT(mSuite, header.GetDestinationNodeId() == Optional::Value(kDestinationNodeId)); - NL_TEST_ASSERT(mSuite, header.GetMessageId() == kMessageId); + PacketHeader packetHeader; + + CHIP_ERROR error = packetHeader.DecodeAndConsume(msgBuf); + NL_TEST_ASSERT(mSuite, error == CHIP_NO_ERROR); if (mCallback) { @@ -127,8 +127,11 @@ class MockTransportMgrDelegate : public chip::TransportMgrDelegate SetCallback([](const uint8_t * message, size_t length, int count, void * data) { return memcmp(message, data, length); }, const_cast(static_cast(PAYLOAD))); + CHIP_ERROR err = header.EncodeBeforeData(buffer); + NL_TEST_ASSERT(mSuite, err == CHIP_NO_ERROR); + // Should be able to send a message to itself by just calling send. - CHIP_ERROR err = tcp.SendMessage(header, Transport::PeerAddress::TCP(addr), std::move(buffer)); + err = tcp.SendMessage(Transport::PeerAddress::TCP(addr), std::move(buffer)); if (err == System::MapErrorPOSIX(EADDRNOTAVAIL)) { // TODO(#2698): the underlying system does not support IPV6. This early return diff --git a/src/transport/raw/tests/TestUDP.cpp b/src/transport/raw/tests/TestUDP.cpp index aa7a75a170c8d2..2cb8aa96a50751 100644 --- a/src/transport/raw/tests/TestUDP.cpp +++ b/src/transport/raw/tests/TestUDP.cpp @@ -58,12 +58,16 @@ class MockTransportMgrDelegate : public TransportMgrDelegate MockTransportMgrDelegate(nlTestSuite * inSuite) : mSuite(inSuite) {} ~MockTransportMgrDelegate() override {} - void OnMessageReceived(const PacketHeader & header, const Transport::PeerAddress & source, - System::PacketBufferHandle msgBuf) override + void OnMessageReceived(const Transport::PeerAddress & source, System::PacketBufferHandle msgBuf) override { - NL_TEST_ASSERT(mSuite, header.GetSourceNodeId() == Optional::Value(kSourceNodeId)); - NL_TEST_ASSERT(mSuite, header.GetDestinationNodeId() == Optional::Value(kDestinationNodeId)); - NL_TEST_ASSERT(mSuite, header.GetMessageId() == kMessageId); + PacketHeader packetHeader; + + CHIP_ERROR err = packetHeader.DecodeAndConsume(msgBuf); + NL_TEST_ASSERT(mSuite, err == CHIP_NO_ERROR); + + NL_TEST_ASSERT(mSuite, packetHeader.GetSourceNodeId() == Optional::Value(kSourceNodeId)); + NL_TEST_ASSERT(mSuite, packetHeader.GetDestinationNodeId() == Optional::Value(kDestinationNodeId)); + NL_TEST_ASSERT(mSuite, packetHeader.GetMessageId() == kMessageId); size_t data_len = msgBuf->DataLength(); int compare = memcmp(msgBuf->Start(), PAYLOAD, data_len); @@ -131,8 +135,11 @@ void CheckMessageTest(nlTestSuite * inSuite, void * inContext, const IPAddress & PacketHeader header; header.SetSourceNodeId(kSourceNodeId).SetDestinationNodeId(kDestinationNodeId).SetMessageId(kMessageId); + err = header.EncodeBeforeData(buffer); + NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); + // Should be able to send a message to itself by just calling send. - err = udp.SendMessage(header, Transport::PeerAddress::UDP(addr), std::move(buffer)); + err = udp.SendMessage(Transport::PeerAddress::UDP(addr), std::move(buffer)); if (err == System::MapErrorPOSIX(EADDRNOTAVAIL)) { // TODO(#2698): the underlying system does not support IPV6. This early return diff --git a/src/transport/tests/TestSecureSessionMgr.cpp b/src/transport/tests/TestSecureSessionMgr.cpp index 82cddcd0b18e91..8189a8fb013ca8 100644 --- a/src/transport/tests/TestSecureSessionMgr.cpp +++ b/src/transport/tests/TestSecureSessionMgr.cpp @@ -63,9 +63,9 @@ class LoopbackTransport : public Transport::Base /// Transports are required to have a constructor that takes exactly one argument CHIP_ERROR Init(const char * unused) { return CHIP_NO_ERROR; } - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { - HandleMessageReceived(header, address, std::move(msgBuf)); + HandleMessageReceived(address, std::move(msgBuf)); return CHIP_NO_ERROR; } @@ -78,13 +78,11 @@ class OutgoingTransport : public Transport::Base /// Transports are required to have a constructor that takes exactly one argument CHIP_ERROR Init(const char * unused) { return CHIP_NO_ERROR; } - CHIP_ERROR SendMessage(const PacketHeader & header, const PeerAddress & address, System::PacketBufferHandle msgBuf) override + CHIP_ERROR SendMessage(const PeerAddress & address, System::PacketBufferHandle msgBuf) override { System::PacketBufferHandle recvdMsg = msgBuf.CloneData(); - ReturnErrorOnFailure(header.EncodeBeforeData(msgBuf)); - - HandleMessageReceived(header, address, std::move(recvdMsg)); + HandleMessageReceived(address, std::move(recvdMsg)); return CHIP_NO_ERROR; } From ae60b8dfea715ece42ba1d39300ea92b4a465666 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Tue, 4 May 2021 23:46:21 -0700 Subject: [PATCH 27/31] Move Internal APIs to an Internal Header (#6472) * Move Internal APIs to an Internal Header * Restyled by clang-format Co-authored-by: Restyled.io --- .../Framework/CHIP.xcodeproj/project.pbxproj | 4 ++++ .../CHIP/CHIPManualSetupPayloadParser.mm | 2 +- .../CHIP/CHIPQRCodeSetupPayloadParser.mm | 2 +- src/darwin/Framework/CHIP/CHIPSetupPayload.h | 15 +++--------- src/darwin/Framework/CHIP/CHIPSetupPayload.mm | 4 ++-- .../CHIP/CHIPSetupPayload_Internal.h | 23 +++++++++++++++++++ 6 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 src/darwin/Framework/CHIP/CHIPSetupPayload_Internal.h diff --git a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj index ede303d9f1493e..7c9f2efdd31731 100644 --- a/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/CHIP.xcodeproj/project.pbxproj @@ -45,6 +45,7 @@ 991DC0842475F45400C13860 /* CHIPDeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = 991DC0822475F45400C13860 /* CHIPDeviceController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 991DC0892475F47D00C13860 /* CHIPDeviceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 991DC0872475F47D00C13860 /* CHIPDeviceController.mm */; }; 991DC08B247704DC00C13860 /* CHIPLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 991DC08A247704DC00C13860 /* CHIPLogging.h */; }; + 9956064426420367000C28DE /* CHIPSetupPayload_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9956064326420367000C28DE /* CHIPSetupPayload_Internal.h */; }; B20252972459E34F00F97062 /* CHIP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B202528D2459E34F00F97062 /* CHIP.framework */; }; B289D4212639C0D300D4E314 /* CHIPOnboardingPayloadParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B289D41F2639C0D300D4E314 /* CHIPOnboardingPayloadParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; B289D4222639C0D300D4E314 /* CHIPOnboardingPayloadParser.m in Sources */ = {isa = PBXBuildFile; fileRef = B289D4202639C0D300D4E314 /* CHIPOnboardingPayloadParser.m */; }; @@ -110,6 +111,7 @@ 991DC0822475F45400C13860 /* CHIPDeviceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPDeviceController.h; sourceTree = ""; }; 991DC0872475F47D00C13860 /* CHIPDeviceController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CHIPDeviceController.mm; sourceTree = ""; }; 991DC08A247704DC00C13860 /* CHIPLogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPLogging.h; sourceTree = ""; }; + 9956064326420367000C28DE /* CHIPSetupPayload_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CHIPSetupPayload_Internal.h; sourceTree = ""; }; B202528D2459E34F00F97062 /* CHIP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CHIP.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B20252912459E34F00F97062 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B20252962459E34F00F97062 /* CHIPTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CHIPTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -235,6 +237,7 @@ B2E0D7AC245B0B5C003C5B48 /* CHIPQRCodeSetupPayloadParser.h */, B2E0D7AE245B0B5C003C5B48 /* CHIPQRCodeSetupPayloadParser.mm */, B2E0D7AF245B0B5C003C5B48 /* CHIPSetupPayload.h */, + 9956064326420367000C28DE /* CHIPSetupPayload_Internal.h */, B2E0D7B0245B0B5C003C5B48 /* CHIPSetupPayload.mm */, 991DC0822475F45400C13860 /* CHIPDeviceController.h */, 991DC0872475F47D00C13860 /* CHIPDeviceController.mm */, @@ -277,6 +280,7 @@ B2E0D7B2245B0B5C003C5B48 /* CHIPManualSetupPayloadParser.h in Headers */, B2E0D7B1245B0B5C003C5B48 /* CHIP.h in Headers */, B2E0D7B8245B0B5C003C5B48 /* CHIPSetupPayload.h in Headers */, + 9956064426420367000C28DE /* CHIPSetupPayload_Internal.h in Headers */, 2C8C8FC1253E0C2100797F05 /* CHIPPersistentStorageDelegate.h in Headers */, B2E0D7B5245B0B5C003C5B48 /* CHIPQRCodeSetupPayloadParser.h in Headers */, 1EC4CE6425CC276600D7304F /* CHIPClustersObjc.h in Headers */, diff --git a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm index 7a0977225efa51..d6e2912159d226 100644 --- a/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm +++ b/src/darwin/Framework/CHIP/CHIPManualSetupPayloadParser.mm @@ -18,7 +18,7 @@ #import "CHIPError.h" #import "CHIPLogging.h" -#import "CHIPSetupPayload.h" +#import "CHIPSetupPayload_Internal.h" #import #import diff --git a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm index cff0d4fed3b04a..ac7bbebe3008be 100644 --- a/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm +++ b/src/darwin/Framework/CHIP/CHIPQRCodeSetupPayloadParser.mm @@ -18,7 +18,7 @@ #import "CHIPQRCodeSetupPayloadParser.h" #import "CHIPError.h" #import "CHIPLogging.h" -#import "CHIPSetupPayload.h" +#import "CHIPSetupPayload_Internal.h" #import #import diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload.h b/src/darwin/Framework/CHIP/CHIPSetupPayload.h index cf842567b290d3..000d61a51c8d26 100644 --- a/src/darwin/Framework/CHIP/CHIPSetupPayload.h +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload.h @@ -17,13 +17,9 @@ #import -#ifdef __cplusplus -#import -#endif - NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSUInteger, RendezvousInformationFlags) { +typedef NS_ENUM(NSUInteger, CHIPRendezvousInformationFlags) { kRendezvousInformationNone = 0, // Device does not support any method for rendezvous kRendezvousInformationSoftAP = 1 << 0, // Device supports WiFi softAP kRendezvousInformationBLE = 1 << 1, // Device supports BLE @@ -32,7 +28,7 @@ typedef NS_ENUM(NSUInteger, RendezvousInformationFlags) { kRendezvousInformationAllMask = kRendezvousInformationSoftAP | kRendezvousInformationBLE | kRendezvousInformationOnNetwork, }; -typedef NS_ENUM(NSUInteger, OptionalQRCodeInfoType) { +typedef NS_ENUM(NSUInteger, CHIPOptionalQRCodeInfoType) { kOptionalQRCodeInfoTypeUnknown, kOptionalQRCodeInfoTypeString, kOptionalQRCodeInfoTypeInt32 @@ -51,18 +47,13 @@ typedef NS_ENUM(NSUInteger, OptionalQRCodeInfoType) { @property (nonatomic, strong) NSNumber * vendorID; @property (nonatomic, strong) NSNumber * productID; @property (nonatomic, assign) BOOL requiresCustomFlow; -@property (nonatomic, assign) RendezvousInformationFlags rendezvousInformation; +@property (nonatomic, assign) CHIPRendezvousInformationFlags rendezvousInformation; @property (nonatomic, strong) NSNumber * discriminator; @property (nonatomic, strong) NSNumber * setUpPINCode; @property (nonatomic, strong) NSString * serialNumber; - (NSArray *)getAllOptionalVendorData:(NSError * __autoreleasing *)error; -#ifdef __cplusplus -- (id)initWithSetupPayload:(chip::SetupPayload)setupPayload; -- (RendezvousInformationFlags)valueOf:(chip::RendezvousInformationFlags)value; -#endif - @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm index a7d0e5e6ed9106..bfdddbec36cbe5 100644 --- a/src/darwin/Framework/CHIP/CHIPSetupPayload.mm +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload.mm @@ -15,8 +15,8 @@ * limitations under the License. */ -#import "CHIPSetupPayload.h" #import "CHIPError.h" +#import "CHIPSetupPayload_Internal.h" #import @implementation CHIPOptionalQRCodeInfo @@ -26,7 +26,7 @@ @implementation CHIPSetupPayload { chip::SetupPayload _chipSetupPayload; } -- (RendezvousInformationFlags)valueOf:(chip::RendezvousInformationFlags)value +- (CHIPRendezvousInformationFlags)valueOf:(chip::RendezvousInformationFlags)value { if (value.Has(chip::RendezvousInformationFlag::kBLE)) { return kRendezvousInformationBLE; diff --git a/src/darwin/Framework/CHIP/CHIPSetupPayload_Internal.h b/src/darwin/Framework/CHIP/CHIPSetupPayload_Internal.h new file mode 100644 index 00000000000000..0ffbb8d32fccda --- /dev/null +++ b/src/darwin/Framework/CHIP/CHIPSetupPayload_Internal.h @@ -0,0 +1,23 @@ +// +// CHIPSetupPayload_Internal.h +// CHIP +// +// Copyright © 2021 CHIP. All rights reserved. +// + +#import + +#import "CHIPSetupPayload.h" + +#ifdef __cplusplus +#import +#endif + +@interface CHIPSetupPayload () + +#ifdef __cplusplus +- (id)initWithSetupPayload:(chip::SetupPayload)setupPayload; +- (CHIPRendezvousInformationFlags)valueOf:(chip::RendezvousInformationFlags)value; +#endif + +@end From 3907f38639d73e4c9c201a2ad191385e70b5aa19 Mon Sep 17 00:00:00 2001 From: shana-apple <61782012+shana-apple@users.noreply.github.com> Date: Wed, 5 May 2021 08:50:42 +0200 Subject: [PATCH 28/31] OpCreds Fabric Management functionality (#6233) * OpCreds Fabric Management functionality Adds functionality for reading the fabrics list attribute which gets updated after any updates to the admin pairing table. Adds functionary for removeFabric. Adds a setFabric command as a temporary command before AddOptCert is implemented. This allows the commissioner to set their vendorId for their fabric and returns to them their fabricId Remove the label field of FabricDescriptor struct because a bug in the generated code makes it that the whole list is corrupted if if is present (we need to fix whatever is wrong with OCTET_STRING in lists). This means that the UpdateFabricLabel implementation is not included in this patch. UI updates in the iOS demo app * regen files * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by whitespace * Restyled by clang-format * Fixing unused variable Co-authored-by: Restyled.io Co-authored-by: Justin Wood --- .../gen/IMClusterCommandHandler.cpp | 73 +- .../all-clusters-common/gen/af-structs.h | 1 - .../gen/attribute-size.cpp | 6 +- .../gen/call-command-handler.cpp | 17 +- .../all-clusters-common/gen/callback.h | 13 +- .../gen/client-command-macro.h | 18 +- .../all-clusters-common/gen/command-id.h | 4 +- .../all-clusters-common/gen/endpoint_config.h | 4 +- .../esp32/main/CMakeLists.txt | 2 +- .../all-clusters-app/esp32/main/component.mk | 2 +- .../bridge-app/bridge-common/gen/af-structs.h | 1 - .../bridge-common/gen/client-command-macro.h | 18 +- .../bridge-app/bridge-common/gen/command-id.h | 4 +- .../chip-tool/commands/clusters/Commands.h | 56 +- .../chip-tool/gen/CHIPClientCallbacks.cpp | 13 +- examples/chip-tool/gen/CHIPClientCallbacks.h | 2 +- examples/chip-tool/gen/CHIPClusters.cpp | 37 +- examples/chip-tool/gen/CHIPClusters.h | 4 +- examples/chip-tool/gen/CHIPClustersObjc.h | 2 +- examples/chip-tool/gen/CHIPClustersObjc.mm | 42 +- .../chip-tool/gen/IMClusterCommandHandler.cpp | 4 +- examples/chip-tool/gen/af-structs.h | 1 - .../chip-tool/gen/call-command-handler.cpp | 4 +- examples/chip-tool/gen/callback.h | 4 +- examples/chip-tool/gen/client-command-macro.h | 18 +- examples/chip-tool/gen/command-id.h | 4 +- examples/chip-tool/gen/endpoint_config.h | 4 +- .../lighting-common/gen/af-structs.h | 1 - .../gen/client-command-macro.h | 18 +- .../lighting-common/gen/command-id.h | 4 +- .../lock-app/lock-common/gen/af-structs.h | 1 - .../lock-common/gen/client-command-macro.h | 18 +- .../lock-app/lock-common/gen/command-id.h | 4 +- .../esp32/main/gen/af-structs.h | 1 - .../esp32/main/gen/client-command-macro.h | 18 +- .../esp32/main/gen/command-id.h | 4 +- .../tv-common/gen/IMClusterCommandHandler.cpp | 884 +++++++++--------- examples/tv-app/tv-common/gen/af-structs.h | 1 - .../tv-common/gen/call-command-handler.cpp | 358 ++++--- examples/tv-app/tv-common/gen/callback.h | 107 +-- .../tv-common/gen/client-command-macro.h | 18 +- examples/tv-app/tv-common/gen/command-id.h | 4 +- examples/window-app/common/gen/af-structs.h | 1 - .../common/gen/client-command-macro.h | 18 +- examples/window-app/common/gen/command-id.h | 4 +- src/app/chip-zcl-zpro-codec-api.h | 16 +- src/app/chip_data_model.gni | 1 + .../operational-credentials-server.cpp | 275 ++++++ .../operational-credentials.cpp | 65 -- src/app/encoder.cpp | 26 +- src/app/server/Server.cpp | 39 +- src/app/util/util.cpp | 6 + src/app/zap-templates/zcl/custom-types.xml | 2 +- .../zcl/operational-credentials-cluster.xml | 20 +- src/app/zap_cluster_list.py | 4 +- src/controller/CHIPDeviceController.cpp | 2 +- .../python/chip/clusters/CHIPClusters.cpp | 16 +- .../python/chip/clusters/CHIPClusters.py | 19 +- .../python/chip/internal/CommissionerImpl.cpp | 5 + .../python/gen/CHIPClientCallbacks.cpp | 13 +- .../python/gen/CHIPClientCallbacks.h | 2 +- src/controller/python/gen/CHIPClusters.cpp | 37 +- src/controller/python/gen/CHIPClusters.h | 4 +- src/controller/python/gen/CHIPClustersObjc.h | 2 +- src/controller/python/gen/CHIPClustersObjc.mm | 42 +- .../python/gen/IMClusterCommandHandler.cpp | 4 +- src/controller/python/gen/af-structs.h | 1 - .../python/gen/call-command-handler.cpp | 4 +- src/controller/python/gen/callback.h | 4 +- .../python/gen/client-command-macro.h | 18 +- src/controller/python/gen/command-id.h | 4 +- src/controller/python/gen/endpoint_config.h | 4 +- .../Framework Helpers/DefaultsUtils.h | 3 + .../Framework Helpers/DefaultsUtils.m | 8 +- .../Fabric/FabricUIViewController.m | 57 +- .../QRCode/QRCodeViewController.m | 34 +- .../CHIP/gen/CHIPClientCallbacks.cpp | 13 +- .../Framework/CHIP/gen/CHIPClientCallbacks.h | 2 +- .../Framework/CHIP/gen/CHIPClusters.cpp | 37 +- src/darwin/Framework/CHIP/gen/CHIPClusters.h | 4 +- .../Framework/CHIP/gen/CHIPClustersObjc.h | 2 +- .../Framework/CHIP/gen/CHIPClustersObjc.mm | 42 +- .../CHIP/gen/IMClusterCommandHandler.cpp | 4 +- src/darwin/Framework/CHIP/gen/af-structs.h | 1 - .../CHIP/gen/call-command-handler.cpp | 4 +- src/darwin/Framework/CHIP/gen/callback.h | 4 +- .../Framework/CHIP/gen/client-command-macro.h | 18 +- src/darwin/Framework/CHIP/gen/command-id.h | 4 +- .../Framework/CHIP/gen/endpoint_config.h | 4 +- src/lib/core/CHIPPersistentStorageDelegate.h | 8 + src/lib/core/PeerId.h | 1 + src/messaging/ExchangeContext.h | 2 +- src/messaging/ExchangeMgr.cpp | 3 + src/transport/AdminPairingTable.cpp | 161 +++- src/transport/AdminPairingTable.h | 76 +- src/transport/SecureSessionMgr.cpp | 47 +- 96 files changed, 1751 insertions(+), 1245 deletions(-) create mode 100644 src/app/clusters/operational-credentials-server/operational-credentials-server.cpp delete mode 100644 src/app/clusters/operational-credentials/operational-credentials.cpp diff --git a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp index add9c631d73289..c4b9adcd04513b 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp @@ -7023,12 +7023,6 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En { switch (aCommandId) { - case ZCL_GET_FABRIC_ID_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOperationalCredentialsClusterGetFabricIdCallback(apCommandObj); - break; - } case ZCL_REMOVE_FABRIC_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. @@ -7128,6 +7122,73 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } + case ZCL_SET_FABRIC_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint16_t VendorId; + bool VendorIdExists = false; + uint32_t validArgumentCount = 0; + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (VendorIdExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(VendorId); + if (CHIP_NO_ERROR == TLVUnpackError) + { + VendorIdExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } + + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfOperationalCredentialsClusterSetFabricCallback(apCommandObj, VendorId); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 1, validArgumentCount, TLVError, TLVUnpackError); + } + break; + } case ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. diff --git a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/af-structs.h +++ b/examples/all-clusters-app/all-clusters-common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp index a5e65dbe0558d9..d5a4131e8df5d5 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/attribute-size.cpp @@ -197,7 +197,7 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo { case 0x0001: // fabrics list { - entryLength = 50; + entryLength = 18; if (((index - 1) * entryLength) > (am->size - entryLength)) { ChipLogError(Zcl, "Index %l is invalid.", index); @@ -210,8 +210,6 @@ uint16_t emberAfCopyList(ClusterId clusterId, EmberAfAttributeMetadata * am, boo &entryOffset, sizeof(entry->FabricId)); // FABRIC_ID copyListMember(write ? dest : (uint8_t *) &entry->VendorId, write ? (uint8_t *) &entry->VendorId : src, write, &entryOffset, sizeof(entry->VendorId)); // INT16U - copyListMember(write ? dest : (uint8_t *) &entry->Label, write ? (uint8_t *) &entry->Label : src, write, &entryOffset, - 32); // OCTET_STRING copyListMember(write ? dest : (uint8_t *) &entry->NodeId, write ? (uint8_t *) &entry->NodeId : src, write, &entryOffset, sizeof(entry->NodeId)); // NODE_ID break; @@ -297,7 +295,7 @@ uint16_t emberAfAttributeValueListSize(ClusterId clusterId, AttributeId attribut { case 0x0001: // fabrics list // Struct _FabricDescriptor - entryLength = 50; + entryLength = 18; break; } break; diff --git a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp index 73343ad86fb48c..5aeb7e7274b8fe 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp +++ b/examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp @@ -2310,10 +2310,6 @@ EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClus { switch (cmd->commandId) { - case ZCL_GET_FABRIC_ID_COMMAND_ID: { - wasHandled = emberAfOperationalCredentialsClusterGetFabricIdCallback(nullptr); - break; - } case ZCL_REMOVE_FABRIC_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; chip::FabricId FabricId; @@ -2341,6 +2337,19 @@ EmberAfStatus emberAfOperationalCredentialsClusterServerCommandParse(EmberAfClus wasHandled = emberAfOperationalCredentialsClusterRemoveFabricCallback(nullptr, FabricId, NodeId, VendorId); break; } + case ZCL_SET_FABRIC_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint16_t VendorId; + + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + VendorId = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfOperationalCredentialsClusterSetFabricCallback(nullptr, VendorId); + break; + } case ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; uint8_t * Label; diff --git a/examples/all-clusters-app/all-clusters-common/gen/callback.h b/examples/all-clusters-app/all-clusters-common/gen/callback.h index 02cc3145eedc3f..f9b47114ea5a5a 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/callback.h +++ b/examples/all-clusters-app/all-clusters-common/gen/callback.h @@ -2718,12 +2718,6 @@ bool emberAfOnOffClusterOnCallback(chip::app::Command * commandObj); bool emberAfOnOffClusterToggleCallback(chip::app::Command * commandObj); -/** - * @brief Operational Credentials Cluster GetFabricId Command callback - */ - -bool emberAfOperationalCredentialsClusterGetFabricIdCallback(chip::app::Command * commandObj); - /** * @brief Operational Credentials Cluster RemoveFabric Command callback * @param fabricId @@ -2734,6 +2728,13 @@ bool emberAfOperationalCredentialsClusterGetFabricIdCallback(chip::app::Command bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::app::Command * commandObj, chip::FabricId FabricId, chip::NodeId NodeId, uint16_t VendorId); +/** + * @brief Operational Credentials Cluster SetFabric Command callback + * @param vendorId + */ + +bool emberAfOperationalCredentialsClusterSetFabricCallback(chip::app::Command * commandObj, uint16_t VendorId); + /** * @brief Operational Credentials Cluster UpdateFabricLabel Command callback * @param label diff --git a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h +++ b/examples/all-clusters-app/all-clusters-common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/all-clusters-app/all-clusters-common/gen/command-id.h b/examples/all-clusters-app/all-clusters-common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/command-id.h +++ b/examples/all-clusters-app/all-clusters-common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h index 782523410a36f1..8b9ac541cb8b32 100644 --- a/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h +++ b/examples/all-clusters-app/all-clusters-common/gen/endpoint_config.h @@ -1302,8 +1302,8 @@ { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ \ /* Endpoint: 0, Cluster: Operational Credentials (server) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetFabricId */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetFabricIdResponse */ \ + { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetFabric */ \ + { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SetFabricResponse */ \ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ \ diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 221d2ddc6221e0..50afd3deeaa38d 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -38,7 +38,7 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/content-launch-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-playback-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-server" diff --git a/examples/all-clusters-app/esp32/main/component.mk b/examples/all-clusters-app/esp32/main/component.mk index 8e1715785e8bb8..317409aa36bc52 100644 --- a/examples/all-clusters-app/esp32/main/component.mk +++ b/examples/all-clusters-app/esp32/main/component.mk @@ -43,7 +43,7 @@ COMPONENT_SRCDIRS := ../third_party/connectedhomeip/src/app/clusters/low-power-server \ ../third_party/connectedhomeip/src/app/clusters/keypad-input-server \ ../third_party/connectedhomeip/src/app/clusters/media-playback-server \ - ../third_party/connectedhomeip/src/app/clusters/operational-credentials \ + ../third_party/connectedhomeip/src/app/clusters/operational-credentials-server \ ../third_party/connectedhomeip/src/app/clusters/media-input-server \ ../third_party/connectedhomeip/src/app/clusters/network-commissioning \ ../third_party/connectedhomeip/src/app/clusters/ota-server \ diff --git a/examples/bridge-app/bridge-common/gen/af-structs.h b/examples/bridge-app/bridge-common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/bridge-app/bridge-common/gen/af-structs.h +++ b/examples/bridge-app/bridge-common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/bridge-app/bridge-common/gen/client-command-macro.h b/examples/bridge-app/bridge-common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/bridge-app/bridge-common/gen/client-command-macro.h +++ b/examples/bridge-app/bridge-common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/bridge-app/bridge-common/gen/command-id.h b/examples/bridge-app/bridge-common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/bridge-app/bridge-common/gen/command-id.h +++ b/examples/bridge-app/bridge-common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/chip-tool/commands/clusters/Commands.h b/examples/chip-tool/commands/clusters/Commands.h index 7686346bdd8cac..4491175bbc6fe1 100644 --- a/examples/chip-tool/commands/clusters/Commands.h +++ b/examples/chip-tool/commands/clusters/Commands.h @@ -575,9 +575,9 @@ static void OnNetworkCommissioningClusterUpdateWiFiNetworkResponse(void * contex command->SetCommandExitStatus(true); } -static void OnOperationalCredentialsClusterGetFabricIdResponse(void * context, chip::FabricId FabricId) +static void OnOperationalCredentialsClusterSetFabricResponse(void * context, chip::FabricId FabricId) { - ChipLogProgress(chipTool, "OperationalCredentialsClusterGetFabricIdResponse"); + ChipLogProgress(chipTool, "OperationalCredentialsClusterSetFabricResponse"); ModelCommand * command = reinterpret_cast(context); command->SetCommandExitStatus(true); @@ -757,7 +757,6 @@ static void OnOperationalCredentialsFabricsListListAttributeResponse(void * cont ChipLogProgress(chipTool, "FabricDescriptor[%lu]:", i); ChipLogProgress(chipTool, " FabricId: %" PRIu64 "", entries[i].FabricId); ChipLogProgress(chipTool, " VendorId: %" PRIu16 "", entries[i].VendorId); - ChipLogProgress(chipTool, " Label: %s", entries[i].Label); ChipLogProgress(chipTool, " NodeId: %" PRIu64 "", entries[i].NodeId); } @@ -10499,8 +10498,8 @@ class ReadOnOffClusterRevision : public ModelCommand | Cluster OperationalCredentials | 0x003E | |------------------------------------------------------------------------------| | Commands: | | -| * GetFabricId | 0x00 | | * RemoveFabric | 0x0A | +| * SetFabric | 0x00 | | * UpdateFabricLabel | 0x09 | |------------------------------------------------------------------------------| | Attributes: | | @@ -10509,13 +10508,19 @@ class ReadOnOffClusterRevision : public ModelCommand \*----------------------------------------------------------------------------*/ /* - * Command GetFabricId + * Command RemoveFabric */ -class OperationalCredentialsGetFabricId : public ModelCommand +class OperationalCredentialsRemoveFabric : public ModelCommand { public: - OperationalCredentialsGetFabricId() : ModelCommand("get-fabric-id") { ModelCommand::AddArguments(); } - ~OperationalCredentialsGetFabricId() + OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric") + { + AddArgument("fabricId", 0, UINT64_MAX, &mFabricId); + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); + ModelCommand::AddArguments(); + } + ~OperationalCredentialsRemoveFabric() { delete onSuccessCallback; delete onFailureCallback; @@ -10523,35 +10528,35 @@ class OperationalCredentialsGetFabricId : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0A) on endpoint %" PRIu16, endpointId); chip::Controller::OperationalCredentialsCluster cluster; cluster.Associate(device, endpointId); - return cluster.GetFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel()); + return cluster.RemoveFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mFabricId, mNodeId, mVendorId); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback( - OnOperationalCredentialsClusterGetFabricIdResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback(OnDefaultSuccessResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); + chip::FabricId mFabricId; + chip::NodeId mNodeId; + uint16_t mVendorId; }; /* - * Command RemoveFabric + * Command SetFabric */ -class OperationalCredentialsRemoveFabric : public ModelCommand +class OperationalCredentialsSetFabric : public ModelCommand { public: - OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric") + OperationalCredentialsSetFabric() : ModelCommand("set-fabric") { - AddArgument("fabricId", 0, UINT64_MAX, &mFabricId); - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("vendorId", 0, UINT16_MAX, &mVendorId); ModelCommand::AddArguments(); } - ~OperationalCredentialsRemoveFabric() + ~OperationalCredentialsSetFabric() { delete onSuccessCallback; delete onFailureCallback; @@ -10559,20 +10564,19 @@ class OperationalCredentialsRemoveFabric : public ModelCommand CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override { - ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0A) on endpoint %" PRIu16, endpointId); + ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId); chip::Controller::OperationalCredentialsCluster cluster; cluster.Associate(device, endpointId); - return cluster.RemoveFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mFabricId, mNodeId, mVendorId); + return cluster.SetFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mVendorId); } private: - chip::Callback::Callback * onSuccessCallback = - new chip::Callback::Callback(OnDefaultSuccessResponse, this); + chip::Callback::Callback * onSuccessCallback = + new chip::Callback::Callback( + OnOperationalCredentialsClusterSetFabricResponse, this); chip::Callback::Callback * onFailureCallback = new chip::Callback::Callback(OnDefaultFailureResponse, this); - chip::FabricId mFabricId; - chip::NodeId mNodeId; uint16_t mVendorId; }; @@ -14919,7 +14923,7 @@ void registerClusterOperationalCredentials(Commands & commands) const char * clusterName = "OperationalCredentials"; commands_list clusterCommands = { - make_unique(), make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), make_unique(), }; diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.cpp b/examples/chip-tool/gen/CHIPClientCallbacks.cpp index 84abd16b2426bb..29db4ce13f6c36 100644 --- a/examples/chip-tool/gen/CHIPClientCallbacks.cpp +++ b/examples/chip-tool/gen/CHIPClientCallbacks.cpp @@ -490,9 +490,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = chip::ByteSpan(message, 32); - message += 32; - CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); message += 8; CHECK_MESSAGE_LENGTH(8); @@ -1872,15 +1869,15 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a return true; } -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) { - ChipLogProgress(Zcl, "GetFabricIdResponse:"); + ChipLogProgress(Zcl, "SetFabricResponse:"); ChipLogProgress(Zcl, " FabricId: %" PRIu64 "", FabricId); - GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterGetFabricIdResponseCallback"); + GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterSetFabricResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, FabricId); return true; } diff --git a/examples/chip-tool/gen/CHIPClientCallbacks.h b/examples/chip-tool/gen/CHIPClientCallbacks.h index 79336b599e30af..9647b42e1c377a 100644 --- a/examples/chip-tool/gen/CHIPClientCallbacks.h +++ b/examples/chip-tool/gen/CHIPClientCallbacks.h @@ -110,7 +110,7 @@ typedef void (*NetworkCommissioningClusterUpdateThreadNetworkResponseCallback)(v uint8_t * debugText); typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode, uint8_t * debugText); -typedef void (*OperationalCredentialsClusterGetFabricIdResponseCallback)(void * context, chip::FabricId FabricId); +typedef void (*OperationalCredentialsClusterSetFabricResponseCallback)(void * context, chip::FabricId FabricId); typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId); typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount, diff --git a/examples/chip-tool/gen/CHIPClusters.cpp b/examples/chip-tool/gen/CHIPClusters.cpp index 86146e3b8c8e58..9b3266936b1045 100644 --- a/examples/chip-tool/gen/CHIPClusters.cpp +++ b/examples/chip-tool/gen/CHIPClusters.cpp @@ -4511,42 +4511,50 @@ CHIP_ERROR OnOffCluster::ReadAttributeClusterRevision(Callback::Cancelable * onS } // OperationalCredentials Cluster Commands -CHIP_ERROR OperationalCredentialsCluster::GetFabricId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, + chip::NodeId nodeId, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetFabricIdCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); - // Command takes no arguments. + TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); + uint8_t argSeqNumber = 0; + // fabricId: fabricId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); + // nodeId: nodeId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); + // vendorId: int16u + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); ReturnErrorOnFailure(ZCLcommand->FinishCommand()); return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterGetFabricIdCommand(seqNum, mEndpoint); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } -CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, - chip::NodeId nodeId, uint16_t vendorId) +CHIP_ERROR OperationalCredentialsCluster::SetFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); @@ -4554,10 +4562,6 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); uint8_t argSeqNumber = 0; - // fabricId: fabricId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); - // nodeId: nodeId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); // vendorId: int16u ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); @@ -4565,9 +4569,8 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = - encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterSetFabricCommand(seqNum, mEndpoint, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } diff --git a/examples/chip-tool/gen/CHIPClusters.h b/examples/chip-tool/gen/CHIPClusters.h index 33ab97783dcf0c..0b6700348d3678 100644 --- a/examples/chip-tool/gen/CHIPClusters.h +++ b/examples/chip-tool/gen/CHIPClusters.h @@ -817,9 +817,9 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase ~OperationalCredentialsCluster() {} // Cluster Commands - CHIP_ERROR GetFabricId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId); + CHIP_ERROR SetFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t vendorId); CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan label); @@ -829,8 +829,8 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: - static constexpr CommandId kGetFabricIdCommandId = 0x00; static constexpr CommandId kRemoveFabricCommandId = 0x0A; + static constexpr CommandId kSetFabricCommandId = 0x00; static constexpr CommandId kUpdateFabricLabelCommandId = 0x09; }; diff --git a/examples/chip-tool/gen/CHIPClustersObjc.h b/examples/chip-tool/gen/CHIPClustersObjc.h index c44ab70b07d659..50045a1bd724f4 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.h +++ b/examples/chip-tool/gen/CHIPClustersObjc.h @@ -686,11 +686,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId nodeId:(uint64_t)nodeId vendorId:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; - (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; diff --git a/examples/chip-tool/gen/CHIPClustersObjc.mm b/examples/chip-tool/gen/CHIPClustersObjc.mm index 30706c27d00202..8b236ee878ae9f 100644 --- a/examples/chip-tool/gen/CHIPClustersObjc.mm +++ b/examples/chip-tool/gen/CHIPClustersObjc.mm @@ -2183,22 +2183,22 @@ static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText) dispatch_queue_t mQueue; }; -class CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge - : public Callback::Callback { +class CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge + : public Callback::Callback { public: - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge() {}; + ~CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge() {}; static void CallbackFn(void * context, chip::FabricId FabricId) { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2829,11 +2829,9 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri if (callback && callback->mQueue) { id values[count]; for (uint16_t i = 0; i < count; i++) { - values[i] = - [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], - @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", - [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], + @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -10182,10 +10180,12 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)responseHandler +- (void)removeFabric:(uint64_t)fabricId + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -10200,7 +10200,7 @@ - (void)getFabricId:(ResponseHandler)responseHandler __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.GetFabricId(onSuccess->Cancel(), onFailure->Cancel()); + err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); }); if (err != CHIP_NO_ERROR) { @@ -10209,12 +10209,10 @@ - (void)getFabricId:(ResponseHandler)responseHandler responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - responseHandler:(ResponseHandler)responseHandler +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * onSuccess + = new CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -10229,7 +10227,7 @@ - (void)removeFabric:(uint64_t)fabricId __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); + err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(), vendorId); }); if (err != CHIP_NO_ERROR) { diff --git a/examples/chip-tool/gen/IMClusterCommandHandler.cpp b/examples/chip-tool/gen/IMClusterCommandHandler.cpp index d520e72d3b2a88..e09685cd008f94 100644 --- a/examples/chip-tool/gen/IMClusterCommandHandler.cpp +++ b/examples/chip-tool/gen/IMClusterCommandHandler.cpp @@ -4772,7 +4772,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En { switch (aCommandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. @@ -4827,7 +4827,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(apCommandObj, FabricId); + emberAfOperationalCredentialsClusterSetFabricResponseCallback(apCommandObj, FabricId); } else { diff --git a/examples/chip-tool/gen/af-structs.h b/examples/chip-tool/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/chip-tool/gen/af-structs.h +++ b/examples/chip-tool/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/chip-tool/gen/call-command-handler.cpp b/examples/chip-tool/gen/call-command-handler.cpp index ab8338acef7b77..1cb77bf19398ce 100644 --- a/examples/chip-tool/gen/call-command-handler.cpp +++ b/examples/chip-tool/gen/call-command-handler.cpp @@ -1447,7 +1447,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus { switch (cmd->commandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; chip::FabricId FabricId; @@ -1457,7 +1457,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus } FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(nullptr, FabricId); + wasHandled = emberAfOperationalCredentialsClusterSetFabricResponseCallback(nullptr, FabricId); break; } default: { diff --git a/examples/chip-tool/gen/callback.h b/examples/chip-tool/gen/callback.h index c070e6f9d17d03..dee7c87ac78607 100644 --- a/examples/chip-tool/gen/callback.h +++ b/examples/chip-tool/gen/callback.h @@ -3009,11 +3009,11 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a uint8_t * debugText); /** - * @brief Operational Credentials Cluster GetFabricIdResponse Command callback + * @brief Operational Credentials Cluster SetFabricResponse Command callback * @param fabricId */ -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); /** * @brief Scenes Cluster AddSceneResponse Command callback diff --git a/examples/chip-tool/gen/client-command-macro.h b/examples/chip-tool/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/chip-tool/gen/client-command-macro.h +++ b/examples/chip-tool/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/chip-tool/gen/command-id.h b/examples/chip-tool/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/chip-tool/gen/command-id.h +++ b/examples/chip-tool/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/chip-tool/gen/endpoint_config.h b/examples/chip-tool/gen/endpoint_config.h index 6599ceb17d6cc9..9edc8106c64547 100644 --- a/examples/chip-tool/gen/endpoint_config.h +++ b/examples/chip-tool/gen/endpoint_config.h @@ -406,8 +406,8 @@ { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ \ /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetFabricId */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetFabricIdResponse */ \ + { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetFabric */ \ + { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SetFabricResponse */ \ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ \ diff --git a/examples/lighting-app/lighting-common/gen/af-structs.h b/examples/lighting-app/lighting-common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/lighting-app/lighting-common/gen/af-structs.h +++ b/examples/lighting-app/lighting-common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/lighting-app/lighting-common/gen/client-command-macro.h b/examples/lighting-app/lighting-common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/lighting-app/lighting-common/gen/client-command-macro.h +++ b/examples/lighting-app/lighting-common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/lighting-app/lighting-common/gen/command-id.h b/examples/lighting-app/lighting-common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/lighting-app/lighting-common/gen/command-id.h +++ b/examples/lighting-app/lighting-common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/lock-app/lock-common/gen/af-structs.h b/examples/lock-app/lock-common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/lock-app/lock-common/gen/af-structs.h +++ b/examples/lock-app/lock-common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/lock-app/lock-common/gen/client-command-macro.h b/examples/lock-app/lock-common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/lock-app/lock-common/gen/client-command-macro.h +++ b/examples/lock-app/lock-common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/lock-app/lock-common/gen/command-id.h b/examples/lock-app/lock-common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/lock-app/lock-common/gen/command-id.h +++ b/examples/lock-app/lock-common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/af-structs.h +++ b/examples/temperature-measurement-app/esp32/main/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h +++ b/examples/temperature-measurement-app/esp32/main/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/temperature-measurement-app/esp32/main/gen/command-id.h b/examples/temperature-measurement-app/esp32/main/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/temperature-measurement-app/esp32/main/gen/command-id.h +++ b/examples/temperature-measurement-app/esp32/main/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index 5534388176fb7f..91e32e45e3e18c 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -213,111 +213,6 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace AccountLogin -namespace ApplicationLauncher { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_LAUNCH_APP_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - const uint8_t * data; - bool dataExists = false; - /* TYPE WARNING: array array defaults to */ uint8_t * application; - bool applicationExists = false; - uint32_t validArgumentCount = 0; - - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (dataExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(data); - if (CHIP_NO_ERROR == TLVUnpackError) - { - dataExists = true; - validArgumentCount++; - } - break; - case 1: - if (applicationExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // Just for compatibility, we will add array type support in IM later. - TLVUnpackError = aDataTlv.GetDataPtr(const_cast(application)); - if (CHIP_NO_ERROR == TLVUnpackError) - { - applicationExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } - - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } - - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfApplicationLauncherClusterLaunchAppCallback(apCommandObj, const_cast(data), application); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_APPLICATION_LAUNCHER_CLUSTER_ID); - break; - } - } - } -} - -} // namespace ApplicationLauncher - namespace AudioOutput { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) @@ -921,21 +816,27 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace GeneralCommissioning -namespace KeypadInput { +namespace LevelControl { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_SEND_KEY_COMMAND_ID: { + case ZCL_MOVE_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t keyCode; - bool keyCodeExists = false; + uint8_t moveMode; + bool moveModeExists = false; + uint8_t rate; + bool rateExists = false; + uint8_t optionMask; + bool optionMaskExists = false; + uint8_t optionOverride; + bool optionOverrideExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -943,16 +844,58 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (keyCodeExists) + if (moveModeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(moveMode); + if (CHIP_NO_ERROR == TLVUnpackError) + { + moveModeExists = true; + validArgumentCount++; + } + break; + case 1: + if (rateExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(rate); + if (CHIP_NO_ERROR == TLVUnpackError) + { + rateExists = true; + validArgumentCount++; + } + break; + case 2: + if (optionMaskExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionMask); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionMaskExists = true; + validArgumentCount++; + } + break; + case 3: + if (optionOverrideExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(keyCode); + TLVUnpackError = aDataTlv.Get(optionOverride); if (CHIP_NO_ERROR == TLVUnpackError) { - keyCodeExists = true; + optionOverrideExists = true; validArgumentCount++; } break; @@ -980,10 +923,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfKeypadInputClusterSendKeyCallback(apCommandObj, keyCode); + emberAfLevelControlClusterMoveCallback(apCommandObj, moveMode, rate, optionMask, optionOverride); } else { @@ -991,72 +934,24 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 4, validArgumentCount, TLVError, TLVUnpackError); } break; } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_KEYPAD_INPUT_CLUSTER_ID); - break; - } - } - } -} - -} // namespace KeypadInput - -namespace LowPower { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_SLEEP_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLowPowerClusterSleepCallback(apCommandObj); - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LOW_POWER_CLUSTER_ID); - break; - } - } - } -} - -} // namespace LowPower - -namespace MediaInput { - -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterHideInputStatusCallback(apCommandObj); - break; - } - case ZCL_RENAME_INPUT_COMMAND_ID: { + case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t index; - bool indexExists = false; - const uint8_t * name; - bool nameExists = false; + uint8_t level; + bool levelExists = false; + uint16_t transitionTime; + bool transitionTimeExists = false; + uint8_t optionMask; + bool optionMaskExists = false; + uint8_t optionOverride; + bool optionOverrideExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1064,31 +959,58 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (indexExists) + if (levelExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(index); + TLVUnpackError = aDataTlv.Get(level); if (CHIP_NO_ERROR == TLVUnpackError) { - indexExists = true; + levelExists = true; validArgumentCount++; } break; case 1: - if (nameExists) + if (transitionTimeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(name); + TLVUnpackError = aDataTlv.Get(transitionTime); if (CHIP_NO_ERROR == TLVUnpackError) { - nameExists = true; + transitionTimeExists = true; + validArgumentCount++; + } + break; + case 2: + if (optionMaskExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionMask); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionMaskExists = true; + validArgumentCount++; + } + break; + case 3: + if (optionOverrideExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionOverride); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionOverrideExists = true; validArgumentCount++; } break; @@ -1116,10 +1038,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterRenameInputCallback(apCommandObj, index, const_cast(name)); + emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, level, transitionTime, optionMask, optionOverride); } else { @@ -1127,18 +1049,20 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); + 4, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_SELECT_INPUT_COMMAND_ID: { + case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t index; - bool indexExists = false; + uint8_t level; + bool levelExists = false; + uint16_t transitionTime; + bool transitionTimeExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1146,16 +1070,30 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (indexExists) + if (levelExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(index); + TLVUnpackError = aDataTlv.Get(level); if (CHIP_NO_ERROR == TLVUnpackError) { - indexExists = true; + levelExists = true; + validArgumentCount++; + } + break; + case 1: + if (transitionTimeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(transitionTime); + if (CHIP_NO_ERROR == TLVUnpackError) + { + transitionTimeExists = true; validArgumentCount++; } break; @@ -1183,10 +1121,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterSelectInputCallback(apCommandObj, index); + emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, level, transitionTime); } else { @@ -1194,97 +1132,182 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaInputClusterShowInputStatusCallback(apCommandObj); - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_INPUT_CLUSTER_ID); - break; - } - } - } -} - -} // namespace MediaInput - -namespace MediaPlayback { + case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint8_t moveMode; + bool moveModeExists = false; + uint8_t rate; + bool rateExists = false; + uint32_t validArgumentCount = 0; -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); - break; - } - case ZCL_MEDIA_NEXT_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PAUSE_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PLAY_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); - break; - } - case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (moveModeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(moveMode); + if (CHIP_NO_ERROR == TLVUnpackError) + { + moveModeExists = true; + validArgumentCount++; + } + break; + case 1: + if (rateExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(rate); + if (CHIP_NO_ERROR == TLVUnpackError) + { + rateExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); - break; - } - case ZCL_MEDIA_REWIND_COMMAND_ID: { + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, moveMode, rate); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 2, validArgumentCount, TLVError, TLVUnpackError); + } break; } - case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { + case ZCL_STEP_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; + uint8_t stepMode; + bool stepModeExists = false; + uint8_t stepSize; + bool stepSizeExists = false; + uint16_t transitionTime; + bool transitionTimeExists = false; + uint8_t optionMask; + bool optionMaskExists = false; + uint8_t optionOverride; + bool optionOverrideExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (deltaPositionMillisecondsExists) + if (stepModeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); + TLVUnpackError = aDataTlv.Get(stepMode); if (CHIP_NO_ERROR == TLVUnpackError) { - deltaPositionMillisecondsExists = true; + stepModeExists = true; + validArgumentCount++; + } + break; + case 1: + if (stepSizeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(stepSize); + if (CHIP_NO_ERROR == TLVUnpackError) + { + stepSizeExists = true; + validArgumentCount++; + } + break; + case 2: + if (transitionTimeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(transitionTime); + if (CHIP_NO_ERROR == TLVUnpackError) + { + transitionTimeExists = true; + validArgumentCount++; + } + break; + case 3: + if (optionMaskExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionMask); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionMaskExists = true; + validArgumentCount++; + } + break; + case 4: + if (optionOverrideExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionOverride); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionOverrideExists = true; validArgumentCount++; } break; @@ -1312,10 +1335,11 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); + emberAfLevelControlClusterStepCallback(apCommandObj, stepMode, stepSize, transitionTime, optionMask, + optionOverride); } else { @@ -1323,35 +1347,67 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 5, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { + case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; + uint8_t stepMode; + bool stepModeExists = false; + uint8_t stepSize; + bool stepSizeExists = false; + uint16_t transitionTime; + bool transitionTimeExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (deltaPositionMillisecondsExists) + if (stepModeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); + TLVUnpackError = aDataTlv.Get(stepMode); if (CHIP_NO_ERROR == TLVUnpackError) { - deltaPositionMillisecondsExists = true; + stepModeExists = true; + validArgumentCount++; + } + break; + case 1: + if (stepSizeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(stepSize); + if (CHIP_NO_ERROR == TLVUnpackError) + { + stepSizeExists = true; + validArgumentCount++; + } + break; + case 2: + if (transitionTimeExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(transitionTime); + if (CHIP_NO_ERROR == TLVUnpackError) + { + transitionTimeExists = true; validArgumentCount++; } break; @@ -1379,10 +1435,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); + emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, stepMode, stepSize, transitionTime); } else { @@ -1390,18 +1446,20 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 3, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { + case ZCL_STOP_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t position; - bool positionExists = false; + uint8_t optionMask; + bool optionMaskExists = false; + uint8_t optionOverride; + bool optionOverrideExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1409,16 +1467,30 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (positionExists) + if (optionMaskExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(position); + TLVUnpackError = aDataTlv.Get(optionMask); if (CHIP_NO_ERROR == TLVUnpackError) { - positionExists = true; + optionMaskExists = true; + validArgumentCount++; + } + break; + case 1: + if (optionOverrideExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(optionOverride); + if (CHIP_NO_ERROR == TLVUnpackError) + { + optionOverrideExists = true; validArgumentCount++; } break; @@ -1446,10 +1518,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); + emberAfLevelControlClusterStopCallback(apCommandObj, optionMask, optionOverride); } else { @@ -1457,106 +1529,97 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MEDIA_START_OVER_COMMAND_ID: { + case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); - break; - } - case ZCL_MEDIA_STOP_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); + emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj); break; } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LEVEL_CONTROL_CLUSTER_ID); break; } } } } -} // namespace MediaPlayback +} // namespace LevelControl -namespace OnOff { +namespace MediaPlayback { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_OFF_COMMAND_ID: { + case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterOffCallback(apCommandObj); + emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); break; } - case ZCL_ON_COMMAND_ID: { + case ZCL_MEDIA_NEXT_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterOnCallback(apCommandObj); + emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); break; } - case ZCL_TOGGLE_COMMAND_ID: { + case ZCL_MEDIA_PAUSE_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterToggleCallback(apCommandObj); + emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); break; } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_ON_OFF_CLUSTER_ID); + case ZCL_MEDIA_PLAY_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); break; } - } - } -} - -} // namespace OnOff + case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { -namespace TvChannel { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); + break; + } + case ZCL_MEDIA_REWIND_COMMAND_ID: { -void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) -{ - { - switch (aCommandId) - { - case ZCL_CHANGE_CHANNEL_COMMAND_ID: { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); + break; + } + case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - const uint8_t * match; - bool matchExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (matchExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(match); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - matchExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -1587,7 +1650,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfTvChannelClusterChangeChannelCallback(apCommandObj, const_cast(match)); + emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -1599,47 +1662,31 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_CHANGE_CHANNEL_BY_NUMBER_COMMAND_ID: { + case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t majorNumber; - bool majorNumberExists = false; - uint16_t minorNumber; - bool minorNumberExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (majorNumberExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(majorNumber); - if (CHIP_NO_ERROR == TLVUnpackError) - { - majorNumberExists = true; - validArgumentCount++; - } - break; - case 1: - if (minorNumberExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(minorNumber); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - minorNumberExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -1667,10 +1714,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfTvChannelClusterChangeChannelByNumberCallback(apCommandObj, majorNumber, minorNumber); + emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -1678,18 +1725,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_SKIP_CHANNEL_COMMAND_ID: { + case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint16_t Count; - bool CountExists = false; + uint64_t position; + bool positionExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1697,16 +1744,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (CountExists) + if (positionExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(Count); + TLVUnpackError = aDataTlv.Get(position); if (CHIP_NO_ERROR == TLVUnpackError) { - CountExists = true; + positionExists = true; validArgumentCount++; } break; @@ -1737,7 +1784,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfTvChannelClusterSkipChannelCallback(apCommandObj, Count); + emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); } else { @@ -1749,122 +1796,68 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } + case ZCL_MEDIA_START_OVER_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); + break; + } + case ZCL_MEDIA_STOP_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); + break; + } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TV_CHANNEL_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); break; } } } } -} // namespace TvChannel +} // namespace MediaPlayback -namespace TargetNavigator { +namespace OnOff { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_NAVIGATE_TARGET_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t target; - bool targetExists = false; - const uint8_t * data; - bool dataExists = false; - uint32_t validArgumentCount = 0; + case ZCL_OFF_COMMAND_ID: { - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (targetExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(target); - if (CHIP_NO_ERROR == TLVUnpackError) - { - targetExists = true; - validArgumentCount++; - } - break; - case 1: - if (dataExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. - TLVUnpackError = aDataTlv.GetDataPtr(data); - if (CHIP_NO_ERROR == TLVUnpackError) - { - dataExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfOnOffClusterOffCallback(apCommandObj); + break; + } + case ZCL_ON_COMMAND_ID: { - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfOnOffClusterOnCallback(apCommandObj); + break; + } + case ZCL_TOGGLE_COMMAND_ID: { - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfTargetNavigatorClusterNavigateTargetCallback(apCommandObj, target, const_cast(data)); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfOnOffClusterToggleCallback(apCommandObj); break; } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TARGET_NAVIGATOR_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_ON_OFF_CLUSTER_ID); break; } } } } -} // namespace TargetNavigator +} // namespace OnOff } // namespace clusters @@ -1881,9 +1874,6 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_ACCOUNT_LOGIN_CLUSTER_ID: clusters::AccountLogin::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID: - clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; case ZCL_AUDIO_OUTPUT_CLUSTER_ID: clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; @@ -1893,14 +1883,8 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_KEYPAD_INPUT_CLUSTER_ID: - clusters::KeypadInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; - case ZCL_LOW_POWER_CLUSTER_ID: - clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; - case ZCL_MEDIA_INPUT_CLUSTER_ID: - clusters::MediaInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + case ZCL_LEVEL_CONTROL_CLUSTER_ID: + clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); @@ -1908,12 +1892,6 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_ON_OFF_CLUSTER_ID: clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_TV_CHANNEL_CLUSTER_ID: - clusters::TvChannel::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; - case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: - clusters::TargetNavigator::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); - break; default: // Unrecognized cluster ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, diff --git a/examples/tv-app/tv-common/gen/af-structs.h b/examples/tv-app/tv-common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/tv-app/tv-common/gen/af-structs.h +++ b/examples/tv-app/tv-common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/tv-app/tv-common/gen/call-command-handler.cpp b/examples/tv-app/tv-common/gen/call-command-handler.cpp index 9ac0c2d36a3055..55fa8266aa7000 100644 --- a/examples/tv-app/tv-common/gen/call-command-handler.cpp +++ b/examples/tv-app/tv-common/gen/call-command-handler.cpp @@ -95,7 +95,8 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID: - result = emberAfApplicationLauncherClusterServerCommandParse(cmd); + // No commands are enabled for cluster Application Launcher + result = status(false, true, cmd->mfgSpecific); break; case ZCL_AUDIO_OUTPUT_CLUSTER_ID: result = emberAfAudioOutputClusterServerCommandParse(cmd); @@ -119,17 +120,19 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_KEYPAD_INPUT_CLUSTER_ID: - result = emberAfKeypadInputClusterServerCommandParse(cmd); + // No commands are enabled for cluster Keypad Input + result = status(false, true, cmd->mfgSpecific); break; case ZCL_LEVEL_CONTROL_CLUSTER_ID: - // No commands are enabled for cluster Level Control - result = status(false, true, cmd->mfgSpecific); + result = emberAfLevelControlClusterServerCommandParse(cmd); break; case ZCL_LOW_POWER_CLUSTER_ID: - result = emberAfLowPowerClusterServerCommandParse(cmd); + // No commands are enabled for cluster Low Power + result = status(false, true, cmd->mfgSpecific); break; case ZCL_MEDIA_INPUT_CLUSTER_ID: - result = emberAfMediaInputClusterServerCommandParse(cmd); + // No commands are enabled for cluster Media Input + result = status(false, true, cmd->mfgSpecific); break; case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: result = emberAfMediaPlaybackClusterServerCommandParse(cmd); @@ -142,10 +145,12 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_TV_CHANNEL_CLUSTER_ID: - result = emberAfTvChannelClusterServerCommandParse(cmd); + // No commands are enabled for cluster TV Channel + result = status(false, true, cmd->mfgSpecific); break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: - result = emberAfTargetNavigatorClusterServerCommandParse(cmd); + // No commands are enabled for cluster Target Navigator + result = status(false, true, cmd->mfgSpecific); break; case ZCL_WAKE_ON_LAN_CLUSTER_ID: // No commands are enabled for cluster Wake on LAN @@ -210,38 +215,6 @@ EmberAfStatus emberAfAccountLoginClusterServerCommandParse(EmberAfClusterCommand } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfApplicationLauncherClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_LAUNCH_APP_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t * data; - /* TYPE WARNING: array array defaults to */ uint8_t * application; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + emberAfStringLength(data) + 1u); - application = cmd->buffer + payloadOffset; - - wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback(nullptr, data, application); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} EmberAfStatus emberAfAudioOutputClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -429,7 +402,7 @@ EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfCluste } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfKeypadInputClusterServerCommandParse(EmberAfClusterCommand * cmd) +EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -437,94 +410,205 @@ EmberAfStatus emberAfKeypadInputClusterServerCommandParse(EmberAfClusterCommand { switch (cmd->commandId) { - case ZCL_SEND_KEY_COMMAND_ID: { + case ZCL_MOVE_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t keyCode; + uint8_t moveMode; + uint8_t rate; + uint8_t optionMask; + uint8_t optionOverride; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - keyCode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfKeypadInputClusterSendKeyCallback(nullptr, keyCode); + wasHandled = emberAfLevelControlClusterMoveCallback(nullptr, moveMode, rate, optionMask, optionOverride); break; } - default: { - // Unrecognized command ID, error status will apply. + case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t level; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 2); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveToLevelCallback(nullptr, level, transitionTime, optionMask, optionOverride); break; } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfLowPowerClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; + case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t level; + uint16_t transitionTime; - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_SLEEP_COMMAND_ID: { - wasHandled = emberAfLowPowerClusterSleepCallback(nullptr); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(nullptr, level, transitionTime); break; } - default: { - // Unrecognized command ID, error status will apply. + case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t moveMode; + uint8_t rate; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(nullptr, moveMode, rate); break; } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfMediaInputClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; + case ZCL_STEP_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; + uint8_t optionMask; + uint8_t optionOverride; - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { - wasHandled = emberAfMediaInputClusterHideInputStatusCallback(nullptr); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 2); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = + emberAfLevelControlClusterStepCallback(nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride); break; } - case ZCL_RENAME_INPUT_COMMAND_ID: { + case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t index; - uint8_t * name; + uint8_t stepMode; + uint8_t stepSize; + uint16_t transitionTime; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1u) + if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - name = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfMediaInputClusterRenameInputCallback(nullptr, index, name); + wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(nullptr, stepMode, stepSize, transitionTime); break; } - case ZCL_SELECT_INPUT_COMMAND_ID: { + case ZCL_STOP_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t index; + uint8_t optionMask; + uint8_t optionOverride; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfMediaInputClusterSelectInputCallback(nullptr, index); + wasHandled = emberAfLevelControlClusterStopCallback(nullptr, optionMask, optionOverride); break; } - case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { - wasHandled = emberAfMediaInputClusterShowInputStatusCallback(nullptr); + case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { + wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(nullptr); break; } default: { @@ -650,101 +734,3 @@ EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd) } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfTvChannelClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_CHANGE_CHANNEL_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t * match; - - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - match = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfTvChannelClusterChangeChannelCallback(nullptr, match); - break; - } - case ZCL_CHANGE_CHANNEL_BY_NUMBER_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t majorNumber; - uint16_t minorNumber; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - majorNumber = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - minorNumber = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfTvChannelClusterChangeChannelByNumberCallback(nullptr, majorNumber, minorNumber); - break; - } - case ZCL_SKIP_CHANNEL_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint16_t Count; - - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - Count = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfTvChannelClusterSkipChannelCallback(nullptr, Count); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} -EmberAfStatus emberAfTargetNavigatorClusterServerCommandParse(EmberAfClusterCommand * cmd) -{ - bool wasHandled = false; - - if (!cmd->mfgSpecific) - { - switch (cmd->commandId) - { - case ZCL_NAVIGATE_TARGET_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t target; - uint8_t * data; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - target = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1u) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfTargetNavigatorClusterNavigateTargetCallback(nullptr, target, data); - break; - } - default: { - // Unrecognized command ID, error status will apply. - break; - } - } - } - return status(wasHandled, true, cmd->mfgSpecific); -} diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index 81a954961484ca..92392de0f2237a 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -1543,15 +1543,6 @@ bool emberAfAccountLoginClusterGetSetupPINCallback(chip::app::Command * commandO bool emberAfAccountLoginClusterLoginCallback(chip::app::Command * commandObj, uint8_t * tempAccountIdentifier, uint8_t * setupPIN); -/** - * @brief Application Launcher Cluster LaunchApp Command callback - * @param data - * @param application - */ - -bool emberAfApplicationLauncherClusterLaunchAppCallback(chip::app::Command * commandObj, uint8_t * data, - /* TYPE WARNING: array array defaults to */ uint8_t * application); - /** * @brief Audio Output Cluster RenameOutput Command callback * @param index @@ -1611,44 +1602,79 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::app::Co uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs); /** - * @brief Keypad Input Cluster SendKey Command callback - * @param keyCode + * @brief Level Control Cluster Move Command callback + * @param moveMode + * @param rate + * @param optionMask + * @param optionOverride */ -bool emberAfKeypadInputClusterSendKeyCallback(chip::app::Command * commandObj, uint8_t keyCode); +bool emberAfLevelControlClusterMoveCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate, uint8_t optionMask, + uint8_t optionOverride); /** - * @brief Low Power Cluster Sleep Command callback + * @brief Level Control Cluster MoveToLevel Command callback + * @param level + * @param transitionTime + * @param optionMask + * @param optionOverride */ -bool emberAfLowPowerClusterSleepCallback(chip::app::Command * commandObj); +bool emberAfLevelControlClusterMoveToLevelCallback(chip::app::Command * commandObj, uint8_t level, uint16_t transitionTime, + uint8_t optionMask, uint8_t optionOverride); /** - * @brief Media Input Cluster HideInputStatus Command callback + * @brief Level Control Cluster MoveToLevelWithOnOff Command callback + * @param level + * @param transitionTime */ -bool emberAfMediaInputClusterHideInputStatusCallback(chip::app::Command * commandObj); +bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(chip::app::Command * commandObj, uint8_t level, + uint16_t transitionTime); /** - * @brief Media Input Cluster RenameInput Command callback - * @param index - * @param name + * @brief Level Control Cluster MoveWithOnOff Command callback + * @param moveMode + * @param rate */ -bool emberAfMediaInputClusterRenameInputCallback(chip::app::Command * commandObj, uint8_t index, uint8_t * name); +bool emberAfLevelControlClusterMoveWithOnOffCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate); /** - * @brief Media Input Cluster SelectInput Command callback - * @param index + * @brief Level Control Cluster Step Command callback + * @param stepMode + * @param stepSize + * @param transitionTime + * @param optionMask + * @param optionOverride */ -bool emberAfMediaInputClusterSelectInputCallback(chip::app::Command * commandObj, uint8_t index); +bool emberAfLevelControlClusterStepCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, + uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); /** - * @brief Media Input Cluster ShowInputStatus Command callback + * @brief Level Control Cluster StepWithOnOff Command callback + * @param stepMode + * @param stepSize + * @param transitionTime */ -bool emberAfMediaInputClusterShowInputStatusCallback(chip::app::Command * commandObj); +bool emberAfLevelControlClusterStepWithOnOffCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, + uint16_t transitionTime); + +/** + * @brief Level Control Cluster Stop Command callback + * @param optionMask + * @param optionOverride + */ + +bool emberAfLevelControlClusterStopCallback(chip::app::Command * commandObj, uint8_t optionMask, uint8_t optionOverride); + +/** + * @brief Level Control Cluster StopWithOnOff Command callback + */ + +bool emberAfLevelControlClusterStopWithOnOffCallback(chip::app::Command * commandObj); /** * @brief Media Playback Cluster MediaFastForward Command callback @@ -1737,37 +1763,6 @@ bool emberAfOnOffClusterOnCallback(chip::app::Command * commandObj); bool emberAfOnOffClusterToggleCallback(chip::app::Command * commandObj); -/** - * @brief TV Channel Cluster ChangeChannel Command callback - * @param match - */ - -bool emberAfTvChannelClusterChangeChannelCallback(chip::app::Command * commandObj, uint8_t * match); - -/** - * @brief TV Channel Cluster ChangeChannelByNumber Command callback - * @param majorNumber - * @param minorNumber - */ - -bool emberAfTvChannelClusterChangeChannelByNumberCallback(chip::app::Command * commandObj, uint16_t majorNumber, - uint16_t minorNumber); - -/** - * @brief TV Channel Cluster SkipChannel Command callback - * @param count - */ - -bool emberAfTvChannelClusterSkipChannelCallback(chip::app::Command * commandObj, uint16_t Count); - -/** - * @brief Target Navigator Cluster NavigateTarget Command callback - * @param target - * @param data - */ - -bool emberAfTargetNavigatorClusterNavigateTargetCallback(chip::app::Command * commandObj, uint8_t target, uint8_t * data); - // // Non-Cluster Related Callbacks // diff --git a/examples/tv-app/tv-common/gen/client-command-macro.h b/examples/tv-app/tv-common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/tv-app/tv-common/gen/client-command-macro.h +++ b/examples/tv-app/tv-common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/tv-app/tv-common/gen/command-id.h b/examples/tv-app/tv-common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/tv-app/tv-common/gen/command-id.h +++ b/examples/tv-app/tv-common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/examples/window-app/common/gen/af-structs.h b/examples/window-app/common/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/examples/window-app/common/gen/af-structs.h +++ b/examples/window-app/common/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/examples/window-app/common/gen/client-command-macro.h b/examples/window-app/common/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/examples/window-app/common/gen/client-command-macro.h +++ b/examples/window-app/common/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/examples/window-app/common/gen/command-id.h b/examples/window-app/common/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/examples/window-app/common/gen/command-id.h +++ b/examples/window-app/common/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/src/app/chip-zcl-zpro-codec-api.h b/src/app/chip-zcl-zpro-codec-api.h index 77871bbf9e49b8..149b37133852a7 100644 --- a/src/app/chip-zcl-zpro-codec-api.h +++ b/src/app/chip-zcl-zpro-codec-api.h @@ -2362,8 +2362,8 @@ chip::System::PacketBufferHandle encodeOnOffClusterReadClusterRevisionAttribute( | Cluster OperationalCredentials | 0x003E | |------------------------------------------------------------------------------| | Commands: | | -| * GetFabricId | 0x00 | | * RemoveFabric | 0x0A | +| * SetFabric | 0x00 | | * UpdateFabricLabel | 0x09 | |------------------------------------------------------------------------------| | Attributes: | | @@ -2371,13 +2371,6 @@ chip::System::PacketBufferHandle encodeOnOffClusterReadClusterRevisionAttribute( | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -/** - * @brief - * Encode an GetFabricId command for Operational Credentials server into buffer including the APS frame - */ -chip::System::PacketBufferHandle encodeOperationalCredentialsClusterGetFabricIdCommand(uint8_t seqNum, - chip::EndpointId destinationEndpoint); - /** * @brief * Encode an RemoveFabric command for Operational Credentials server into buffer including the APS frame @@ -2387,6 +2380,13 @@ chip::System::PacketBufferHandle encodeOperationalCredentialsClusterRemoveFabric chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId); +/** + * @brief + * Encode an SetFabric command for Operational Credentials server into buffer including the APS frame + */ +chip::System::PacketBufferHandle +encodeOperationalCredentialsClusterSetFabricCommand(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint16_t vendorId); + /** * @brief * Encode an UpdateFabricLabel command for Operational Credentials server into buffer including the APS frame diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 4f92244c0e9786..ce1bc7b6c28ffa 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -165,6 +165,7 @@ template("chip_data_model") { public_deps += [ "${chip_root}/src/app", + "${chip_root}/src/app/server", "${chip_root}/src/controller", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp new file mode 100644 index 00000000000000..0f96ac36f1b0e0 --- /dev/null +++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp @@ -0,0 +1,275 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/**************************************************************************** + * @file + * @brief Implementation for the Operational Credentials Cluster + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gen/af-structs.h" +#include "gen/attribute-id.h" +#include "gen/attribute-type.h" +#include "gen/cluster-id.h" +#include "gen/command-id.h" + +using namespace chip; +using namespace ::chip::DeviceLayer; +using namespace ::chip::Transport; + +/* + * Temporary flow for fabric management until addOptCert + fabric index are implemented: + * 1) When Commissioner pairs with CHIP device, store device nodeId in Admin Pairing table as NodeId + * and store commissioner nodeId in Admin Pairing table as FabricId (This is temporary until AddOptCert is implemented and + * Fabrics are implemented correctely) 2) When pairing is complete, commissioner calls SetFabric to set the vendorId on the newly + * created fabric. The corresponding fabric is found by looking in admin pairing table and finding a fabric that has the matching + * commissioner node ID as fabricId + device nodeId as nodeId and an uninitialized vendorId. 3) RemoveFabric uses the passed in + * fabricId, nodeId, vendorID to find matching entry and remove it from admin pairing table. Once fabricIndex is implemented, it + * should use that instead. + */ + +EmberAfStatus writeFabricAttribute(uint8_t * buffer, int32_t index = -1) +{ + EmberAfAttributeSearchRecord record; + record.endpoint = 0; + record.clusterId = ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID; + record.clusterMask = CLUSTER_MASK_SERVER; + record.manufacturerCode = EMBER_AF_NULL_MANUFACTURER_CODE; + record.attributeId = ZCL_FABRICS_ATTRIBUTE_ID; + + // When reading or writing a List attribute the 'index' value could have 3 types of values: + // -1: Read/Write the whole list content, including the number of elements in the list + // 0: Read/Write the number of elements in the list, represented as a uint16_t + // n: Read/Write the nth element of the list + // + // Since the first 2 bytes of the attribute are used to store the number of elements, elements indexing starts + // at 1. In order to hide this to the rest of the code of this file, the element index is incremented by 1 here. + // This also allows calling writeAttribute() with no index arg to mean "write the length". + + return emAfReadOrWriteAttribute(&record, + NULL, // metadata + buffer, + 0, // read length + true, // write ? + index + 1); +} + +EmberAfStatus writeFabric(FabricId fabricId, NodeId nodeId, uint16_t vendorId, int32_t index) +{ + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + + EmberAfFabricDescriptor fabricDescriptor; + fabricDescriptor.FabricId = fabricId; + fabricDescriptor.NodeId = nodeId; + fabricDescriptor.VendorId = vendorId; + + emberAfPrintln(EMBER_AF_PRINT_DEBUG, + "OpCreds: Writing admin into attribute store at index %d: fabricId %" PRIX64 ", nodeId %" PRIX64 + " vendorId %" PRIX16, + index, fabricId, nodeId, vendorId); + status = writeFabricAttribute((uint8_t *) &fabricDescriptor, index); + return status; +} + +CHIP_ERROR writeAdminsIntoFabricsListAttribute() +{ + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Call to writeAdminsIntoFabricsListAttribute"); + CHIP_ERROR err = CHIP_NO_ERROR; + + // Loop through admins + int32_t fabricIndex = 0; + for (auto & pairing : GetGlobalAdminPairingTable()) + { + NodeId nodeId = pairing.GetNodeId(); + uint64_t fabricId = pairing.GetFabricId(); + uint16_t vendorId = pairing.GetVendorId(); + + // Skip over uninitialized admins + if (nodeId == kUndefinedNodeId || fabricId == kUndefinedFabricId || vendorId == kUndefinedVendorId) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, + "OpCreds: Skipping over unitialized admin with fabricId %" PRIX64 ", nodeId %" PRIX64 + " vendorId %" PRIX16, + fabricId, nodeId, vendorId); + continue; + } + else if (writeFabric(fabricId, nodeId, vendorId, fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write admin with fabricId %" PRIX64 " in fabrics list", + fabricId); + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; + break; + } + fabricIndex++; + } + + // Store the count of fabrics we just stored + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Stored %" PRIX32 " admins in fabrics list attribute.", fabricIndex); + if (writeFabricAttribute((uint8_t *) &fabricIndex) != EMBER_ZCL_STATUS_SUCCESS) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to write admin count %" PRIX32 " in fabrics list", fabricIndex); + err = CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + return err; +} + +/* + * Look at "Temporary flow for fabric management" comment above for current fabric management flow. + * To retrieve the current admin, we retrieve the emberAfCurrentCommand()->source which should be set + * to the commissioner node Id, which we are temporarily using as the fabricId. + * We should also figure out how to retrieve the device nodeId and vendorId if we can so that we use multiple + * fields to find the current admin. Once addOptCert and fabric index are implemented, remove all this and use fabricIndex. + */ + +AdminPairingInfo * retrieveCurrentAdmin() +{ + uint64_t fabricId = emberAfCurrentCommand()->source; + // TODO: Figure out how to get device node id so we can do FindAdminForNode(fabricId, nodeId)... + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Finding admin with fabricId %" PRIX64 ".", fabricId); + return GetGlobalAdminPairingTable().FindAdminForNode(fabricId); +} + +// TODO: The code currently has two sources of truths for admins, the pairing table + the attributes. There should only be one, +// the attributes list. Currently the attributes are not persisted so we are keeping the admin pairing table to have the +// fabrics/admrins be persisted. Once attributes are persisted, there should only be one sorce of truth, the attributes list and +// only that should be modifed to perosst/read/write fabrics. +// TODO: Once attributes are persisted, implement reading/writing/manipulation fabrics around that and remove adminPairingTable +// logic. +class OpCredsAdminPairingTableDelegate : public AdminPairingTableDelegate +{ + + // Gets called when a fabric is deleted from KVS store + void OnAdminDeletedFromStorage(AdminId adminId) override + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Admin %" PRIX16 " was deleted from admin storage.", adminId); + writeAdminsIntoFabricsListAttribute(); + } + + // Gets called when a fabric is loaded into the AdminPairingTable from KVS store. + void OnAdminRetrievedFromStorage(AdminPairingInfo * admin) override + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, + "OpCreds: Admin %" PRIX16 " was retrieved from storage. FabricId %" PRIX64 ", NodeId %" PRIX64 + ", VendorId %" PRIX64, + admin->GetAdminId(), admin->GetFabricId(), admin->GetNodeId()); + writeAdminsIntoFabricsListAttribute(); + } + + // Gets called when a fabric in AdminPairingTable is persisted to KVS store. + void OnAdminPersistedToStorage(AdminPairingInfo * admin) override + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, + "OpCreds: Admin %" PRIX16 " was persisted to storage. FabricId %" PRIX64 ", NodeId %" PRIX64 + ", VendorId %" PRIX64, + admin->GetAdminId(), admin->GetFabricId(), admin->GetNodeId()); + writeAdminsIntoFabricsListAttribute(); + } +}; + +OpCredsAdminPairingTableDelegate gAdminDelegate; + +void emberAfPluginOperationalCredentialsServerInitCallback(void) +{ + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Initiating OpCreds cluster by writing fabrics list from admin pairing table."); + GetGlobalAdminPairingTable().SetAdminPairingDelegate(&gAdminDelegate); + writeAdminsIntoFabricsListAttribute(); +} + +// TODO: Use FabricIndex as a parameter instead of fabricId/nodeId/vendorId once AddOptCert + FabricIndex are implemented +bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::app::Command * commandObj, chip::FabricId fabricId, + chip::NodeId nodeId, uint16_t vendorId) +{ + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln + + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + AdminPairingInfo * admin; + AdminId adminId; + CHIP_ERROR err; + + // Fetch matching admin + admin = GetGlobalAdminPairingTable().FindAdminForNode(fabricId, nodeId, vendorId); + VerifyOrExit(admin != nullptr, status = EMBER_ZCL_STATUS_SUCCESS); // Admin has already been removed + + // Delete admin + adminId = admin->GetAdminId(); + err = GetGlobalAdminPairingTable().Delete(adminId); + VerifyOrExit(err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE); + +exit: + writeAdminsIntoFabricsListAttribute(); + emberAfSendImmediateDefaultResponse(status); + return true; +} + +// TODO: remove SetFabric once AddOptCert + FabricIndex are implemented +bool emberAfOperationalCredentialsClusterSetFabricCallback(chip::app::Command * commandObj, uint16_t VendorId) +{ + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: SetFabric with vendorId %d", VendorId); + + EmberAfStatus status = EMBER_ZCL_STATUS_SUCCESS; + EmberStatus sendStatus = EMBER_SUCCESS; + CHIP_ERROR err; + + // Fetch current admin + AdminPairingInfo * admin = retrieveCurrentAdmin(); + VerifyOrExit(admin != nullptr, status = EMBER_ZCL_STATUS_FAILURE); + + // Store vendorId + admin->SetVendorId(VendorId); + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: vendorId is now set %d", admin->GetVendorId()); + err = GetGlobalAdminPairingTable().Store(admin->GetAdminId()); + VerifyOrExit(err == CHIP_NO_ERROR, status = EMBER_ZCL_STATUS_FAILURE); + + // Return FabricId - we are temporarily using commissioner nodeId (retrieved via emberAfCurrentCommand()->source) as fabricId + // until addOptCert + fabricIndex are implemented. Once they are, this method and its response will go away. + emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), + ZCL_OPERATIONAL_CREDENTIALS_CLUSTER_ID, ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "y", + emberAfCurrentCommand()->source); + sendStatus = emberAfSendResponse(); + +exit: + if (status == EMBER_ZCL_STATUS_FAILURE) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed setFabricVendorId."); + emberAfSendImmediateDefaultResponse(status); + } + if (sendStatus != EMBER_SUCCESS) + { + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: Failed to send %s response: 0x%x", "set_fabric", sendStatus); + } + + return true; +} + +bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(chip::app::Command * commandObj, uint8_t * Label) +{ + emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: UpdateFabricLabel"); + + EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; + emberAfSendImmediateDefaultResponse(status); + return true; +} diff --git a/src/app/clusters/operational-credentials/operational-credentials.cpp b/src/app/clusters/operational-credentials/operational-credentials.cpp deleted file mode 100644 index cff6c577ab72b9..00000000000000 --- a/src/app/clusters/operational-credentials/operational-credentials.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Copyright (c) 2021 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. - */ - -/**************************************************************************** - * @file - * @brief Implementation for the Operational Credentials Cluster - ***************************************************************************/ - -#include -#include -#include -#include -#include - -#include "gen/af-structs.h" -#include "gen/attribute-id.h" -#include "gen/attribute-type.h" -#include "gen/cluster-id.h" -#include "gen/command-id.h" - -using namespace chip; - -bool emberAfOperationalCredentialsClusterRemoveFabricCallback(chip::app::Command * commandObj, chip::FabricId fabricId, - chip::NodeId nodeId, uint16_t vendorId) -{ - // Go through admin pairing table and remove the element - // Then fetch the attribute list and find the right element (or maybe just use the admin pairing table index) - // Then rewrite the entire attribute list (no choice for now) - emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: RemoveFabric"); // TODO: Generate emberAfFabricClusterPrintln - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; -} - -bool emberAfOperationalCredentialsClusterGetFabricIdCallback(chip::app::Command * commandObj) -{ - emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: GetFabricId"); - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; -} - -bool emberAfOperationalCredentialsClusterUpdateFabricLabelCallback(chip::app::Command * commandObj, uint8_t * Label) -{ - emberAfPrintln(EMBER_AF_PRINT_DEBUG, "OpCreds: UpdateFabricLabel"); - // Go look at admin table using fabricId + update the label - // Then find equivalent value in attribute list and update it. - EmberAfStatus status = EMBER_ZCL_STATUS_FAILURE; - emberAfSendImmediateDefaultResponse(status); - return true; -} diff --git a/src/app/encoder.cpp b/src/app/encoder.cpp index 57a0d534c3160a..f298266a98d0b2 100644 --- a/src/app/encoder.cpp +++ b/src/app/encoder.cpp @@ -302,8 +302,8 @@ uint16_t encodeApsFrame(uint8_t * buffer, uint16_t buf_length, EmberApsFrame * a #define ZCL_TOGGLE_COMMAND_ID (0x02) #define OPERATIONAL_CREDENTIALS_CLUSTER_ID 0x003E -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define PUMP_CONFIG_CONTROL_CLUSTER_ID 0x0200 @@ -4142,8 +4142,8 @@ PacketBufferHandle encodeOnOffClusterReadClusterRevisionAttribute(uint8_t seqNum | Cluster OperationalCredentials | 0x003E | |------------------------------------------------------------------------------| | Commands: | | -| * GetFabricId | 0x00 | | * RemoveFabric | 0x0A | +| * SetFabric | 0x00 | | * UpdateFabricLabel | 0x09 | |------------------------------------------------------------------------------| | Attributes: | | @@ -4151,16 +4151,6 @@ PacketBufferHandle encodeOnOffClusterReadClusterRevisionAttribute(uint8_t seqNum | * ClusterRevision | 0xFFFD | \*----------------------------------------------------------------------------*/ -/* - * Command GetFabricId - */ -PacketBufferHandle encodeOperationalCredentialsClusterGetFabricIdCommand(uint8_t seqNum, EndpointId destinationEndpoint) -{ - COMMAND_HEADER("GetFabricId", OPERATIONAL_CREDENTIALS_CLUSTER_ID); - buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_GET_FABRIC_ID_COMMAND_ID); - COMMAND_FOOTER(); -} - /* * Command RemoveFabric */ @@ -4179,6 +4169,18 @@ PacketBufferHandle encodeOperationalCredentialsClusterRemoveFabricCommand(uint8_ COMMAND_FOOTER(); } +/* + * Command SetFabric + */ +PacketBufferHandle encodeOperationalCredentialsClusterSetFabricCommand(uint8_t seqNum, EndpointId destinationEndpoint, + uint16_t vendorId) +{ + COMMAND_HEADER("SetFabric", OPERATIONAL_CREDENTIALS_CLUSTER_ID); + + buf.Put8(kFrameControlClusterSpecificCommand).Put8(seqNum).Put8(ZCL_SET_FABRIC_COMMAND_ID).Put16(vendorId); + COMMAND_FOOTER(); +} + /* * Command UpdateFabricLabel */ diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index be49257c525f1c..b5656d58a6928f 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -90,15 +90,27 @@ class ServerStorageDelegate : public PersistentStorageDelegate CHIP_ERROR SyncGetKeyValue(const char * key, void * buffer, uint16_t & size) override { + ChipLogProgress(AppServer, "Retrieved value from server storage."); return PersistedStorage::KeyValueStoreMgr().Get(key, buffer, size); } CHIP_ERROR SyncSetKeyValue(const char * key, const void * value, uint16_t size) override { + ChipLogProgress(AppServer, "Stored value in server storage"); return PersistedStorage::KeyValueStoreMgr().Put(key, value, size); } - void AsyncDeleteKeyValue(const char * key) override { PersistedStorage::KeyValueStoreMgr().Delete(key); } + CHIP_ERROR SyncDeleteKeyValue(const char * key) override + { + ChipLogProgress(AppServer, "Delete value in server storage"); + return PersistedStorage::KeyValueStoreMgr().Delete(key); + } + + void AsyncDeleteKeyValue(const char * key) override + { + ChipLogProgress(AppServer, "Delete value in server storage."); + PersistedStorage::KeyValueStoreMgr().Delete(key); + } }; ServerStorageDelegate gServerStorage; @@ -108,7 +120,7 @@ CHIP_ERROR PersistAdminPairingToKVS(AdminPairingInfo * admin, AdminId nextAvaila ReturnErrorCodeIf(admin == nullptr, CHIP_ERROR_INVALID_ARGUMENT); ChipLogProgress(AppServer, "Persisting admin ID %d, next available %d", admin->GetAdminId(), nextAvailableId); - ReturnErrorOnFailure(admin->StoreIntoKVS(gServerStorage)); + ReturnErrorOnFailure(GetGlobalAdminPairingTable().Store(admin->GetAdminId())); ReturnErrorOnFailure(PersistedStorage::KeyValueStoreMgr().Put(kAdminTableCountKey, &nextAvailableId, sizeof(nextAvailableId))); ChipLogProgress(AppServer, "Persisting admin ID successfully"); @@ -127,18 +139,18 @@ CHIP_ERROR RestoreAllAdminPairingsFromKVS(AdminPairingTable & adminPairings, Adm // Also, the current approach can make ID lookup slower as more IDs are allocated and freed. for (AdminId id = 0; id < nextAvailableId; id++) { - AdminPairingInfo * admin = adminPairings.AssignAdminId(id); // Recreate the binding if one exists in persistent storage. Else skip to the next ID - if (admin->FetchFromKVS(gServerStorage) != CHIP_NO_ERROR) - { - adminPairings.ReleaseAdminId(id); - } - else + if (adminPairings.LoadFromStorage(id) == CHIP_NO_ERROR) { - ChipLogProgress(AppServer, "Found admin pairing for %d, node ID 0x%08" PRIx32 "%08" PRIx32, admin->GetAdminId(), - static_cast(admin->GetNodeId() >> 32), static_cast(admin->GetNodeId())); + AdminPairingInfo * admin = adminPairings.FindAdminWithId(id); + if (admin != nullptr) + { + ChipLogProgress(AppServer, "Found admin pairing for %d, node ID 0x%08" PRIx32 "%08" PRIx32, admin->GetAdminId(), + static_cast(admin->GetNodeId() >> 32), static_cast(admin->GetNodeId())); + } } } + ChipLogProgress(AppServer, "Restored all admin pairings from KVS."); return CHIP_NO_ERROR; } @@ -149,7 +161,7 @@ void EraseAllAdminPairingsUpTo(AdminId nextAvailableId) for (AdminId id = 0; id < nextAvailableId; id++) { - AdminPairingInfo::DeleteFromKVS(gServerStorage, id); + GetGlobalAdminPairingTable().Delete(id); } } @@ -268,7 +280,7 @@ class ServerRendezvousAdvertisementDelegate : public RendezvousAdvertisementDele mDelegate->OnPairingWindowClosed(); } - AdminPairingInfo * admin = gAdminPairings.FindAdmin(mAdmin); + AdminPairingInfo * admin = gAdminPairings.FindAdminWithId(mAdmin); if (admin != nullptr) { ReturnErrorOnFailure(PersistAdminPairingToKVS(admin, gNextAvailableAdminId)); @@ -493,6 +505,9 @@ void InitServer(AppDelegate * delegate) gAdvDelegate.SetDelegate(delegate); + err = gAdminPairings.Init(&gServerStorage); + SuccessOrExit(err); + // Init transport before operations with secure session mgr. err = gTransports.Init(UdpListenParameters(&DeviceLayer::InetLayer).SetAddressType(kIPAddressType_IPv6) diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index c54c92731eca5f..154e44b1ee0e34 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -148,6 +148,9 @@ void emberAfPluginDescriptorServerInitCallback(void); #ifdef ZCL_USING_TEST_CLUSTER_SERVER void emberAfPluginTestClusterServerInitCallback(void); #endif +#ifdef ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER +void emberAfPluginOperationalCredentialsServerInitCallback(void); +#endif #ifdef EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS EMBER_AF_GENERATED_PLUGIN_TICK_FUNCTION_DECLARATIONS @@ -315,6 +318,9 @@ void emberAfInit(chip::Messaging::ExchangeManager * exchangeMgr) #ifdef ZCL_USING_TEST_CLUSTER_SERVER emberAfPluginTestClusterServerInitCallback(); #endif +#ifdef ZCL_USING_OPERATIONAL_CREDENTIALS_CLUSTER_SERVER + emberAfPluginOperationalCredentialsServerInitCallback(); +#endif emAfCallInits(); } diff --git a/src/app/zap-templates/zcl/custom-types.xml b/src/app/zap-templates/zcl/custom-types.xml index cdc87450c1e572..f28318c798634a 100644 --- a/src/app/zap-templates/zcl/custom-types.xml +++ b/src/app/zap-templates/zcl/custom-types.xml @@ -46,7 +46,7 @@ limitations under the License. // Change INT16U to new type VendorID #2395 - // Change this to CHAR_STRING once it is supported #6112 + // TODO: Add Label once CHAR_STRING or OCTET_STRING works diff --git a/src/app/zap-templates/zcl/operational-credentials-cluster.xml b/src/app/zap-templates/zcl/operational-credentials-cluster.xml index e0942dc47b3e5c..b87b48fd9f484a 100644 --- a/src/app/zap-templates/zcl/operational-credentials-cluster.xml +++ b/src/app/zap-templates/zcl/operational-credentials-cluster.xml @@ -25,11 +25,21 @@ limitations under the License. fabrics list + /* + * Temporary flow for fabric management until addOptCert + fabric index are implemented: + * 1) When Commissioner pairs with CHIP device, store device nodeId in Admin Pairing table as NodeId + * and store commissioner nodeId in Admin Pairing table as FabricId (This is temporary until AddOptCert is implemented and Fabrics are implemented correctely) + * 2) When pairing is complete, commissioner calls SetFabric to set the vendorId on the newly created fabric. The corresponding fabric is found by looking + * in admin pairing table and finding a fabric that has the matching commissioner node ID as fabricId + device nodeId as nodeId and an uninitialized vendorId. + * 3) RemoveFabric uses the passed in fabricId, nodeId, vendorID to find matching entry and remove it from admin pairing table. Once fabricIndex is implemented, it should use that instead. + */ + This command SHALL be used by an Administrative Node to set the user-visible Label field for a given Fabric, as reflected by entries in the Fabrics attribute. + // TODO: Once FabricIndex is implemented, have RemoveFabric take an index instead of vid+fabricId+nopeId This command is used by Administrative Nodes to remove a given Fabric and delete all associated fabric-scoped data. @@ -38,12 +48,14 @@ fabric-scoped data. - - Retrieve the fabricID of the admin executing this command. + // TODO: Remove SetFabric + SetFabricResponse once addOptCert command is implemented + + Sets the vendorID of the fabric and returns the fabricId of newly created fabric. + - - Sender expects GetFabricIdResponse command if the GetFabricId command was correctly received + + Sender expects SetFabricResponse command if the SetFabric command was correctly received diff --git a/src/app/zap_cluster_list.py b/src/app/zap_cluster_list.py index f0c49b7ccd26ee..e15599c6890cd5 100755 --- a/src/app/zap_cluster_list.py +++ b/src/app/zap_cluster_list.py @@ -36,7 +36,7 @@ 'NETWORK_COMMISSIONING_CLUSTER': ['network-commissioning'], 'OCCUPANCY_SENSING_CLUSTER': [], 'ON_OFF_CLUSTER': ['on-off-server'], - 'OPERATIONAL_CREDENTIALS_CLUSTER': ['operational-credentials'], + 'OPERATIONAL_CREDENTIALS_CLUSTER': ['operational-credentials-server'], 'OTA_BOOTLOAD_CLUSTER': [], 'OTA_SERVER_CLUSTER': ['ota-server'], 'OTA_CLIENT_CLUSTER': [], @@ -83,7 +83,7 @@ 'NETWORK_COMMISSIONING_CLUSTER': [], 'OCCUPANCY_SENSING_CLUSTER': [], 'ON_OFF_CLUSTER': [], - 'OPERATIONAL_CREDENTIALS_CLUSTER': ['operational-credentials'], + 'OPERATIONAL_CREDENTIALS_CLUSTER': [], 'OTA_BOOTLOAD_CLUSTER': [], 'OTA_SERVER_CLUSTER': ['ota-server'], 'OTA_CLIENT_CLUSTER': [], diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 9b86736266cefd..0ffbafa91177fb 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -688,7 +688,7 @@ CHIP_ERROR DeviceCommissioner::PairDevice(NodeId remoteDeviceId, RendezvousParam Messaging::ExchangeContext * exchangeCtxt = nullptr; - Transport::AdminPairingInfo * admin = mAdmins.FindAdmin(mAdminId); + Transport::AdminPairingInfo * admin = mAdmins.FindAdminWithId(mAdminId); VerifyOrExit(remoteDeviceId != kAnyNodeId && remoteDeviceId != kUndefinedNodeId, err = CHIP_ERROR_INVALID_ARGUMENT); VerifyOrExit(mState == State::Initialized, err = CHIP_ERROR_INCORRECT_STATE); diff --git a/src/controller/python/chip/clusters/CHIPClusters.cpp b/src/controller/python/chip/clusters/CHIPClusters.cpp index bb4f98bafe8304..25b5b90ccdbaad 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.cpp +++ b/src/controller/python/chip/clusters/CHIPClusters.cpp @@ -2170,14 +2170,6 @@ CHIP_ERROR chip_ime_ReadAttribute_OnOff_ClusterRevision(chip::Controller::Device // End of Cluster OnOff // Cluster OperationalCredentials -CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_GetFabricId(chip::Controller::Device * device, - chip::EndpointId ZCLendpointId, chip::GroupId) -{ - VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - chip::Controller::OperationalCredentialsCluster cluster; - cluster.Associate(device, ZCLendpointId); - return cluster.GetFabricId(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel()); -} CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveFabric(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, chip::FabricId fabricId, chip::NodeId nodeId, @@ -2188,6 +2180,14 @@ CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_RemoveFabric(chip::Cont cluster.Associate(device, ZCLendpointId); return cluster.RemoveFabric(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), fabricId, nodeId, vendorId); } +CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_SetFabric(chip::Controller::Device * device, + chip::EndpointId ZCLendpointId, chip::GroupId, uint16_t vendorId) +{ + VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + chip::Controller::OperationalCredentialsCluster cluster; + cluster.Associate(device, ZCLendpointId); + return cluster.SetFabric(gDefaultSuccessCallback.Cancel(), gDefaultFailureCallback.Cancel(), vendorId); +} CHIP_ERROR chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId, const uint8_t * label, uint32_t label_Len) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 98261141946fe9..cacf420d2332f1 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -481,13 +481,14 @@ def ListClusterCommands(self): }, }, "OperationalCredentials": { - "GetFabricId": { - }, "RemoveFabric": { "fabricId": "int", "nodeId": "int", "vendorId": "int", }, + "SetFabric": { + "vendorId": "int", + }, "UpdateFabricLabel": { "label": "str", }, @@ -1278,14 +1279,14 @@ def ClusterOnOff_CommandToggle(self, device: ctypes.c_void_p, ZCLendpoint: int, return self._chipLib.chip_ime_AppendCommand_OnOff_Toggle( device, ZCLendpoint, ZCLgroupid ) - def ClusterOperationalCredentials_CommandGetFabricId(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int): - return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId( - device, ZCLendpoint, ZCLgroupid - ) def ClusterOperationalCredentials_CommandRemoveFabric(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, fabricId: int, nodeId: int, vendorId: int): return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric( device, ZCLendpoint, ZCLgroupid, fabricId, nodeId, vendorId ) + def ClusterOperationalCredentials_CommandSetFabric(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, vendorId: int): + return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_SetFabric( + device, ZCLendpoint, ZCLgroupid, vendorId + ) def ClusterOperationalCredentials_CommandUpdateFabricLabel(self, device: ctypes.c_void_p, ZCLendpoint: int, ZCLgroupid: int, label: bytes): label = label.encode("utf-8") + b'\x00' return self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel( @@ -2477,12 +2478,12 @@ def InitLib(self, chipLib): self._chipLib.chip_ime_ReadAttribute_OnOff_ClusterRevision.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] self._chipLib.chip_ime_ReadAttribute_OnOff_ClusterRevision.restype = ctypes.c_uint32 # Cluster OperationalCredentials - # Cluster OperationalCredentials Command GetFabricId - self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16] - self._chipLib.chip_ime_AppendCommand_OperationalCredentials_GetFabricId.restype = ctypes.c_uint32 # Cluster OperationalCredentials Command RemoveFabric self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint64, ctypes.c_uint64, ctypes.c_uint16] self._chipLib.chip_ime_AppendCommand_OperationalCredentials_RemoveFabric.restype = ctypes.c_uint32 + # Cluster OperationalCredentials Command SetFabric + self._chipLib.chip_ime_AppendCommand_OperationalCredentials_SetFabric.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_uint16] + self._chipLib.chip_ime_AppendCommand_OperationalCredentials_SetFabric.restype = ctypes.c_uint32 # Cluster OperationalCredentials Command UpdateFabricLabel self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel.argtypes = [ctypes.c_void_p, ctypes.c_uint8, ctypes.c_uint16, ctypes.c_char_p, ctypes.c_uint32] self._chipLib.chip_ime_AppendCommand_OperationalCredentials_UpdateFabricLabel.restype = ctypes.c_uint32 diff --git a/src/controller/python/chip/internal/CommissionerImpl.cpp b/src/controller/python/chip/internal/CommissionerImpl.cpp index ee6b72efb9adad..0114293e203cf7 100644 --- a/src/controller/python/chip/internal/CommissionerImpl.cpp +++ b/src/controller/python/chip/internal/CommissionerImpl.cpp @@ -54,6 +54,11 @@ class ServerStorageDelegate : public chip::PersistentStorageDelegate return chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Put(key, value, size); } + CHIP_ERROR SyncDeleteKeyValue(const char * key) override + { + return chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(key); + } + void AsyncDeleteKeyValue(const char * key) override { chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr().Delete(key); } private: diff --git a/src/controller/python/gen/CHIPClientCallbacks.cpp b/src/controller/python/gen/CHIPClientCallbacks.cpp index 84abd16b2426bb..29db4ce13f6c36 100644 --- a/src/controller/python/gen/CHIPClientCallbacks.cpp +++ b/src/controller/python/gen/CHIPClientCallbacks.cpp @@ -490,9 +490,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = chip::ByteSpan(message, 32); - message += 32; - CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); message += 8; CHECK_MESSAGE_LENGTH(8); @@ -1872,15 +1869,15 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a return true; } -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) { - ChipLogProgress(Zcl, "GetFabricIdResponse:"); + ChipLogProgress(Zcl, "SetFabricResponse:"); ChipLogProgress(Zcl, " FabricId: %" PRIu64 "", FabricId); - GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterGetFabricIdResponseCallback"); + GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterSetFabricResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, FabricId); return true; } diff --git a/src/controller/python/gen/CHIPClientCallbacks.h b/src/controller/python/gen/CHIPClientCallbacks.h index 72855168d14220..0864133215cf91 100644 --- a/src/controller/python/gen/CHIPClientCallbacks.h +++ b/src/controller/python/gen/CHIPClientCallbacks.h @@ -110,7 +110,7 @@ typedef void (*NetworkCommissioningClusterUpdateThreadNetworkResponseCallback)(v uint8_t * debugText); typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode, uint8_t * debugText); -typedef void (*OperationalCredentialsClusterGetFabricIdResponseCallback)(void * context, chip::FabricId FabricId); +typedef void (*OperationalCredentialsClusterSetFabricResponseCallback)(void * context, chip::FabricId FabricId); typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId); typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount, diff --git a/src/controller/python/gen/CHIPClusters.cpp b/src/controller/python/gen/CHIPClusters.cpp index 0edde18b28d8d6..1a6deb926c5223 100644 --- a/src/controller/python/gen/CHIPClusters.cpp +++ b/src/controller/python/gen/CHIPClusters.cpp @@ -4511,42 +4511,50 @@ CHIP_ERROR OnOffCluster::ReadAttributeClusterRevision(Callback::Cancelable * onS } // OperationalCredentials Cluster Commands -CHIP_ERROR OperationalCredentialsCluster::GetFabricId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, + chip::NodeId nodeId, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetFabricIdCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); - // Command takes no arguments. + TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); + uint8_t argSeqNumber = 0; + // fabricId: fabricId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); + // nodeId: nodeId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); + // vendorId: int16u + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); ReturnErrorOnFailure(ZCLcommand->FinishCommand()); return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterGetFabricIdCommand(seqNum, mEndpoint); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } -CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, - chip::NodeId nodeId, uint16_t vendorId) +CHIP_ERROR OperationalCredentialsCluster::SetFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); @@ -4554,10 +4562,6 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); uint8_t argSeqNumber = 0; - // fabricId: fabricId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); - // nodeId: nodeId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); // vendorId: int16u ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); @@ -4565,9 +4569,8 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = - encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterSetFabricCommand(seqNum, mEndpoint, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } diff --git a/src/controller/python/gen/CHIPClusters.h b/src/controller/python/gen/CHIPClusters.h index 0639794a52d6cc..1a8e5d93fed59b 100644 --- a/src/controller/python/gen/CHIPClusters.h +++ b/src/controller/python/gen/CHIPClusters.h @@ -818,9 +818,9 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase ~OperationalCredentialsCluster() {} // Cluster Commands - CHIP_ERROR GetFabricId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId); + CHIP_ERROR SetFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t vendorId); CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan label); @@ -830,8 +830,8 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: - static constexpr CommandId kGetFabricIdCommandId = 0x00; static constexpr CommandId kRemoveFabricCommandId = 0x0A; + static constexpr CommandId kSetFabricCommandId = 0x00; static constexpr CommandId kUpdateFabricLabelCommandId = 0x09; }; diff --git a/src/controller/python/gen/CHIPClustersObjc.h b/src/controller/python/gen/CHIPClustersObjc.h index 9cc61d60648ce1..2df796e1bb82a7 100644 --- a/src/controller/python/gen/CHIPClustersObjc.h +++ b/src/controller/python/gen/CHIPClustersObjc.h @@ -686,11 +686,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId nodeId:(uint64_t)nodeId vendorId:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; - (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; diff --git a/src/controller/python/gen/CHIPClustersObjc.mm b/src/controller/python/gen/CHIPClustersObjc.mm index 54ef66191619c7..ca29cdb86ff577 100644 --- a/src/controller/python/gen/CHIPClustersObjc.mm +++ b/src/controller/python/gen/CHIPClustersObjc.mm @@ -2183,22 +2183,22 @@ static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText) dispatch_queue_t mQueue; }; -class CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge - : public Callback::Callback { +class CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge + : public Callback::Callback { public: - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge() {}; + ~CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge() {}; static void CallbackFn(void * context, chip::FabricId FabricId) { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2755,11 +2755,9 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri if (callback && callback->mQueue) { id values[count]; for (uint16_t i = 0; i < count; i++) { - values[i] = - [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], - @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", - [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], + @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -10108,10 +10106,12 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)responseHandler +- (void)removeFabric:(uint64_t)fabricId + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -10126,7 +10126,7 @@ - (void)getFabricId:(ResponseHandler)responseHandler __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.GetFabricId(onSuccess->Cancel(), onFailure->Cancel()); + err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); }); if (err != CHIP_NO_ERROR) { @@ -10135,12 +10135,10 @@ - (void)getFabricId:(ResponseHandler)responseHandler responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - responseHandler:(ResponseHandler)responseHandler +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * onSuccess + = new CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -10155,7 +10153,7 @@ - (void)removeFabric:(uint64_t)fabricId __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); + err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(), vendorId); }); if (err != CHIP_NO_ERROR) { diff --git a/src/controller/python/gen/IMClusterCommandHandler.cpp b/src/controller/python/gen/IMClusterCommandHandler.cpp index 5e52280a1eba6e..25d884c2bd8827 100644 --- a/src/controller/python/gen/IMClusterCommandHandler.cpp +++ b/src/controller/python/gen/IMClusterCommandHandler.cpp @@ -4772,7 +4772,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En { switch (aCommandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. @@ -4827,7 +4827,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(apCommandObj, FabricId); + emberAfOperationalCredentialsClusterSetFabricResponseCallback(apCommandObj, FabricId); } else { diff --git a/src/controller/python/gen/af-structs.h b/src/controller/python/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/src/controller/python/gen/af-structs.h +++ b/src/controller/python/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/src/controller/python/gen/call-command-handler.cpp b/src/controller/python/gen/call-command-handler.cpp index 9f4438c1700029..18e0da94b208de 100644 --- a/src/controller/python/gen/call-command-handler.cpp +++ b/src/controller/python/gen/call-command-handler.cpp @@ -1453,7 +1453,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus { switch (cmd->commandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; chip::FabricId FabricId; @@ -1463,7 +1463,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus } FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(nullptr, FabricId); + wasHandled = emberAfOperationalCredentialsClusterSetFabricResponseCallback(nullptr, FabricId); break; } default: { diff --git a/src/controller/python/gen/callback.h b/src/controller/python/gen/callback.h index 16667fcb89ae82..d6feaf86e16ddb 100644 --- a/src/controller/python/gen/callback.h +++ b/src/controller/python/gen/callback.h @@ -3088,11 +3088,11 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a uint8_t * debugText); /** - * @brief Operational Credentials Cluster GetFabricIdResponse Command callback + * @brief Operational Credentials Cluster SetFabricResponse Command callback * @param fabricId */ -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); /** * @brief Scenes Cluster AddSceneResponse Command callback diff --git a/src/controller/python/gen/client-command-macro.h b/src/controller/python/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/src/controller/python/gen/client-command-macro.h +++ b/src/controller/python/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/src/controller/python/gen/command-id.h b/src/controller/python/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/src/controller/python/gen/command-id.h +++ b/src/controller/python/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/src/controller/python/gen/endpoint_config.h b/src/controller/python/gen/endpoint_config.h index 79ba2a6aca84ac..a927535f5aeb5d 100644 --- a/src/controller/python/gen/endpoint_config.h +++ b/src/controller/python/gen/endpoint_config.h @@ -412,8 +412,8 @@ { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ \ /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetFabricId */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetFabricIdResponse */ \ + { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetFabric */ \ + { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SetFabricResponse */ \ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ \ diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h index 26374a83c857e7..0bdae1b4551936 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.h @@ -18,9 +18,12 @@ #import #import +#define kCHIPToolTmpVendorId 0x1771 + extern NSString * const kCHIPToolDefaultsDomain; extern NSString * const kNetworkSSIDDefaultsKey; extern NSString * const kNetworkPasswordDefaultsKey; +extern NSString * const kFabricIdKey; CHIPDeviceController * InitializeCHIP(void); id CHIPGetDomainValueForKey(NSString * domain, NSString * key); diff --git a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m index 8a006f4d6757fc..65372fdf7a8a70 100644 --- a/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m +++ b/src/darwin/CHIPTool/CHIPTool/Framework Helpers/DefaultsUtils.m @@ -21,6 +21,7 @@ NSString * const kNetworkSSIDDefaultsKey = @"networkSSID"; NSString * const kNetworkPasswordDefaultsKey = @"networkPassword"; NSString * const kCHIPNextAvailableDeviceIDKey = @"nextDeviceID"; +NSString * const kFabricIdKey = @"fabricId"; id CHIPGetDomainValueForKey(NSString * domain, NSString * key) { @@ -98,7 +99,12 @@ void CHIPSetNextAvailableDeviceID(uint64_t id) CHIPDeviceController * controller = InitializeCHIP(); NSError * error; - return [controller getPairedDevice:deviceId error:&error]; + CHIPDevice * device = [controller getPairedDevice:deviceId error:&error]; + if (error.code != CHIPSuccess) { + NSLog(@"Got back error retrieve device with deviceId %llu", deviceId); + return nil; + } + return device; } void CHIPUnpairDeviceWithID(uint64_t deviceId) diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m index 0a8f4390184001..e91a0eaed1730f 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Fabric/FabricUIViewController.m @@ -39,7 +39,7 @@ - (void)viewDidLoad queue:dispatch_get_main_queue()]; [self setupUIElements]; - [self fetchFabricId]; + [self fetchFabricsList]; // listen for taps to dismiss the keyboard UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissKeyboard)]; @@ -75,17 +75,14 @@ - (void)setupUIElements [_stackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-30].active = YES; // Get Fabric ID - UIButton * getFabricIDButton = [UIButton new]; - [getFabricIDButton setTitle:@"Go" forState:UIControlStateNormal]; - [getFabricIDButton addTarget:self action:@selector(getFabricIDButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; _getFabricIDLabel = [UILabel new]; - _getFabricIDLabel.text = @"FabricID:"; - UIStackView * stackViewButtons = [CHIPUIViewUtils stackViewWithLabel:_getFabricIDLabel buttons:@[ getFabricIDButton ]]; - stackViewButtons.axis = UILayoutConstraintAxisHorizontal; - stackViewButtons.distribution = UIStackViewDistributionEqualSpacing; - stackViewButtons.alignment = UIStackViewAlignmentLeading; - stackViewButtons.spacing = 10; - [_stackView addArrangedSubview:stackViewButtons]; + NSNumber * fabricId = CHIPGetDomainValueForKey(kCHIPToolDefaultsDomain, kFabricIdKey); + _getFabricIDLabel.text = [NSString stringWithFormat:@"FabricID: %@", fabricId]; + [_stackView addArrangedSubview:_getFabricIDLabel]; + + _getFabricIDLabel.translatesAutoresizingMaskIntoConstraints = false; + [_getFabricIDLabel.leadingAnchor constraintEqualToAnchor:_stackView.leadingAnchor].active = YES; + [_getFabricIDLabel.trailingAnchor constraintEqualToAnchor:_stackView.trailingAnchor].active = YES; // Update Fabric Label UIButton * updateFabricLabelButton = [UIButton new]; @@ -123,7 +120,7 @@ - (void)setupUIElements getFabricsListButton.layer.cornerRadius = 5; getFabricsListButton.clipsToBounds = YES; getFabricsListButton.backgroundColor = UIColor.systemBlueColor; - [getFabricsListButton setTitle:@"Get Fabrics List" forState:UIControlStateNormal]; + [getFabricsListButton setTitle:@"Update Fabrics List" forState:UIControlStateNormal]; [getFabricsListButton addTarget:self action:@selector(getFabricsListButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; @@ -135,7 +132,7 @@ - (void)setupUIElements // Result message _resultLabel = [UILabel new]; - _resultLabel.font = [UIFont systemFontOfSize:14]; + _resultLabel.font = [UIFont systemFontOfSize:12]; _resultLabel.textColor = UIColor.systemBlueColor; _resultLabel.lineBreakMode = NSLineBreakByWordWrapping; _resultLabel.numberOfLines = 0; @@ -147,7 +144,7 @@ - (void)setupUIElements // Fabrics text view _fabricsListTextView = [UITextView new]; - _fabricsListTextView.font = [UIFont systemFontOfSize:14]; + _fabricsListTextView.font = [UIFont systemFontOfSize:12]; _fabricsListTextView.textColor = [UIColor systemBlueColor]; _fabricsListTextView.scrollEnabled = YES; _fabricsListTextView.userInteractionEnabled = NO; @@ -189,7 +186,7 @@ - (void)updateFabricsListUIWithFabrics:(NSArray *)fabricsList error:(NSError *)e [fabricsText appendString:[NSString stringWithFormat:@"NodeId: %@\n", nodeID]]; [fabricsText appendString:[NSString stringWithFormat:@"VendorId: %@\n", vendorID]]; [fabricsText appendString:[NSString stringWithFormat:@"FabricLabel: %@\n", [label length] > 0 ? label : @"not set"]]; - [fabricsText appendString:@"------"]; + [fabricsText appendString:@"------\n"]; fabricIndex++; } } else { @@ -224,38 +221,8 @@ - (void)fetchFabricsList }]; } -- (void)fetchFabricId -{ - NSLog(@"Request to fetchFabricId"); - [self updateResult:[NSString stringWithFormat:@"getFabricId command sent."] isError:NO]; - [self.cluster getFabricId:^(NSError * _Nullable error, NSDictionary * _Nullable values) { - if (error) { - NSLog(@"Got back error trying to getFabricId %@", error); - [self updateResult:[NSString stringWithFormat:@"getFabricId command failed with error %@.", error] isError:YES]; - } else { - NSLog(@"Got back fabricID values %@", values); - NSNumber * fabricID = [values objectForKey:@"FabricId"]; - if (fabricID) { - dispatch_async(dispatch_get_main_queue(), ^{ - self->_fabricID = fabricID; - self->_getFabricIDLabel.text = [NSString stringWithFormat:@"FabricID: %@", fabricID]; - [self updateResult:[NSString - stringWithFormat:@"getFabricId command returned %@. Updating fabrics list.", fabricID] - isError:NO]; - [self fetchFabricsList]; - }); - } - } - }]; -} - // MARK: UIButton methods -- (IBAction)getFabricIDButtonPressed:(id)sender -{ - [self fetchFabricId]; -} - - (IBAction)updateFabricLabelButtonPressed:(id)sender { NSString * label = _updateFabricLabelTextField.text; diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m index f4a6a92639e0c3..11ec3c147fdf14 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/QRCode/QRCodeViewController.m @@ -365,13 +365,39 @@ - (void)readerSession:(nonnull NFCNDEFReaderSession *)session didInvalidateWithE _session = nil; } +- (void)setVendorIDOnAccessory +{ + NSLog(@"Call to setVendorIDOnAccessory"); + CHIPDevice * device = CHIPGetPairedDevice(); + if (device) { + CHIPOperationalCredentials * opCreds = [[CHIPOperationalCredentials alloc] initWithDevice:device + endpoint:0 + queue:dispatch_get_main_queue()]; + [opCreds setFabric:kCHIPToolTmpVendorId + completionHandler:^(NSError * _Nullable error, NSDictionary * _Nullable values) { + if (error.code != CHIPSuccess) { + NSLog(@"Got back error trying to getFabricId %@", error); + } else { + NSLog(@"Got back fabricID values %@, storing it", values); + NSNumber * fabricID = [values objectForKey:@"FabricId"]; + CHIPSetDomainValueForKey(kCHIPToolDefaultsDomain, kFabricIdKey, fabricID); + } + }]; + } +} + // MARK: CHIPDevicePairingDelegate - (void)onPairingComplete:(NSError *)error { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DISPATCH_TIME_NOW), dispatch_get_main_queue(), ^{ - [self->_deviceList refreshDeviceList]; - [self retrieveAndSendWifiCredentials]; - }); + if (error.code != CHIPSuccess) { + NSLog(@"Got pairing error back %@", error); + } else { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DISPATCH_TIME_NOW), dispatch_get_main_queue(), ^{ + [self->_deviceList refreshDeviceList]; + [self retrieveAndSendWifiCredentials]; + [self setVendorIDOnAccessory]; + }); + } } // MARK: UI Helper methods diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp index 64caca3e311ade..0e0d31e43b144c 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp +++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.cpp @@ -490,9 +490,6 @@ bool emberAfReadAttributesResponseCallback(ClusterId clusterId, uint8_t * messag data[i].VendorId = emberAfGetInt16u(message, 0, messageLen); message += 2; CHECK_MESSAGE_LENGTH(2); - data[i].Label = chip::ByteSpan(message, 32); - message += 32; - CHECK_MESSAGE_LENGTH(32); data[i].NodeId = emberAfGetInt64u(message, 0, messageLen); message += 8; CHECK_MESSAGE_LENGTH(8); @@ -1643,15 +1640,15 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a return true; } -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId) { - ChipLogProgress(Zcl, "GetFabricIdResponse:"); + ChipLogProgress(Zcl, "SetFabricResponse:"); ChipLogProgress(Zcl, " FabricId: %" PRIu64 "", FabricId); - GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterGetFabricIdResponseCallback"); + GET_RESPONSE_CALLBACKS("OperationalCredentialsClusterSetFabricResponseCallback"); - Callback::Callback * cb = - Callback::Callback::FromCancelable(onSuccessCallback); + Callback::Callback * cb = + Callback::Callback::FromCancelable(onSuccessCallback); cb->mCall(cb->mContext, FabricId); return true; } diff --git a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h index d2c56fe3e0efee..5918c99d1bc450 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClientCallbacks.h @@ -94,7 +94,7 @@ typedef void (*NetworkCommissioningClusterUpdateThreadNetworkResponseCallback)(v uint8_t * debugText); typedef void (*NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback)(void * context, uint8_t errorCode, uint8_t * debugText); -typedef void (*OperationalCredentialsClusterGetFabricIdResponseCallback)(void * context, chip::FabricId FabricId); +typedef void (*OperationalCredentialsClusterSetFabricResponseCallback)(void * context, chip::FabricId FabricId); typedef void (*ScenesClusterAddSceneResponseCallback)(void * context, uint16_t groupId, uint8_t sceneId); typedef void (*ScenesClusterGetSceneMembershipResponseCallback)(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount, diff --git a/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp b/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp index d2a3c21c50bdb1..f54b07907e2e16 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp +++ b/src/darwin/Framework/CHIP/gen/CHIPClusters.cpp @@ -3704,42 +3704,50 @@ CHIP_ERROR OnOffCluster::ReadAttributeClusterRevision(Callback::Cancelable * onS } // OperationalCredentials Cluster Commands -CHIP_ERROR OperationalCredentialsCluster::GetFabricId(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback) +CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, + chip::NodeId nodeId, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kGetFabricIdCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); ReturnErrorOnFailure(ZCLcommand->PrepareCommand(&cmdParams)); - // Command takes no arguments. + TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); + uint8_t argSeqNumber = 0; + // fabricId: fabricId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); + // nodeId: nodeId + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); + // vendorId: int16u + ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); ReturnErrorOnFailure(ZCLcommand->FinishCommand()); return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterGetFabricIdCommand(seqNum, mEndpoint); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = + encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } -CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * onSuccessCallback, - Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, - chip::NodeId nodeId, uint16_t vendorId) +CHIP_ERROR OperationalCredentialsCluster::SetFabric(Callback::Cancelable * onSuccessCallback, + Callback::Cancelable * onFailureCallback, uint16_t vendorId) { #if CHIP_ENABLE_INTERACTION_MODEL VerifyOrReturnError(mDevice != nullptr, CHIP_ERROR_INCORRECT_STATE); (void) onSuccessCallback; (void) onFailureCallback; - app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kRemoveFabricCommandId, + app::CommandPathParams cmdParams = { mEndpoint, /* group id */ 0, mClusterId, kSetFabricCommandId, (chip::app::CommandPathFlags::kEndpointIdValid) }; app::Command * ZCLcommand = mDevice->GetCommandSender(); @@ -3747,10 +3755,6 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on TLV::TLVWriter * writer = ZCLcommand->GetCommandDataElementTLVWriter(); uint8_t argSeqNumber = 0; - // fabricId: fabricId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), fabricId)); - // nodeId: nodeId - ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), nodeId)); // vendorId: int16u ReturnErrorOnFailure(writer->Put(TLV::ContextTag(argSeqNumber++), vendorId)); @@ -3758,9 +3762,8 @@ CHIP_ERROR OperationalCredentialsCluster::RemoveFabric(Callback::Cancelable * on return mDevice->SendCommands(); #else - uint8_t seqNum = mDevice->GetNextSequenceNumber(); - System::PacketBufferHandle encodedCommand = - encodeOperationalCredentialsClusterRemoveFabricCommand(seqNum, mEndpoint, fabricId, nodeId, vendorId); + uint8_t seqNum = mDevice->GetNextSequenceNumber(); + System::PacketBufferHandle encodedCommand = encodeOperationalCredentialsClusterSetFabricCommand(seqNum, mEndpoint, vendorId); return SendCommand(seqNum, std::move(encodedCommand), onSuccessCallback, onFailureCallback); #endif } diff --git a/src/darwin/Framework/CHIP/gen/CHIPClusters.h b/src/darwin/Framework/CHIP/gen/CHIPClusters.h index d2b819408e5deb..d4aa3fd1af4608 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClusters.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClusters.h @@ -640,9 +640,9 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase ~OperationalCredentialsCluster() {} // Cluster Commands - CHIP_ERROR GetFabricId(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); CHIP_ERROR RemoveFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::FabricId fabricId, chip::NodeId nodeId, uint16_t vendorId); + CHIP_ERROR SetFabric(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, uint16_t vendorId); CHIP_ERROR UpdateFabricLabel(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback, chip::ByteSpan label); @@ -652,8 +652,8 @@ class DLL_EXPORT OperationalCredentialsCluster : public ClusterBase CHIP_ERROR ReadAttributeClusterRevision(Callback::Cancelable * onSuccessCallback, Callback::Cancelable * onFailureCallback); private: - static constexpr CommandId kGetFabricIdCommandId = 0x00; static constexpr CommandId kRemoveFabricCommandId = 0x0A; + static constexpr CommandId kSetFabricCommandId = 0x00; static constexpr CommandId kUpdateFabricLabelCommandId = 0x09; }; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h index 4c55adfab7e875..52ba9308e8ad8c 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.h @@ -578,11 +578,11 @@ NS_ASSUME_NONNULL_BEGIN */ @interface CHIPOperationalCredentials : CHIPCluster -- (void)getFabricId:(ResponseHandler)responseHandler; - (void)removeFabric:(uint64_t)fabricId nodeId:(uint64_t)nodeId vendorId:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler; - (void)updateFabricLabel:(NSString *)label responseHandler:(ResponseHandler)responseHandler; - (void)readAttributeFabricsListWithResponseHandler:(ResponseHandler)responseHandler; diff --git a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm index 00c39d973adef4..618dab45d9fe9e 100644 --- a/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/gen/CHIPClustersObjc.mm @@ -1672,22 +1672,22 @@ static void CallbackFn(void * context, uint8_t errorCode, uint8_t * debugText) dispatch_queue_t mQueue; }; -class CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge - : public Callback::Callback { +class CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge + : public Callback::Callback { public: - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) - : Callback::Callback(CallbackFn, this) + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(ResponseHandler handler, dispatch_queue_t queue) + : Callback::Callback(CallbackFn, this) , mHandler(handler) , mQueue(queue) { } - ~CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge() {}; + ~CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge() {}; static void CallbackFn(void * context, chip::FabricId FabricId) { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * callback - = reinterpret_cast(context); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * callback + = reinterpret_cast(context); if (callback && callback->mQueue) { dispatch_async(callback->mQueue, ^{ callback->mHandler(nil, @ { @@ -2178,11 +2178,9 @@ static void CallbackFn(void * context, uint16_t count, _FabricDescriptor * entri if (callback && callback->mQueue) { id values[count]; for (uint16_t i = 0; i < count; i++) { - values[i] = - [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], - @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", - [NSData dataWithBytes:entries[i].Label.data() length:entries[i].Label.size()], @"Label", - [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; + values[i] = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:entries[i].FabricId], + @"FabricId", [NSNumber numberWithUnsignedShort:entries[i].VendorId], @"VendorId", + [NSNumber numberWithUnsignedLongLong:entries[i].NodeId], @"NodeId", nil]; } id array = [NSArray arrayWithObjects:values count:count]; @@ -8466,10 +8464,12 @@ @implementation CHIPOperationalCredentials return &_cppCluster; } -- (void)getFabricId:(ResponseHandler)responseHandler +- (void)removeFabric:(uint64_t)fabricId + nodeId:(uint64_t)nodeId + vendorId:(uint16_t)vendorId + responseHandler:(ResponseHandler)responseHandler { - CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge * onSuccess - = new CHIPOperationalCredentialsClusterGetFabricIdResponseCallbackBridge(responseHandler, [self callbackQueue]); + CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -8484,7 +8484,7 @@ - (void)getFabricId:(ResponseHandler)responseHandler __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.GetFabricId(onSuccess->Cancel(), onFailure->Cancel()); + err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); }); if (err != CHIP_NO_ERROR) { @@ -8493,12 +8493,10 @@ - (void)getFabricId:(ResponseHandler)responseHandler responseHandler([CHIPError errorForCHIPErrorCode:err], nil); } } -- (void)removeFabric:(uint64_t)fabricId - nodeId:(uint64_t)nodeId - vendorId:(uint16_t)vendorId - responseHandler:(ResponseHandler)responseHandler +- (void)setFabric:(uint16_t)vendorId responseHandler:(ResponseHandler)responseHandler { - CHIPDefaultSuccessCallbackBridge * onSuccess = new CHIPDefaultSuccessCallbackBridge(responseHandler, [self callbackQueue]); + CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge * onSuccess + = new CHIPOperationalCredentialsClusterSetFabricResponseCallbackBridge(responseHandler, [self callbackQueue]); if (!onSuccess) { responseHandler([CHIPError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE], nil); return; @@ -8513,7 +8511,7 @@ - (void)removeFabric:(uint64_t)fabricId __block CHIP_ERROR err; dispatch_sync([self chipWorkQueue], ^{ - err = self.cppCluster.RemoveFabric(onSuccess->Cancel(), onFailure->Cancel(), fabricId, nodeId, vendorId); + err = self.cppCluster.SetFabric(onSuccess->Cancel(), onFailure->Cancel(), vendorId); }); if (err != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp index 01f14340b6428e..29e43f123a3708 100644 --- a/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp +++ b/src/darwin/Framework/CHIP/gen/IMClusterCommandHandler.cpp @@ -3546,7 +3546,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En { switch (aCommandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. @@ -3601,7 +3601,7 @@ void DispatchClientCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(apCommandObj, FabricId); + emberAfOperationalCredentialsClusterSetFabricResponseCallback(apCommandObj, FabricId); } else { diff --git a/src/darwin/Framework/CHIP/gen/af-structs.h b/src/darwin/Framework/CHIP/gen/af-structs.h index dcb11498a758e3..c3424e2bef061a 100644 --- a/src/darwin/Framework/CHIP/gen/af-structs.h +++ b/src/darwin/Framework/CHIP/gen/af-structs.h @@ -218,7 +218,6 @@ typedef struct _FabricDescriptor { chip::FabricId FabricId; uint16_t VendorId; - chip::ByteSpan Label; chip::NodeId NodeId; } EmberAfFabricDescriptor; diff --git a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp index a0a60ecc16014e..528004b21d3371 100644 --- a/src/darwin/Framework/CHIP/gen/call-command-handler.cpp +++ b/src/darwin/Framework/CHIP/gen/call-command-handler.cpp @@ -1096,7 +1096,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus { switch (cmd->commandId) { - case ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID: { + case ZCL_SET_FABRIC_RESPONSE_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; chip::FabricId FabricId; @@ -1106,7 +1106,7 @@ EmberAfStatus emberAfOperationalCredentialsClusterClientCommandParse(EmberAfClus } FabricId = emberAfGetInt64u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(nullptr, FabricId); + wasHandled = emberAfOperationalCredentialsClusterSetFabricResponseCallback(nullptr, FabricId); break; } default: { diff --git a/src/darwin/Framework/CHIP/gen/callback.h b/src/darwin/Framework/CHIP/gen/callback.h index debe93200a0140..21d3137f28947f 100644 --- a/src/darwin/Framework/CHIP/gen/callback.h +++ b/src/darwin/Framework/CHIP/gen/callback.h @@ -2110,11 +2110,11 @@ bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkResponseCallback(chip::a uint8_t * debugText); /** - * @brief Operational Credentials Cluster GetFabricIdResponse Command callback + * @brief Operational Credentials Cluster SetFabricResponse Command callback * @param fabricId */ -bool emberAfOperationalCredentialsClusterGetFabricIdResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); +bool emberAfOperationalCredentialsClusterSetFabricResponseCallback(chip::app::Command * commandObj, chip::FabricId FabricId); /** * @brief Scenes Cluster AddSceneResponse Command callback diff --git a/src/darwin/Framework/CHIP/gen/client-command-macro.h b/src/darwin/Framework/CHIP/gen/client-command-macro.h index c8666bc5678d12..1ac6d9550498d1 100644 --- a/src/darwin/Framework/CHIP/gen/client-command-macro.h +++ b/src/darwin/Framework/CHIP/gen/client-command-macro.h @@ -2197,25 +2197,25 @@ \ ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID, "u", timeoutMs); -/** @brief Command description for GetFabricId +/** @brief Command description for SetFabric * - * Command: GetFabricId + * Command: SetFabric + * @param VendorId INT16U */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricId() emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabric(VendorId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_COMMAND_ID, "", ); + ZCL_SET_FABRIC_COMMAND_ID, "u", VendorId); -/** @brief Command description for GetFabricIdResponse +/** @brief Command description for SetFabricResponse * - * Command: GetFabricIdResponse + * Command: SetFabricResponse * @param FabricId FABRIC_ID */ #define emberAfFillCommandOperational \ - CredentialsClusterGetFabricIdResponse(FabricId) \ - emberAfFillExternalBuffer(mask, \ + CredentialsClusterSetFabricResponse(FabricId) emberAfFillExternalBuffer(mask, \ \ - ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID, "u", FabricId); + ZCL_SET_FABRIC_RESPONSE_COMMAND_ID, "u", FabricId); /** @brief Command description for UpdateFabricLabel * diff --git a/src/darwin/Framework/CHIP/gen/command-id.h b/src/darwin/Framework/CHIP/gen/command-id.h index 8e97e911e0a423..cbda27333416da 100644 --- a/src/darwin/Framework/CHIP/gen/command-id.h +++ b/src/darwin/Framework/CHIP/gen/command-id.h @@ -266,8 +266,8 @@ #define ZCL_GET_LAST_NETWORK_COMMISSIONING_RESULT_COMMAND_ID (0x10) // Commands for cluster: Operational Credentials -#define ZCL_GET_FABRIC_ID_COMMAND_ID (0x00) -#define ZCL_GET_FABRIC_ID_RESPONSE_COMMAND_ID (0x01) +#define ZCL_SET_FABRIC_COMMAND_ID (0x00) +#define ZCL_SET_FABRIC_RESPONSE_COMMAND_ID (0x01) #define ZCL_UPDATE_FABRIC_LABEL_COMMAND_ID (0x09) #define ZCL_REMOVE_FABRIC_COMMAND_ID (0x0A) diff --git a/src/darwin/Framework/CHIP/gen/endpoint_config.h b/src/darwin/Framework/CHIP/gen/endpoint_config.h index 64db0994ccd3a9..aefcc4b9237a23 100644 --- a/src/darwin/Framework/CHIP/gen/endpoint_config.h +++ b/src/darwin/Framework/CHIP/gen/endpoint_config.h @@ -346,8 +346,8 @@ { 0x0031, 0x10, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetLastNetworkCommissioningResult */ \ \ /* Endpoint: 1, Cluster: Operational Credentials (client) */ \ - { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* GetFabricId */ \ - { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* GetFabricIdResponse */ \ + { 0x003E, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* SetFabric */ \ + { 0x003E, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* SetFabricResponse */ \ { 0x003E, 0x09, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* UpdateFabricLabel */ \ { 0x003E, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* RemoveFabric */ \ \ diff --git a/src/lib/core/CHIPPersistentStorageDelegate.h b/src/lib/core/CHIPPersistentStorageDelegate.h index 54079c8798b98c..afde29c9457f06 100644 --- a/src/lib/core/CHIPPersistentStorageDelegate.h +++ b/src/lib/core/CHIPPersistentStorageDelegate.h @@ -126,6 +126,14 @@ class DLL_EXPORT PersistentStorageDelegate */ virtual CHIP_ERROR SyncSetKeyValue(const char * key, const void * value, uint16_t size) { return CHIP_ERROR_NOT_IMPLEMENTED; } + /** + * @brief + * Deletes the value for the key + * + * @param[in] key Key to be deleted + */ + virtual CHIP_ERROR SyncDeleteKeyValue(const char * key) { return CHIP_ERROR_NOT_IMPLEMENTED; } + /** * @brief * Deletes the value for the key diff --git a/src/lib/core/PeerId.h b/src/lib/core/PeerId.h index a227bdf6b90c0f..d8d95b13d3ead1 100644 --- a/src/lib/core/PeerId.h +++ b/src/lib/core/PeerId.h @@ -27,6 +27,7 @@ constexpr NodeId kUndefinedNodeId = 0ULL; constexpr NodeId kAnyNodeId = 0xFFFFFFFFFFFFFFFFULL; constexpr FabricId kUndefinedFabricId = 0ULL; +constexpr uint16_t kUndefinedVendorId = 0U; /// A peer is identified by a node id within a fabric class PeerId diff --git a/src/messaging/ExchangeContext.h b/src/messaging/ExchangeContext.h index 427899ba309a9e..d0f3943f8ad5fe 100644 --- a/src/messaging/ExchangeContext.h +++ b/src/messaging/ExchangeContext.h @@ -137,7 +137,7 @@ class DLL_EXPORT ExchangeContext : public ReliableMessageContext, { if (mExchangeACL == nullptr) { - Transport::AdminPairingInfo * admin = table.FindAdmin(mSecureSession.GetAdminId()); + Transport::AdminPairingInfo * admin = table.FindAdminWithId(mSecureSession.GetAdminId()); if (admin != nullptr) { mExchangeACL = chip::Platform::New(admin); diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index 368812de4043cb..cb5f492000a6f8 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -224,6 +224,9 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const UnsolicitedMessageHandler * matchingUMH = nullptr; bool sendAckAndCloseExchange = false; + ChipLogProgress(ExchangeManager, "Received message of type %d and protocolId %d", payloadHeader.GetMessageType(), + payloadHeader.GetProtocolID()); + // Search for an existing exchange that the message applies to. If a match is found... for (auto & ec : mContextPool) { diff --git a/src/transport/AdminPairingTable.cpp b/src/transport/AdminPairingTable.cpp index 6a618341d84fe2..24a63897395e2f 100644 --- a/src/transport/AdminPairingTable.cpp +++ b/src/transport/AdminPairingTable.cpp @@ -25,21 +25,32 @@ #include namespace chip { + namespace Transport { -CHIP_ERROR AdminPairingInfo::StoreIntoKVS(PersistentStorageDelegate & kvs) +CHIP_ERROR AdminPairingInfo::StoreIntoKVS(PersistentStorageDelegate * kvs) { + CHIP_ERROR err = CHIP_NO_ERROR; + char key[KeySize()]; ReturnErrorOnFailure(GenerateKey(mAdmin, key, sizeof(key))); StorableAdminPairingInfo info; - info.mNodeId = Encoding::LittleEndian::HostSwap64(mNodeId); - info.mAdmin = Encoding::LittleEndian::HostSwap16(mAdmin); + info.mNodeId = Encoding::LittleEndian::HostSwap64(mNodeId); + info.mAdmin = Encoding::LittleEndian::HostSwap16(mAdmin); + info.mFabricId = Encoding::LittleEndian::HostSwap64(mFabricId); + info.mVendorId = Encoding::LittleEndian::HostSwap16(mVendorId); + + err = kvs->SyncSetKeyValue(key, &info, sizeof(info)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Error occurred calling SyncSetKeyValue."); + } - return kvs.SyncSetKeyValue(key, &info, sizeof(info)); + return err; } -CHIP_ERROR AdminPairingInfo::FetchFromKVS(PersistentStorageDelegate & kvs) +CHIP_ERROR AdminPairingInfo::FetchFromKVS(PersistentStorageDelegate * kvs) { char key[KeySize()]; ReturnErrorOnFailure(GenerateKey(mAdmin, key, sizeof(key))); @@ -47,22 +58,30 @@ CHIP_ERROR AdminPairingInfo::FetchFromKVS(PersistentStorageDelegate & kvs) StorableAdminPairingInfo info; uint16_t size = sizeof(info); - ReturnErrorOnFailure(kvs.SyncGetKeyValue(key, &info, size)); + ReturnErrorOnFailure(kvs->SyncGetKeyValue(key, &info, size)); mNodeId = Encoding::LittleEndian::HostSwap64(info.mNodeId); AdminId id = Encoding::LittleEndian::HostSwap16(info.mAdmin); + mFabricId = Encoding::LittleEndian::HostSwap64(info.mFabricId); + mVendorId = Encoding::LittleEndian::HostSwap16(info.mVendorId); ReturnErrorCodeIf(mAdmin != id, CHIP_ERROR_INCORRECT_STATE); return CHIP_NO_ERROR; } -CHIP_ERROR AdminPairingInfo::DeleteFromKVS(PersistentStorageDelegate & kvs, AdminId id) +CHIP_ERROR AdminPairingInfo::DeleteFromKVS(PersistentStorageDelegate * kvs, AdminId id) { + CHIP_ERROR err = CHIP_NO_ERROR; + char key[KeySize()]; ReturnErrorOnFailure(GenerateKey(id, key, sizeof(key))); - kvs.AsyncDeleteKeyValue(key); - return CHIP_NO_ERROR; + err = kvs->SyncDeleteKeyValue(key); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Discovery, "Error occurred calling SyncDeleteKeyValue"); + } + return err; } constexpr size_t AdminPairingInfo::KeySize() @@ -108,21 +127,46 @@ AdminPairingInfo * AdminPairingTable::AssignAdminId(AdminId adminId, NodeId node void AdminPairingTable::ReleaseAdminId(AdminId adminId) { - AdminPairingInfo * admin = FindAdmin(adminId); + AdminPairingInfo * admin = FindAdminWithId(adminId); if (admin != nullptr) { admin->Reset(); } } -AdminPairingInfo * AdminPairingTable::FindAdmin(AdminId adminId) +AdminPairingInfo * AdminPairingTable::FindAdminWithId(AdminId adminId) { - for (size_t i = 0; i < CHIP_CONFIG_MAX_DEVICE_ADMINS; i++) + for (auto & state : mStates) { - if (mStates[i].IsInitialized() && mStates[i].GetAdminId() == adminId) + if (state.IsInitialized() && state.GetAdminId() == adminId) { - return &mStates[i]; + return &state; + } + } + + return nullptr; +} + +AdminPairingInfo * AdminPairingTable::FindAdminForNode(FabricId fabricId, NodeId nodeId, uint16_t vendorId) +{ + uint32_t index = 0; + for (auto & state : mStates) + { + if (state.IsInitialized()) + { + ChipLogProgress(Discovery, + "Looking at index %d with fabricID %llu nodeID %llu vendorId %d to see if it matches fabricId %llu " + "nodeId %llu vendorId %d.", + index, state.GetFabricId(), state.GetNodeId(), state.GetVendorId(), fabricId, nodeId, vendorId); + } + if (state.IsInitialized() && state.GetFabricId() == fabricId && + (nodeId == kUndefinedNodeId || state.GetNodeId() == nodeId) && + (vendorId == kUndefinedVendorId || state.GetVendorId() == vendorId)) + { + ChipLogProgress(Discovery, "Found a match!"); + return &state; } + index++; } return nullptr; @@ -136,5 +180,94 @@ void AdminPairingTable::Reset() } } +CHIP_ERROR AdminPairingTable::Store(AdminId id) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + AdminPairingInfo * admin = nullptr; + + VerifyOrExit(mStorage != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); + + admin = FindAdminWithId(id); + VerifyOrExit(admin != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); + + err = admin->StoreIntoKVS(mStorage); +exit: + if (err == CHIP_NO_ERROR && mDelegate != nullptr) + { + ChipLogProgress(Discovery, "Admin (%d) persisted to storage. Calling OnAdminPersistedToStorage.", id); + mDelegate->OnAdminPersistedToStorage(admin); + } + return err; +} + +CHIP_ERROR AdminPairingTable::LoadFromStorage(AdminId id) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + AdminPairingInfo * admin = nullptr; + bool didCreateAdmin = false; + VerifyOrExit(mStorage != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); + + admin = FindAdminWithId(id); + if (admin == nullptr) + { + admin = AssignAdminId(id); + didCreateAdmin = true; + } + VerifyOrExit(admin != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); + err = admin->FetchFromKVS(mStorage); + +exit: + if (err != CHIP_NO_ERROR && didCreateAdmin) + { + ReleaseAdminId(id); + } + else if (err == CHIP_NO_ERROR && mDelegate != nullptr) + { + ChipLogProgress(Discovery, "Admin (%d) loaded from storage. Calling OnAdminRetrievedFromStorage.", id); + mDelegate->OnAdminRetrievedFromStorage(admin); + } + return err; +} + +CHIP_ERROR AdminPairingTable::Delete(AdminId id) +{ + AdminPairingInfo * admin = nullptr; + CHIP_ERROR err = CHIP_NO_ERROR; + bool adminIsInitialized = false; + VerifyOrExit(mStorage != nullptr, err = CHIP_ERROR_INVALID_ARGUMENT); + + admin = FindAdminWithId(id); + adminIsInitialized = admin != nullptr && admin->IsInitialized(); + err = AdminPairingInfo::DeleteFromKVS(mStorage, id); // Delete from storage regardless + +exit: + if (err == CHIP_NO_ERROR) + { + ReleaseAdminId(id); + if (mDelegate != nullptr && adminIsInitialized) + { + ChipLogProgress(Discovery, "Admin (%d) deleted. Calling OnAdminDeletedFromStorage.", id); + mDelegate->OnAdminDeletedFromStorage(id); + } + } + return CHIP_NO_ERROR; +} + +CHIP_ERROR AdminPairingTable::Init(PersistentStorageDelegate * storage) +{ + VerifyOrReturnError(storage != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + mStorage = storage; + ChipLogProgress(Discovery, "Init admin pairing table with server storage."); + return CHIP_NO_ERROR; +} + +CHIP_ERROR AdminPairingTable::SetAdminPairingDelegate(AdminPairingTableDelegate * delegate) +{ + VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + mDelegate = delegate; + ChipLogProgress(Discovery, "Set the admin pairing table delegate"); + return CHIP_NO_ERROR; +} + } // namespace Transport } // namespace chip diff --git a/src/transport/AdminPairingTable.h b/src/transport/AdminPairingTable.h index 41ce4be09433f3..fb0b467f42d067 100644 --- a/src/transport/AdminPairingTable.h +++ b/src/transport/AdminPairingTable.h @@ -21,6 +21,7 @@ #pragma once +#include #include #include #include @@ -54,6 +55,8 @@ struct AccessControlList * Information contained within the state: * - Admin identification * - Node Id assigned by the admin to the device + * - Vendor Id + * - Fabric Id * - Device operational credentials * - Access control list */ @@ -65,9 +68,15 @@ class DLL_EXPORT AdminPairingInfo NodeId GetNodeId() const { return mNodeId; } void SetNodeId(NodeId nodeId) { mNodeId = nodeId; } + FabricId GetFabricId() const { return mFabricId; } + void SetFabricId(FabricId fabricId) { mFabricId = fabricId; } + AdminId GetAdminId() const { return mAdmin; } void SetAdminId(AdminId adminId) { mAdmin = adminId; } + uint16_t GetVendorId() const { return mVendorId; } + void SetVendorId(uint16_t vendorId) { mVendorId = vendorId; } + const OperationalCredentials & GetOperationalCreds() const { return mOpCred; } OperationalCredentials & GetOperationalCreds() { return mOpCred; } void SetOperationalCreds(const OperationalCredentials & creds) { mOpCred = creds; } @@ -83,19 +92,19 @@ class DLL_EXPORT AdminPairingInfo */ void Reset() { - mNodeId = kUndefinedNodeId; - mAdmin = kUndefinedAdminId; + mNodeId = kUndefinedNodeId; + mAdmin = kUndefinedAdminId; + mFabricId = kUndefinedFabricId; + mVendorId = kUndefinedVendorId; } - CHIP_ERROR StoreIntoKVS(PersistentStorageDelegate & kvs); - - CHIP_ERROR FetchFromKVS(PersistentStorageDelegate & kvs); - - static CHIP_ERROR DeleteFromKVS(PersistentStorageDelegate & kvs, AdminId id); + friend class AdminPairingTable; private: - AdminId mAdmin = kUndefinedAdminId; - NodeId mNodeId = kUndefinedNodeId; + AdminId mAdmin = kUndefinedAdminId; + NodeId mNodeId = kUndefinedNodeId; + FabricId mFabricId = kUndefinedFabricId; + uint16_t mVendorId = kUndefinedVendorId; OperationalCredentials mOpCred; AccessControlList mACL; @@ -104,13 +113,42 @@ class DLL_EXPORT AdminPairingInfo static CHIP_ERROR GenerateKey(AdminId id, char * key, size_t len); + CHIP_ERROR StoreIntoKVS(PersistentStorageDelegate * kvs); + CHIP_ERROR FetchFromKVS(PersistentStorageDelegate * kvs); + static CHIP_ERROR DeleteFromKVS(PersistentStorageDelegate * kvs, AdminId id); + struct StorableAdminPairingInfo { - uint16_t mAdmin; /* This field is serialized in LittleEndian byte order */ - uint64_t mNodeId; /* This field is serialized in LittleEndian byte order */ + uint16_t mAdmin; /* This field is serialized in LittleEndian byte order */ + uint64_t mNodeId; /* This field is serialized in LittleEndian byte order */ + uint64_t mFabricId; /* This field is serialized in LittleEndian byte order */ + uint16_t mVendorId; /* This field is serialized in LittleEndian byte order */ }; }; +// Once attribute store has persistence implemented, AdminPairingTable shoud be backed using +// attribute store so no need for this Delegate API anymore +// TODO: Reimplement AdminPairingTable to only have one backing store. +class DLL_EXPORT AdminPairingTableDelegate +{ +public: + virtual ~AdminPairingTableDelegate() {} + /** + * Gets called when an admin is deleted from KVS store. + **/ + virtual void OnAdminDeletedFromStorage(AdminId adminId) = 0; + + /** + * Gets called when an admin is loaded into Admin Pairing Table from KVS store. + **/ + virtual void OnAdminRetrievedFromStorage(AdminPairingInfo * adminInfo) = 0; + + /** + * Gets called when an admin in Admin Pairing Table is persisted to KVS store. + **/ + virtual void OnAdminPersistedToStorage(AdminPairingInfo * adminInfo) = 0; +}; + /** * Iterates over valid admins within a list */ @@ -182,16 +220,26 @@ class ConstAdminIterator class DLL_EXPORT AdminPairingTable { public: + CHIP_ERROR Store(AdminId id); + CHIP_ERROR LoadFromStorage(AdminId id); + CHIP_ERROR Delete(AdminId id); + AdminPairingInfo * AssignAdminId(AdminId adminId); AdminPairingInfo * AssignAdminId(AdminId adminId, NodeId nodeId); void ReleaseAdminId(AdminId adminId); - AdminPairingInfo * FindAdmin(AdminId adminId); + AdminPairingInfo * FindAdminWithId(AdminId adminId); + + AdminPairingInfo * FindAdminForNode(FabricId fabricId, NodeId nodeId = kUndefinedNodeId, + uint16_t vendorId = kUndefinedVendorId); void Reset(); + CHIP_ERROR Init(PersistentStorageDelegate * storage); + CHIP_ERROR SetAdminPairingDelegate(AdminPairingTableDelegate * delegate); + ConstAdminIterator cbegin() const { return ConstAdminIterator(mStates, 0, CHIP_CONFIG_MAX_DEVICE_ADMINS); } ConstAdminIterator cend() const { @@ -202,6 +250,10 @@ class DLL_EXPORT AdminPairingTable private: AdminPairingInfo mStates[CHIP_CONFIG_MAX_DEVICE_ADMINS]; + PersistentStorageDelegate * mStorage = nullptr; + + // TODO: Admin Pairing table should be backed by a single backing store (attribute store), remove delegate callbacks #6419 + AdminPairingTableDelegate * mDelegate = nullptr; }; } // namespace Transport diff --git a/src/transport/SecureSessionMgr.cpp b/src/transport/SecureSessionMgr.cpp index 8d8876967e1902..819417f0680741 100644 --- a/src/transport/SecureSessionMgr.cpp +++ b/src/transport/SecureSessionMgr.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -165,7 +166,7 @@ CHIP_ERROR SecureSessionMgr::SendMessage(SecureSessionHandle session, PayloadHea // This marks any connection where we send data to as 'active' mPeerConnections.MarkConnectionActive(state); - admin = mAdmins->FindAdmin(state->GetAdminId()); + admin = mAdmins->FindAdminWithId(state->GetAdminId()); VerifyOrExit(admin != nullptr, err = CHIP_ERROR_INCORRECT_STATE); localNodeId = admin->GetNodeId(); @@ -365,6 +366,10 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, Transport::AdminPairingInfo * admin = nullptr; + bool modifiedAdmin = false; + NodeId localNodeId; + FabricId fabricId; + VerifyOrExit(!msg.IsNull(), ChipLogError(Inet, "Secure transport received NULL packet, discarding")); if (state == nullptr) @@ -373,7 +378,7 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, ExitNow(err = CHIP_ERROR_KEY_NOT_FOUND_FROM_PEER); } - admin = mAdmins->FindAdmin(state->GetAdminId()); + admin = mAdmins->FindAdminWithId(state->GetAdminId()); VerifyOrExit(admin != nullptr, ChipLogError(Inet, "Secure transport received packet for unknown admin (%p, %d) pairing, discarding", state, state->GetAdminId())); @@ -381,8 +386,12 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, { VerifyOrExit( admin->GetNodeId() == packetHeader.GetDestinationNodeId().Value(), - ChipLogError(Inet, "Secure transport received message, but destination node ID doesn't match our node ID, discarding")); + ChipLogError( + Inet, + "Secure transport received message, but destination node ID (%llu) doesn't match our node ID (%llu), discarding", + packetHeader.GetDestinationNodeId().Value(), admin->GetNodeId())); } + ChipLogError(Inet, "Secure transport received message destined to node ID (%llu)", packetHeader.GetDestinationNodeId().Value()); mPeerConnections.MarkConnectionActive(state); if (!packetHeader.IsSecureSessionControlMsg() && !state->IsPeerMsgCounterSynced() && @@ -409,6 +418,10 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, VerifyOrExit(CHIP_NO_ERROR == SecureMessageCodec::Decode(state, payloadHeader, packetHeader, msg), ChipLogError(Inet, "Secure transport received message, but failed to decode it, discarding")); + // See operational-credentials-server.cpp for explanation as to why fabricId is being set to commissioner node id + // This is temporary code until AddOptCert is implemented through which an admin will be correctly added with the correct + // fields. + // TODO: Remove temporary code once AddOptCert is implemented if (packetHeader.GetSourceNodeId().HasValue()) { if (state->GetPeerNodeId() == kUndefinedNodeId) @@ -417,9 +430,35 @@ void SecureSessionMgr::SecureMessageDispatch(const PacketHeader & packetHeader, } } + // TODO: Remove temporary code once AddOptCert is implemented if (packetHeader.GetDestinationNodeId().HasValue()) { - admin->SetNodeId(packetHeader.GetDestinationNodeId().Value()); + localNodeId = packetHeader.GetDestinationNodeId().Value(); + if (localNodeId != kUndefinedNodeId && admin->GetNodeId() != localNodeId) + { + admin->SetNodeId(localNodeId); + ChipLogProgress(Inet, "Setting nodeID %" PRIX64 " on admin.", admin->GetNodeId()); + modifiedAdmin = true; + } + } + + // TODO: Remove temporary code once AddOptCert is implemented + if (packetHeader.GetSourceNodeId().HasValue()) + { + fabricId = packetHeader.GetSourceNodeId().Value(); + if (fabricId != kUndefinedFabricId && admin->GetFabricId() != fabricId) + { + admin->SetFabricId(packetHeader.GetSourceNodeId().Value()); + ChipLogProgress(Inet, "Setting fabricID %" PRIX64 " on admin.", admin->GetFabricId()); + modifiedAdmin = true; + } + } + + // TODO: Remove temporary code once AddOptCert is implemented + if (modifiedAdmin) + { + ChipLogProgress(Inet, "Since admin was modified, persisting changes to KVS"); + mAdmins->Store(admin->GetAdminId()); } // TODO: once mDNS address resolution is available reconsider if this is required From 03dfc8609bffc8d034f6008f32c536040f69c5ca Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 5 May 2021 00:25:13 -0700 Subject: [PATCH 29/31] Revert "Implement Docker best practices - Round 2 (#6388)" (#6479) This reverts commit 4f2c3897e7d30f638f519242cd0dc19c5261d3e5. --- .../images/chip-build-android/Dockerfile | 8 +- .../images/chip-build-cirque/Dockerfile | 35 ++--- .../docker/images/chip-build-efr32/Dockerfile | 13 +- .../images/chip-build-esp32-qemu/Dockerfile | 9 +- .../docker/images/chip-build-esp32/Dockerfile | 13 +- .../docker/images/chip-build-k32w/Dockerfile | 14 +- .../images/chip-build-nrf-platform/Dockerfile | 26 ++-- .../docker/images/chip-build/Dockerfile | 140 +++++++++--------- 8 files changed, 124 insertions(+), 134 deletions(-) diff --git a/integrations/docker/images/chip-build-android/Dockerfile b/integrations/docker/images/chip-build-android/Dockerfile index afd635fdb96709..fc6af8652b4981 100644 --- a/integrations/docker/images/chip-build-android/Dockerfile +++ b/integrations/docker/images/chip-build-android/Dockerfile @@ -6,10 +6,10 @@ FROM connectedhomeip/chip-build:${VERSION} # doesn't work with JDK 11. RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - openjdk-8-jdk=8u292-b10-0ubuntu1~20.04 \ - rsync=3.1.3-8 \ - swig=4.0.1-5build1 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + openjdk-8-jdk \ + rsync \ + swig \ && rm -rf /var/lib/apt/lists/ \ && : # last line diff --git a/integrations/docker/images/chip-build-cirque/Dockerfile b/integrations/docker/images/chip-build-cirque/Dockerfile index e8954de74b38f8..d5ce966f4c3c5e 100644 --- a/integrations/docker/images/chip-build-cirque/Dockerfile +++ b/integrations/docker/images/chip-build-cirque/Dockerfile @@ -1,47 +1,44 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} -SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Bazel RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - curl=7.68.0-1ubuntu2.5 gnupg=2.2.19-3ubuntu2.1 \ - && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/bazel.gpg \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + curl gnupg \ + && curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg \ + && mv bazel.gpg /etc/apt/trusted.gpg.d/ \ && echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - bazel=4.0.0 \ - && rm -rf /var/lib/apt/lists/ \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + bazel \ && : # aids diffs # Docker RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - curl=7.68.0-1ubuntu2.5 gnupg-agent=2.2.19-3ubuntu2.1 apt-transport-https=2.0.5 ca-certificates=20210119~20.04.1 \ - software-properties-common=0.98.9.4 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + curl gnupg-agent apt-transport-https ca-certificates \ + software-properties-common \ && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ && add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - docker-ce=5:20.10.6~3-0~ubuntu-focal docker-ce-cli=5:20.10.6~3-0~ubuntu-focal containerd.io=1.4.4-1 \ - && rm -rf /var/lib/apt/lists/ \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + docker-ce docker-ce-cli containerd.io \ && : # aids diffs # Other Cirque prereqs RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - sudo=1.8.31-1ubuntu1.2 socat=1.7.3.3-2 psmisc=23.3-1 tigervnc-standalone-server=1.10.1+dfsg-3 tigervnc-viewer=1.10.1+dfsg-3 \ - python3-pip=20.0.2-5ubuntu1.3 python3-venv=3.8.2-0ubuntu2 python3-setuptools=45.2.0-1 libdbus-glib-1-dev=0.110-5fakssync1 \ - uuid-runtime=2.34-0.1ubuntu9.1 libgirepository1.0-dev=1.64.1-1~ubuntu20.04.1 \ - && rm -rf /var/lib/apt/lists/ \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + sudo socat psmisc tigervnc-standalone-server tigervnc-viewer \ + python3-pip python3-venv python3-setuptools libdbus-glib-1-dev \ + uuid-runtime libgirepository1.0-dev \ && : # aids diffs COPY requirements_nogrpc.txt /requirements.txt RUN set -x \ - && pip3 install --no-cache-dir -r requirements.txt \ + && pip3 install -r requirements.txt \ && : # aids diffs diff --git a/integrations/docker/images/chip-build-efr32/Dockerfile b/integrations/docker/images/chip-build-efr32/Dockerfile index 08535750735b7b..b744e687a73c1d 100644 --- a/integrations/docker/images/chip-build-efr32/Dockerfile +++ b/integrations/docker/images/chip-build-efr32/Dockerfile @@ -1,12 +1,13 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} + + + # GNU ARM Embedded toolchain, cross compiler for various platform builds RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - gcc-arm-none-eabi=15:9-2019-q4-0ubuntu1 \ - binutils-arm-none-eabi=2.34-4ubuntu1+13ubuntu1 \ - ccache=3.7.7-1 \ - && rm -rf /var/lib/apt/lists/ \ - && : # last line + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + gcc-arm-none-eabi \ + binutils-arm-none-eabi \ + ccache diff --git a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile index 716b7c8272cad2..6c7b0e523e1ad3 100644 --- a/integrations/docker/images/chip-build-esp32-qemu/Dockerfile +++ b/integrations/docker/images/chip-build-esp32-qemu/Dockerfile @@ -1,13 +1,14 @@ ARG VERSION=latest FROM connectedhomeip/chip-build-esp32:${VERSION} -WORKDIR /opt/espressif/qemu - # Setup QEMU emulator for ESP32 platform RUN set -x \ - && git clone --depth 1 --branch esp-develop-20210220 https://github.com/espressif/qemu.git /opt/espressif/qemu-src \ + && mkdir -p /opt/espressif \ + && git clone --progress --depth 1 --branch esp-develop-20210220 https://github.com/espressif/qemu.git /opt/espressif/qemu-src \ + && mkdir -p /opt/espressif/qemu \ + && (cd /opt/espressif/qemu \ && ../qemu-src/configure --target-list=xtensa-softmmu --enable-debug --enable-sanitizers --disable-strip --disable-user --disable-capstone --disable-vnc --disable-sdl --disable-gtk \ - && make -j8 \ + && make -j8) \ && : # last line ENV QEMU_ESP32_DIR=/opt/espressif/qemu diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index efb50ee5ae54b3..2894fa72a2aba9 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -1,17 +1,16 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} -WORKDIR /opt/espressif/esp-idf - # Setup the ESP-IDF RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - python-is-python2=2.7.17-4 libgcrypt20-dev=1.8.5-5ubuntu1 \ - && git clone --depth=1 -b release/v4.2 https://github.com/espressif/esp-idf.git /opt/espressif/esp-idf \ - && git submodule update --init \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y python libgcrypt20-dev \ + && mkdir -p /opt/espressif \ + && cd /opt/espressif \ + && git clone --progress -b release/v4.2 https://github.com/espressif/esp-idf.git \ + && cd esp-idf \ + && git submodule update --init --progress \ && IDF_TOOLS_PATH=/opt/espressif/tools ./install.sh \ - && rm -rf /var/lib/apt/lists/ \ && : # last line ENV IDF_PATH=/opt/espressif/esp-idf/ diff --git a/integrations/docker/images/chip-build-k32w/Dockerfile b/integrations/docker/images/chip-build-k32w/Dockerfile index 08a87737d38e70..d558f2c5cd3c56 100644 --- a/integrations/docker/images/chip-build-k32w/Dockerfile +++ b/integrations/docker/images/chip-build-k32w/Dockerfile @@ -1,19 +1,19 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} -WORKDIR /opt/sdk - # Setup the K32W SDK RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - wget=1.20.3-1ubuntu1 unzip=6.0-25ubuntu1 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y wget unzip \ && rm -rf /var/lib/apt/lists/ \ + && mkdir -p /opt/sdk \ + && cd /opt/sdk \ && wget https://mcuxpresso.nxp.com/eclipse/sdk/2.6.3/plugins/com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ && unzip com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ - && unzip sdks/5faab205f2663647c5c7ce05c382d2a8.zip -d sdks/ \ - && rm -f com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ - && rm -f sdk/5faab205f2663647c5c7ce05c382d2a8.zip \ + && rm -rf com.nxp.mcuxpresso.sdk.sdk_2.x_k32w061dk6_2.6.3.201911251446.jar \ + && cd sdks \ + && unzip 5faab205f2663647c5c7ce05c382d2a8.zip \ + && rm -rf 5faab205f2663647c5c7ce05c382d2a8.zip \ && : # last line ENV K32W061_SDK_ROOT=/opt/sdk/sdks diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index a8390bd528dd90..5d93841fc05fa4 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -8,19 +8,17 @@ ARG NCS_REVISION=v1.5.0 # nRF Connect SDK dependencies # ================================================== -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -WORKDIR /opt/NordicSemiconductor/nRF5_tools/install - # Tools for building, flashing and accessing device logs RUN set -x \ && apt-get update \ - && apt-get install --no-install-recommends -fy device-tree-compiler=1.5.1-1 \ + && apt-get install --no-install-recommends -fy device-tree-compiler \ + && (mkdir -p /opt/NordicSemiconductor/nRF5_tools/install && cd /opt/NordicSemiconductor/nRF5_tools/install \ && curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-12-1/nRFCommandLineTools10121Linuxamd64.tar.gz \ | tar zxvf - \ - && tar xvf JLink_Linux_V688a_x86_64.tgz -C /opt/NordicSemiconductor/nRF5_tools/ \ - && tar xvf nRF-Command-Line-Tools_10_12_1.tar -C /opt/NordicSemiconductor/nRF5_tools/ \ - && rm -rf ./install /var/lib/apt/lists/ \ + && cd .. \ + && tar xvf install/JLink_Linux_V688a_x86_64.tgz \ + && tar xvf install/nRF-Command-Line-Tools_10_12_1.tar \ + && rm -rf ./install /var/lib/apt/lists/) \ && : # last line ENV NRF5_TOOLS_ROOT=/opt/NordicSemiconductor/nRF5_tools @@ -28,28 +26,26 @@ ENV PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V688a_x86_64:${PATH} ENV PATH=${NRF5_TOOLS_ROOT}/mergehex:${NRF5_TOOLS_ROOT}/nrfjprog:${PATH} ENV LD_LIBRARY_PATH=${NRF5_TOOLS_ROOT}/JLink_Linux_V688a_x86_64:${LD_LIBRARY_PATH} -WORKDIR /opt/ARM-software - # GNU ARM Embedded toolchain, cross compiler for various platform builds RUN set -x \ + && (mkdir -p /opt/ARM-software && cd /opt/ARM-software \ && curl https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 \ - | tar jxvf - \ + | tar jxvf -) \ && : # last line ENV ARM_GCC_INSTALL_ROOT=/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/ -WORKDIR /opt/NordicSemiconductor/nrfconnect - # ================================================== # nRF Connect SDK # ================================================== RUN set -x \ - && python3 -m pip install -U --no-cache-dir pip==21.1 setuptools==56.0.0 wheel==0.36.2 cmake==3.18.4.post1 west==0.10.1 \ + && (mkdir -p /opt/NordicSemiconductor/nrfconnect && cd /opt/NordicSemiconductor/nrfconnect \ + && python3 -m pip install -U --no-cache-dir pip setuptools wheel cmake west \ && west init -m https://github.com/nrfconnect/sdk-nrf --mr $NCS_REVISION \ && west update \ && python3 -m pip install --no-cache-dir -r zephyr/scripts/requirements.txt \ && python3 -m pip install --no-cache-dir -r nrf/scripts/requirements.txt \ - && python3 -m pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt \ + && python3 -m pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt) \ && echo "source /opt/NordicSemiconductor/nrfconnect/zephyr/zephyr-env.sh" >> ~/.bashrc \ && : # last line diff --git a/integrations/docker/images/chip-build/Dockerfile b/integrations/docker/images/chip-build/Dockerfile index 1da02a0d559ebc..56913b71ad862e 100644 --- a/integrations/docker/images/chip-build/Dockerfile +++ b/integrations/docker/images/chip-build/Dockerfile @@ -6,62 +6,61 @@ VOLUME "/var/source" # base build and check tools and libraries layer RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -fy --no-install-recommends \ - autoconf=2.69-11.1 \ - automake=1:1.16.1-4ubuntu6 \ - bison=2:3.5.1+dfsg-1 \ - bridge-utils=1.6-2ubuntu1 \ - clang=1:10.0-50~exp1 \ - clang-format=1:10.0-50~exp1 \ - clang-tidy=1:10.0-50~exp1 \ - curl=7.68.0-1ubuntu2.5 \ - flex=2.6.4-6.2 \ - g++=4:9.3.0-1ubuntu2 \ - git=1:2.25.1-1ubuntu3.1 \ - gperf=3.1-1build1 \ - iproute2=5.5.0-1ubuntu1 \ - jq=1.6-1ubuntu0.20.04.1 \ - lcov=1.14-2 \ - libavahi-client-dev=0.7-4ubuntu7 \ - libavahi-common-dev=0.7-4ubuntu7 \ - libcairo2-dev=1.16.0-4ubuntu1 \ - libdbus-1-dev=1.12.16-2ubuntu2.1 \ - libdbus-glib-1-dev=0.110-5fakssync1 \ - libgif-dev=5.1.9-1 \ - libglib2.0-dev=2.64.6-1~ubuntu20.04.3 \ - libical-dev=3.0.8-1 \ - libjpeg-dev=8c-2ubuntu8 \ - libdmalloc-dev=5.5.2-14build1 \ - libmbedtls-dev=2.16.4-1ubuntu2 \ - libncurses5-dev=6.2-0ubuntu2 \ - libncursesw5-dev=6.2-0ubuntu2 \ - libnspr4-dev=2:4.25-1 \ - libpango1.0-dev=1.44.7-2ubuntu4 \ - libpixman-1-dev=0.38.4-0ubuntu1 \ - libreadline-dev=8.0-4 \ - libssl-dev=1.1.1f-1ubuntu2.3 \ - libtool=2.4.6-14 \ - libudev-dev=245.4-4ubuntu3.6 \ - libusb-1.0-0=2:1.0.23-2build1 \ - libusb-dev=2:0.1.12-32 \ - libxml2-dev=2.9.10+dfsg-5 \ - make=4.2.1-1.2 \ - net-tools=1.60+git20180626.aebd88e-1ubuntu1 \ - ninja-build=1.10.0-1build1 \ - openjdk-8-jdk=8u292-b10-0ubuntu1~20.04 \ - pkg-config=0.29.1-0ubuntu4 \ - python3=3.8.2-0ubuntu2 \ - python3-dev=3.8.2-0ubuntu2 \ - python3-pip=20.0.2-5ubuntu1.3 \ - python3-venv=3.8.2-0ubuntu2 \ - shellcheck=0.7.0-2build2 \ - strace=5.5-3ubuntu1 \ - systemd=245.4-4ubuntu3.6 \ - udev=245.4-4ubuntu3.6 \ - unzip=6.0-25ubuntu1 \ - wget=1.20.3-1ubuntu1 \ - xz-utils=5.2.4-1ubuntu1 \ - zlib1g-dev=1:1.2.11.dfsg-2ubuntu1.2 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ + autoconf \ + automake \ + bison \ + bridge-utils \ + clang \ + clang-format \ + clang-tidy \ + curl \ + flex \ + g++ \ + git \ + gperf \ + iproute2 \ + jq \ + lcov \ + libavahi-client-dev \ + libavahi-common-dev \ + libcairo2-dev \ + libdbus-1-dev \ + libdbus-glib-1-dev \ + libgif-dev \ + libglib2.0-dev \ + libical-dev \ + libjpeg-dev \ + libdmalloc-dev \ + libmbedtls-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libnspr4-dev \ + libpango1.0-dev \ + libpixman-1-dev \ + libreadline-dev \ + libssl-dev \ + libtool \ + libudev-dev \ + libusb-1.0-0 \ + libusb-dev \ + libxml2-dev \ + make \ + net-tools \ + ninja-build \ + openjdk-8-jdk \ + pkg-config \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + shellcheck \ + strace \ + systemd \ + udev \ + unzip \ + wget \ + zlib1g-dev \ && rm -rf /var/lib/apt/lists/ \ && : # last line @@ -77,24 +76,17 @@ RUN set -x \ # Python 2 and PIP RUN set -x \ && apt-get update \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common=0.98.9.4 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \ && add-apt-repository universe \ - && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python2=2.7.17-2ubuntu4 \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y python python2 \ && curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py \ && python2 get-pip.py \ && rm -rf /var/lib/apt/lists/ \ && : # last line RUN set -x \ - && pip3 install --no-cache-dir \ - circleci==1.2.2 \ - attrs==20.3.0 \ - coloredlogs==15.0 \ - PyGithub==1.55 \ - pygit==0.1 \ - future==0.18.2 \ - portpicker==1.3.1 \ - mobly==1.10.1 \ + && pip3 install circleci attrs coloredlogs PyGithub pygit future \ + portpicker mobly \ && : # last line # build and install gn @@ -110,7 +102,7 @@ RUN set -x \ # Install bloat comparison tools RUN set -x \ - && git clone --depth=1 https://github.com/google/bloaty.git \ + && git clone https://github.com/google/bloaty.git \ && mkdir -p bloaty/build \ && cd bloaty/build \ && cmake ../ \ @@ -123,9 +115,13 @@ RUN set -x \ # NodeJS: install a newer version than what apt-get would read # This installs the latest LTS version of nodejs RUN set -x \ - && curl -o node.tgz -s https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ - && mkdir -p /opt/node \ - && tar xfJ node.tgz --strip-components=1 -C /opt/node \ + && mkdir node_js \ + && cd node_js \ + && wget https://nodejs.org/dist/v12.19.0/node-v12.19.0-linux-x64.tar.xz \ + && tar xfvJ node-v12.19.0-linux-x64.tar.xz \ + && mv node-v12.19.0-linux-x64 /opt/ \ + && ln -s /opt/node-v12.19.0-linux-x64 /opt/node \ && ln -s /opt/node/bin/* /usr/bin \ - && rm -f node.tgz \ + && cd .. \ + && rm -rf node_js \ && : # last line From 6a047915231bb78325fce8e2efa8cb4d4c87fa24 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Wed, 5 May 2021 00:47:20 -0700 Subject: [PATCH 30/31] Disabling this --- .github/workflows/cirque.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index efe59fa442289b..6401e8b4972aec 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -14,9 +14,7 @@ name: Cirque -on: - push: - pull_request: +on: workflow_dispatch jobs: cirque: From ea5b53b598d55f1fb32b2dca7c3a6e32ab924bdc Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 5 May 2021 11:18:17 +0200 Subject: [PATCH 31/31] Update tv-app gen folder for tests bustage (#6483) --- .../tv-common/gen/IMClusterCommandHandler.cpp | 884 +++++++++--------- .../tv-common/gen/call-command-handler.cpp | 358 +++---- examples/tv-app/tv-common/gen/callback.h | 107 ++- 3 files changed, 695 insertions(+), 654 deletions(-) diff --git a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp index 91e32e45e3e18c..5534388176fb7f 100644 --- a/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp +++ b/examples/tv-app/tv-common/gen/IMClusterCommandHandler.cpp @@ -213,6 +213,111 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace AccountLogin +namespace ApplicationLauncher { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_LAUNCH_APP_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + const uint8_t * data; + bool dataExists = false; + /* TYPE WARNING: array array defaults to */ uint8_t * application; + bool applicationExists = false; + uint32_t validArgumentCount = 0; + + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (dataExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(data); + if (CHIP_NO_ERROR == TLVUnpackError) + { + dataExists = true; + validArgumentCount++; + } + break; + case 1: + if (applicationExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + // Just for compatibility, we will add array type support in IM later. + TLVUnpackError = aDataTlv.GetDataPtr(const_cast(application)); + if (CHIP_NO_ERROR == TLVUnpackError) + { + applicationExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } + + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } + + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfApplicationLauncherClusterLaunchAppCallback(apCommandObj, const_cast(data), application); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 2, validArgumentCount, TLVError, TLVUnpackError); + } + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_APPLICATION_LAUNCHER_CLUSTER_ID); + break; + } + } + } +} + +} // namespace ApplicationLauncher + namespace AudioOutput { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) @@ -816,27 +921,21 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // namespace GeneralCommissioning -namespace LevelControl { +namespace KeypadInput { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_MOVE_COMMAND_ID: { + case ZCL_SEND_KEY_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t moveMode; - bool moveModeExists = false; - uint8_t rate; - bool rateExists = false; - uint8_t optionMask; - bool optionMaskExists = false; - uint8_t optionOverride; - bool optionOverrideExists = false; + uint8_t keyCode; + bool keyCodeExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -844,58 +943,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (moveModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(moveMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - moveModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (rateExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(rate); - if (CHIP_NO_ERROR == TLVUnpackError) - { - rateExists = true; - validArgumentCount++; - } - break; - case 2: - if (optionMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionOverrideExists) + if (keyCodeExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionOverride); + TLVUnpackError = aDataTlv.Get(keyCode); if (CHIP_NO_ERROR == TLVUnpackError) { - optionOverrideExists = true; + keyCodeExists = true; validArgumentCount++; } break; @@ -923,10 +980,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterMoveCallback(apCommandObj, moveMode, rate, optionMask, optionOverride); + emberAfKeypadInputClusterSendKeyCallback(apCommandObj, keyCode); } else { @@ -934,24 +991,72 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_KEYPAD_INPUT_CLUSTER_ID); + break; + } + } + } +} + +} // namespace KeypadInput + +namespace LowPower { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_SLEEP_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfLowPowerClusterSleepCallback(apCommandObj); + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LOW_POWER_CLUSTER_ID); + break; + } + } + } +} + +} // namespace LowPower + +namespace MediaInput { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaInputClusterHideInputStatusCallback(apCommandObj); + break; + } + case ZCL_RENAME_INPUT_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t level; - bool levelExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionMask; - bool optionMaskExists = false; - uint8_t optionOverride; - bool optionOverrideExists = false; + uint8_t index; + bool indexExists = false; + const uint8_t * name; + bool nameExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -959,58 +1064,31 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (levelExists) + if (indexExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(level); + TLVUnpackError = aDataTlv.Get(index); if (CHIP_NO_ERROR == TLVUnpackError) { - levelExists = true; + indexExists = true; validArgumentCount++; } break; case 1: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 2: - if (optionMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionMaskExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionOverrideExists) + if (nameExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionOverride); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(name); if (CHIP_NO_ERROR == TLVUnpackError) { - optionOverrideExists = true; + nameExists = true; validArgumentCount++; } break; @@ -1038,10 +1116,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, level, transitionTime, optionMask, optionOverride); + emberAfMediaInputClusterRenameInputCallback(apCommandObj, index, const_cast(name)); } else { @@ -1049,20 +1127,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 4, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { + case ZCL_SELECT_INPUT_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t level; - bool levelExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; + uint8_t index; + bool indexExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1070,30 +1146,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (levelExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(level); - if (CHIP_NO_ERROR == TLVUnpackError) - { - levelExists = true; - validArgumentCount++; - } - break; - case 1: - if (transitionTimeExists) + if (indexExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(transitionTime); + TLVUnpackError = aDataTlv.Get(index); if (CHIP_NO_ERROR == TLVUnpackError) { - transitionTimeExists = true; + indexExists = true; validArgumentCount++; } break; @@ -1121,10 +1183,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, level, transitionTime); + emberAfMediaInputClusterSelectInputCallback(apCommandObj, index); } else { @@ -1132,182 +1194,97 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { - // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV - // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. - // Any error value TLVUnpackError means we have received an illegal value. - CHIP_ERROR TLVError = CHIP_NO_ERROR; - CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t moveMode; - bool moveModeExists = false; - uint8_t rate; - bool rateExists = false; - uint32_t validArgumentCount = 0; + case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { - while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) - { - switch (TLV::TagNumFromTag(aDataTlv.GetTag())) - { - case 0: - if (moveModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(moveMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - moveModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (rateExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(rate); - if (CHIP_NO_ERROR == TLVUnpackError) - { - rateExists = true; - validArgumentCount++; - } - break; - default: - // Unsupported tag, ignore it. - ChipLogProgress(Zcl, "Unknown TLV tag during processing."); - break; - } - if (TLVUnpackError != CHIP_NO_ERROR) - { - ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, - TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); - break; - } - } + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaInputClusterShowInputStatusCallback(apCommandObj); + break; + } + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_INPUT_CLUSTER_ID); + break; + } + } + } +} - if (CHIP_END_OF_TLV == TLVError) - { - // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. - TLVError = CHIP_NO_ERROR; - } - else - { - ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); - } +} // namespace MediaInput - // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) - { - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, moveMode, rate); - } - else - { - apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, - Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogProgress( - Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); - } +namespace MediaPlayback { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); + break; + } + case ZCL_MEDIA_NEXT_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); + break; + } + case ZCL_MEDIA_PAUSE_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); + break; + } + case ZCL_MEDIA_PLAY_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); break; } - case ZCL_STEP_COMMAND_ID: { + case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); + break; + } + case ZCL_MEDIA_REWIND_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); + break; + } + case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t stepMode; - bool stepModeExists = false; - uint8_t stepSize; - bool stepSizeExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint8_t optionMask; - bool optionMaskExists = false; - uint8_t optionOverride; - bool optionOverrideExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (stepModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (stepSizeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepSize); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepSizeExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(transitionTime); - if (CHIP_NO_ERROR == TLVUnpackError) - { - transitionTimeExists = true; - validArgumentCount++; - } - break; - case 3: - if (optionMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionMaskExists = true; - validArgumentCount++; - } - break; - case 4: - if (optionOverrideExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionOverride); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - optionOverrideExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -1335,11 +1312,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterStepCallback(apCommandObj, stepMode, stepSize, transitionTime, optionMask, - optionOverride); + emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -1347,67 +1323,35 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 5, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { + case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t stepMode; - bool stepModeExists = false; - uint8_t stepSize; - bool stepSizeExists = false; - uint16_t transitionTime; - bool transitionTimeExists = false; - uint32_t validArgumentCount = 0; + uint64_t deltaPositionMilliseconds; + bool deltaPositionMillisecondsExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (stepModeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepMode); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepModeExists = true; - validArgumentCount++; - } - break; - case 1: - if (stepSizeExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(stepSize); - if (CHIP_NO_ERROR == TLVUnpackError) - { - stepSizeExists = true; - validArgumentCount++; - } - break; - case 2: - if (transitionTimeExists) + if (deltaPositionMillisecondsExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(transitionTime); + TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); if (CHIP_NO_ERROR == TLVUnpackError) { - transitionTimeExists = true; + deltaPositionMillisecondsExists = true; validArgumentCount++; } break; @@ -1435,10 +1379,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, stepMode, stepSize, transitionTime); + emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); } else { @@ -1446,20 +1390,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 3, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_STOP_COMMAND_ID: { + case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint8_t optionMask; - bool optionMaskExists = false; - uint8_t optionOverride; - bool optionOverrideExists = false; + uint64_t position; + bool positionExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1467,30 +1409,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (optionMaskExists) - { - ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); - TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; - break; - } - TLVUnpackError = aDataTlv.Get(optionMask); - if (CHIP_NO_ERROR == TLVUnpackError) - { - optionMaskExists = true; - validArgumentCount++; - } - break; - case 1: - if (optionOverrideExists) + if (positionExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(optionOverride); + TLVUnpackError = aDataTlv.Get(position); if (CHIP_NO_ERROR == TLVUnpackError) { - optionOverrideExists = true; + positionExists = true; validArgumentCount++; } break; @@ -1518,10 +1446,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterStopCallback(apCommandObj, optionMask, optionOverride); + emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); } else { @@ -1529,97 +1457,106 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 2, validArgumentCount, TLVError, TLVUnpackError); + 1, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { + case ZCL_MEDIA_START_OVER_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj); + emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); + break; + } + case ZCL_MEDIA_STOP_COMMAND_ID: { + + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); break; } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_LEVEL_CONTROL_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); break; } } } } -} // namespace LevelControl +} // namespace MediaPlayback -namespace MediaPlayback { +namespace OnOff { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_MEDIA_FAST_FORWARD_COMMAND_ID: { + case ZCL_OFF_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaFastForwardCallback(apCommandObj); + emberAfOnOffClusterOffCallback(apCommandObj); break; } - case ZCL_MEDIA_NEXT_COMMAND_ID: { + case ZCL_ON_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaNextCallback(apCommandObj); + emberAfOnOffClusterOnCallback(apCommandObj); break; } - case ZCL_MEDIA_PAUSE_COMMAND_ID: { + case ZCL_TOGGLE_COMMAND_ID: { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPauseCallback(apCommandObj); + emberAfOnOffClusterToggleCallback(apCommandObj); break; } - case ZCL_MEDIA_PLAY_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPlayCallback(apCommandObj); + default: { + // Unrecognized command ID, error status will apply. + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_ON_OFF_CLUSTER_ID); break; } - case ZCL_MEDIA_PREVIOUS_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaPreviousCallback(apCommandObj); - break; } - case ZCL_MEDIA_REWIND_COMMAND_ID: { + } +} - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaRewindCallback(apCommandObj); - break; - } - case ZCL_MEDIA_SKIP_BACKWARD_COMMAND_ID: { +} // namespace OnOff + +namespace TvChannel { + +void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) +{ + { + switch (aCommandId) + { + case ZCL_CHANGE_CHANNEL_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; + const uint8_t * match; + bool matchExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (deltaPositionMillisecondsExists) + if (matchExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(match); if (CHIP_NO_ERROR == TLVUnpackError) { - deltaPositionMillisecondsExists = true; + matchExists = true; validArgumentCount++; } break; @@ -1650,7 +1587,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipBackwardCallback(apCommandObj, deltaPositionMilliseconds); + emberAfTvChannelClusterChangeChannelCallback(apCommandObj, const_cast(match)); } else { @@ -1662,31 +1599,47 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_MEDIA_SKIP_FORWARD_COMMAND_ID: { + case ZCL_CHANGE_CHANNEL_BY_NUMBER_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t deltaPositionMilliseconds; - bool deltaPositionMillisecondsExists = false; - uint32_t validArgumentCount = 0; + uint16_t majorNumber; + bool majorNumberExists = false; + uint16_t minorNumber; + bool minorNumberExists = false; + uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) { switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (deltaPositionMillisecondsExists) + if (majorNumberExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(deltaPositionMilliseconds); + TLVUnpackError = aDataTlv.Get(majorNumber); if (CHIP_NO_ERROR == TLVUnpackError) { - deltaPositionMillisecondsExists = true; + majorNumberExists = true; + validArgumentCount++; + } + break; + case 1: + if (minorNumberExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(minorNumber); + if (CHIP_NO_ERROR == TLVUnpackError) + { + minorNumberExists = true; validArgumentCount++; } break; @@ -1714,10 +1667,10 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } // TODO(#5590) We should encode a response of status code for invalid TLV. - if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipForwardCallback(apCommandObj, deltaPositionMilliseconds); + emberAfTvChannelClusterChangeChannelByNumberCallback(apCommandObj, majorNumber, minorNumber); } else { @@ -1725,18 +1678,18 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); ChipLogProgress( Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, - 1, validArgumentCount, TLVError, TLVUnpackError); + 2, validArgumentCount, TLVError, TLVUnpackError); } break; } - case ZCL_MEDIA_SKIP_SEEK_COMMAND_ID: { + case ZCL_SKIP_CHANNEL_COMMAND_ID: { // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. // Any error value TLVUnpackError means we have received an illegal value. CHIP_ERROR TLVError = CHIP_NO_ERROR; CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; - uint64_t position; - bool positionExists = false; + uint16_t Count; + bool CountExists = false; uint32_t validArgumentCount = 0; while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) @@ -1744,16 +1697,16 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En switch (TLV::TagNumFromTag(aDataTlv.GetTag())) { case 0: - if (positionExists) + if (CountExists) { ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; break; } - TLVUnpackError = aDataTlv.Get(position); + TLVUnpackError = aDataTlv.Get(Count); if (CHIP_NO_ERROR == TLVUnpackError) { - positionExists = true; + CountExists = true; validArgumentCount++; } break; @@ -1784,7 +1737,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount) { // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaSkipSeekCallback(apCommandObj, position); + emberAfTvChannelClusterSkipChannelCallback(apCommandObj, Count); } else { @@ -1796,68 +1749,122 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En } break; } - case ZCL_MEDIA_START_OVER_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStartOverCallback(apCommandObj); - break; - } - case ZCL_MEDIA_STOP_COMMAND_ID: { - - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfMediaPlaybackClusterMediaStopCallback(apCommandObj); - break; - } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_MEDIA_PLAYBACK_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TV_CHANNEL_CLUSTER_ID); break; } } } } -} // namespace MediaPlayback +} // namespace TvChannel -namespace OnOff { +namespace TargetNavigator { void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, EndpointId aEndpointId, TLV::TLVReader & aDataTlv) { { switch (aCommandId) { - case ZCL_OFF_COMMAND_ID: { + case ZCL_NAVIGATE_TARGET_COMMAND_ID: { + // We are using TLVUnpackError and TLVError here since both of them can be CHIP_END_OF_TLV + // When TLVError is CHIP_END_OF_TLV, it means we have iterated all of the items, which is not a real error. + // Any error value TLVUnpackError means we have received an illegal value. + CHIP_ERROR TLVError = CHIP_NO_ERROR; + CHIP_ERROR TLVUnpackError = CHIP_NO_ERROR; + uint8_t target; + bool targetExists = false; + const uint8_t * data; + bool dataExists = false; + uint32_t validArgumentCount = 0; - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterOffCallback(apCommandObj); - break; - } - case ZCL_ON_COMMAND_ID: { + while ((TLVError = aDataTlv.Next()) == CHIP_NO_ERROR) + { + switch (TLV::TagNumFromTag(aDataTlv.GetTag())) + { + case 0: + if (targetExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + TLVUnpackError = aDataTlv.Get(target); + if (CHIP_NO_ERROR == TLVUnpackError) + { + targetExists = true; + validArgumentCount++; + } + break; + case 1: + if (dataExists) + { + ChipLogProgress(Zcl, "Duplicate TLV tag %" PRIx32, TLV::TagNumFromTag(aDataTlv.GetTag())); + TLVUnpackError = CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_ELEMENT; + break; + } + // TODO(#5542): The cluster handlers should accept a ByteSpan for all string types. + TLVUnpackError = aDataTlv.GetDataPtr(data); + if (CHIP_NO_ERROR == TLVUnpackError) + { + dataExists = true; + validArgumentCount++; + } + break; + default: + // Unsupported tag, ignore it. + ChipLogProgress(Zcl, "Unknown TLV tag during processing."); + break; + } + if (TLVUnpackError != CHIP_NO_ERROR) + { + ChipLogProgress(Zcl, "Failed to decode TLV data with tag %" PRIx32 ": %" PRId32, + TLV::TagNumFromTag(aDataTlv.GetTag()), TLVUnpackError); + break; + } + } - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterOnCallback(apCommandObj); - break; - } - case ZCL_TOGGLE_COMMAND_ID: { + if (CHIP_END_OF_TLV == TLVError) + { + // CHIP_END_OF_TLV means we have iterated all items in the structure, which is not a real error. + TLVError = CHIP_NO_ERROR; + } + else + { + ChipLogProgress(Zcl, "Failed to decode TLV data: %" PRId32, TLVError); + } - // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. - emberAfOnOffClusterToggleCallback(apCommandObj); + // TODO(#5590) We should encode a response of status code for invalid TLV. + if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount) + { + // TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks. + emberAfTargetNavigatorClusterNavigateTargetCallback(apCommandObj, target, const_cast(data)); + } + else + { + apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kBadRequest, + Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); + ChipLogProgress( + Zcl, "Failed to dispatch command, %d/%" PRIu32 " arguments parsed, TLVError=%" PRIu32 ", UnpackError=%" PRIu32, + 2, validArgumentCount, TLVError, TLVUnpackError); + } break; } default: { // Unrecognized command ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, Protocols::SecureChannel::kProtocolCodeGeneralFailure); - ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_ON_OFF_CLUSTER_ID); + ChipLogError(Zcl, "Unknown command %" PRIx16 " for cluster %" PRIx16, aCommandId, ZCL_TARGET_NAVIGATOR_CLUSTER_ID); break; } } } } -} // namespace OnOff +} // namespace TargetNavigator } // namespace clusters @@ -1874,6 +1881,9 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_ACCOUNT_LOGIN_CLUSTER_ID: clusters::AccountLogin::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; + case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID: + clusters::ApplicationLauncher::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; case ZCL_AUDIO_OUTPUT_CLUSTER_ID: clusters::AudioOutput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; @@ -1883,8 +1893,14 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_GENERAL_COMMISSIONING_CLUSTER_ID: clusters::GeneralCommissioning::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; - case ZCL_LEVEL_CONTROL_CLUSTER_ID: - clusters::LevelControl::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + case ZCL_KEYPAD_INPUT_CLUSTER_ID: + clusters::KeypadInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; + case ZCL_LOW_POWER_CLUSTER_ID: + clusters::LowPower::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; + case ZCL_MEDIA_INPUT_CLUSTER_ID: + clusters::MediaInput::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: clusters::MediaPlayback::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); @@ -1892,6 +1908,12 @@ void DispatchSingleClusterCommand(chip::ClusterId aClusterId, chip::CommandId aC case ZCL_ON_OFF_CLUSTER_ID: clusters::OnOff::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); break; + case ZCL_TV_CHANNEL_CLUSTER_ID: + clusters::TvChannel::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; + case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: + clusters::TargetNavigator::DispatchServerCommand(apCommandObj, aCommandId, aEndPointId, aReader); + break; default: // Unrecognized cluster ID, error status will apply. apCommandObj->AddStatusCode(nullptr, Protocols::SecureChannel::GeneralStatusCode::kNotFound, Protocols::SecureChannel::Id, diff --git a/examples/tv-app/tv-common/gen/call-command-handler.cpp b/examples/tv-app/tv-common/gen/call-command-handler.cpp index 55fa8266aa7000..9ac0c2d36a3055 100644 --- a/examples/tv-app/tv-common/gen/call-command-handler.cpp +++ b/examples/tv-app/tv-common/gen/call-command-handler.cpp @@ -95,8 +95,7 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID: - // No commands are enabled for cluster Application Launcher - result = status(false, true, cmd->mfgSpecific); + result = emberAfApplicationLauncherClusterServerCommandParse(cmd); break; case ZCL_AUDIO_OUTPUT_CLUSTER_ID: result = emberAfAudioOutputClusterServerCommandParse(cmd); @@ -120,19 +119,17 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_KEYPAD_INPUT_CLUSTER_ID: - // No commands are enabled for cluster Keypad Input - result = status(false, true, cmd->mfgSpecific); + result = emberAfKeypadInputClusterServerCommandParse(cmd); break; case ZCL_LEVEL_CONTROL_CLUSTER_ID: - result = emberAfLevelControlClusterServerCommandParse(cmd); + // No commands are enabled for cluster Level Control + result = status(false, true, cmd->mfgSpecific); break; case ZCL_LOW_POWER_CLUSTER_ID: - // No commands are enabled for cluster Low Power - result = status(false, true, cmd->mfgSpecific); + result = emberAfLowPowerClusterServerCommandParse(cmd); break; case ZCL_MEDIA_INPUT_CLUSTER_ID: - // No commands are enabled for cluster Media Input - result = status(false, true, cmd->mfgSpecific); + result = emberAfMediaInputClusterServerCommandParse(cmd); break; case ZCL_MEDIA_PLAYBACK_CLUSTER_ID: result = emberAfMediaPlaybackClusterServerCommandParse(cmd); @@ -145,12 +142,10 @@ EmberAfStatus emberAfClusterSpecificCommandParse(EmberAfClusterCommand * cmd) result = status(false, true, cmd->mfgSpecific); break; case ZCL_TV_CHANNEL_CLUSTER_ID: - // No commands are enabled for cluster TV Channel - result = status(false, true, cmd->mfgSpecific); + result = emberAfTvChannelClusterServerCommandParse(cmd); break; case ZCL_TARGET_NAVIGATOR_CLUSTER_ID: - // No commands are enabled for cluster Target Navigator - result = status(false, true, cmd->mfgSpecific); + result = emberAfTargetNavigatorClusterServerCommandParse(cmd); break; case ZCL_WAKE_ON_LAN_CLUSTER_ID: // No commands are enabled for cluster Wake on LAN @@ -215,6 +210,38 @@ EmberAfStatus emberAfAccountLoginClusterServerCommandParse(EmberAfClusterCommand } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfApplicationLauncherClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_LAUNCH_APP_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t * data; + /* TYPE WARNING: array array defaults to */ uint8_t * application; + + if (cmd->bufLen < payloadOffset + 1u) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + emberAfStringLength(data) + 1u); + application = cmd->buffer + payloadOffset; + + wasHandled = emberAfApplicationLauncherClusterLaunchAppCallback(nullptr, data, application); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} EmberAfStatus emberAfAudioOutputClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -402,7 +429,7 @@ EmberAfStatus emberAfGeneralCommissioningClusterServerCommandParse(EmberAfCluste } return status(wasHandled, true, cmd->mfgSpecific); } -EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand * cmd) +EmberAfStatus emberAfKeypadInputClusterServerCommandParse(EmberAfClusterCommand * cmd) { bool wasHandled = false; @@ -410,205 +437,94 @@ EmberAfStatus emberAfLevelControlClusterServerCommandParse(EmberAfClusterCommand { switch (cmd->commandId) { - case ZCL_MOVE_COMMAND_ID: { + case ZCL_SEND_KEY_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t moveMode; - uint8_t rate; - uint8_t optionMask; - uint8_t optionOverride; + uint8_t keyCode; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + keyCode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfLevelControlClusterMoveCallback(nullptr, moveMode, rate, optionMask, optionOverride); + wasHandled = emberAfKeypadInputClusterSendKeyCallback(nullptr, keyCode); break; } - case ZCL_MOVE_TO_LEVEL_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t level; - uint16_t transitionTime; - uint8_t optionMask; - uint8_t optionOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfLevelControlClusterMoveToLevelCallback(nullptr, level, transitionTime, optionMask, optionOverride); + default: { + // Unrecognized command ID, error status will apply. break; } - case ZCL_MOVE_TO_LEVEL_WITH_ON_OFF_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t level; - uint16_t transitionTime; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - level = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} +EmberAfStatus emberAfLowPowerClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; - wasHandled = emberAfLevelControlClusterMoveToLevelWithOnOffCallback(nullptr, level, transitionTime); + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_SLEEP_COMMAND_ID: { + wasHandled = emberAfLowPowerClusterSleepCallback(nullptr); break; } - case ZCL_MOVE_WITH_ON_OFF_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t moveMode; - uint8_t rate; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - moveMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - rate = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - - wasHandled = emberAfLevelControlClusterMoveWithOnOffCallback(nullptr, moveMode, rate); + default: { + // Unrecognized command ID, error status will apply. break; } - case ZCL_STEP_COMMAND_ID: { - uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t stepMode; - uint8_t stepSize; - uint16_t transitionTime; - uint8_t optionMask; - uint8_t optionOverride; - - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 2); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} +EmberAfStatus emberAfMediaInputClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; - wasHandled = - emberAfLevelControlClusterStepCallback(nullptr, stepMode, stepSize, transitionTime, optionMask, optionOverride); + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_HIDE_INPUT_STATUS_COMMAND_ID: { + wasHandled = emberAfMediaInputClusterHideInputStatusCallback(nullptr); break; } - case ZCL_STEP_WITH_ON_OFF_COMMAND_ID: { + case ZCL_RENAME_INPUT_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t stepMode; - uint8_t stepSize; - uint16_t transitionTime; + uint8_t index; + uint8_t * name; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - stepMode = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - stepSize = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 2) + if (cmd->bufLen < payloadOffset + 1u) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - transitionTime = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + name = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfLevelControlClusterStepWithOnOffCallback(nullptr, stepMode, stepSize, transitionTime); + wasHandled = emberAfMediaInputClusterRenameInputCallback(nullptr, index, name); break; } - case ZCL_STOP_COMMAND_ID: { + case ZCL_SELECT_INPUT_COMMAND_ID: { uint16_t payloadOffset = cmd->payloadStartIndex; - uint8_t optionMask; - uint8_t optionOverride; + uint8_t index; if (cmd->bufLen < payloadOffset + 1) { return EMBER_ZCL_STATUS_MALFORMED_COMMAND; } - optionMask = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - payloadOffset = static_cast(payloadOffset + 1); - if (cmd->bufLen < payloadOffset + 1) - { - return EMBER_ZCL_STATUS_MALFORMED_COMMAND; - } - optionOverride = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + index = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); - wasHandled = emberAfLevelControlClusterStopCallback(nullptr, optionMask, optionOverride); + wasHandled = emberAfMediaInputClusterSelectInputCallback(nullptr, index); break; } - case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: { - wasHandled = emberAfLevelControlClusterStopWithOnOffCallback(nullptr); + case ZCL_SHOW_INPUT_STATUS_COMMAND_ID: { + wasHandled = emberAfMediaInputClusterShowInputStatusCallback(nullptr); break; } default: { @@ -734,3 +650,101 @@ EmberAfStatus emberAfOnOffClusterServerCommandParse(EmberAfClusterCommand * cmd) } return status(wasHandled, true, cmd->mfgSpecific); } +EmberAfStatus emberAfTvChannelClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_CHANGE_CHANNEL_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t * match; + + if (cmd->bufLen < payloadOffset + 1u) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + match = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTvChannelClusterChangeChannelCallback(nullptr, match); + break; + } + case ZCL_CHANGE_CHANNEL_BY_NUMBER_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint16_t majorNumber; + uint16_t minorNumber; + + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + majorNumber = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 2); + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + minorNumber = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTvChannelClusterChangeChannelByNumberCallback(nullptr, majorNumber, minorNumber); + break; + } + case ZCL_SKIP_CHANNEL_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint16_t Count; + + if (cmd->bufLen < payloadOffset + 2) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + Count = emberAfGetInt16u(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTvChannelClusterSkipChannelCallback(nullptr, Count); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} +EmberAfStatus emberAfTargetNavigatorClusterServerCommandParse(EmberAfClusterCommand * cmd) +{ + bool wasHandled = false; + + if (!cmd->mfgSpecific) + { + switch (cmd->commandId) + { + case ZCL_NAVIGATE_TARGET_COMMAND_ID: { + uint16_t payloadOffset = cmd->payloadStartIndex; + uint8_t target; + uint8_t * data; + + if (cmd->bufLen < payloadOffset + 1) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + target = emberAfGetInt8u(cmd->buffer, payloadOffset, cmd->bufLen); + payloadOffset = static_cast(payloadOffset + 1); + if (cmd->bufLen < payloadOffset + 1u) + { + return EMBER_ZCL_STATUS_MALFORMED_COMMAND; + } + data = emberAfGetString(cmd->buffer, payloadOffset, cmd->bufLen); + + wasHandled = emberAfTargetNavigatorClusterNavigateTargetCallback(nullptr, target, data); + break; + } + default: { + // Unrecognized command ID, error status will apply. + break; + } + } + } + return status(wasHandled, true, cmd->mfgSpecific); +} diff --git a/examples/tv-app/tv-common/gen/callback.h b/examples/tv-app/tv-common/gen/callback.h index 92392de0f2237a..81a954961484ca 100644 --- a/examples/tv-app/tv-common/gen/callback.h +++ b/examples/tv-app/tv-common/gen/callback.h @@ -1543,6 +1543,15 @@ bool emberAfAccountLoginClusterGetSetupPINCallback(chip::app::Command * commandO bool emberAfAccountLoginClusterLoginCallback(chip::app::Command * commandObj, uint8_t * tempAccountIdentifier, uint8_t * setupPIN); +/** + * @brief Application Launcher Cluster LaunchApp Command callback + * @param data + * @param application + */ + +bool emberAfApplicationLauncherClusterLaunchAppCallback(chip::app::Command * commandObj, uint8_t * data, + /* TYPE WARNING: array array defaults to */ uint8_t * application); + /** * @brief Audio Output Cluster RenameOutput Command callback * @param index @@ -1602,79 +1611,44 @@ bool emberAfGeneralCommissioningClusterSetRegulatoryConfigCallback(chip::app::Co uint8_t * countryCode, uint64_t breadcrumb, uint32_t timeoutMs); /** - * @brief Level Control Cluster Move Command callback - * @param moveMode - * @param rate - * @param optionMask - * @param optionOverride - */ - -bool emberAfLevelControlClusterMoveCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate, uint8_t optionMask, - uint8_t optionOverride); - -/** - * @brief Level Control Cluster MoveToLevel Command callback - * @param level - * @param transitionTime - * @param optionMask - * @param optionOverride + * @brief Keypad Input Cluster SendKey Command callback + * @param keyCode */ -bool emberAfLevelControlClusterMoveToLevelCallback(chip::app::Command * commandObj, uint8_t level, uint16_t transitionTime, - uint8_t optionMask, uint8_t optionOverride); +bool emberAfKeypadInputClusterSendKeyCallback(chip::app::Command * commandObj, uint8_t keyCode); /** - * @brief Level Control Cluster MoveToLevelWithOnOff Command callback - * @param level - * @param transitionTime + * @brief Low Power Cluster Sleep Command callback */ -bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(chip::app::Command * commandObj, uint8_t level, - uint16_t transitionTime); +bool emberAfLowPowerClusterSleepCallback(chip::app::Command * commandObj); /** - * @brief Level Control Cluster MoveWithOnOff Command callback - * @param moveMode - * @param rate + * @brief Media Input Cluster HideInputStatus Command callback */ -bool emberAfLevelControlClusterMoveWithOnOffCallback(chip::app::Command * commandObj, uint8_t moveMode, uint8_t rate); +bool emberAfMediaInputClusterHideInputStatusCallback(chip::app::Command * commandObj); /** - * @brief Level Control Cluster Step Command callback - * @param stepMode - * @param stepSize - * @param transitionTime - * @param optionMask - * @param optionOverride - */ - -bool emberAfLevelControlClusterStepCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, - uint16_t transitionTime, uint8_t optionMask, uint8_t optionOverride); - -/** - * @brief Level Control Cluster StepWithOnOff Command callback - * @param stepMode - * @param stepSize - * @param transitionTime + * @brief Media Input Cluster RenameInput Command callback + * @param index + * @param name */ -bool emberAfLevelControlClusterStepWithOnOffCallback(chip::app::Command * commandObj, uint8_t stepMode, uint8_t stepSize, - uint16_t transitionTime); +bool emberAfMediaInputClusterRenameInputCallback(chip::app::Command * commandObj, uint8_t index, uint8_t * name); /** - * @brief Level Control Cluster Stop Command callback - * @param optionMask - * @param optionOverride + * @brief Media Input Cluster SelectInput Command callback + * @param index */ -bool emberAfLevelControlClusterStopCallback(chip::app::Command * commandObj, uint8_t optionMask, uint8_t optionOverride); +bool emberAfMediaInputClusterSelectInputCallback(chip::app::Command * commandObj, uint8_t index); /** - * @brief Level Control Cluster StopWithOnOff Command callback + * @brief Media Input Cluster ShowInputStatus Command callback */ -bool emberAfLevelControlClusterStopWithOnOffCallback(chip::app::Command * commandObj); +bool emberAfMediaInputClusterShowInputStatusCallback(chip::app::Command * commandObj); /** * @brief Media Playback Cluster MediaFastForward Command callback @@ -1763,6 +1737,37 @@ bool emberAfOnOffClusterOnCallback(chip::app::Command * commandObj); bool emberAfOnOffClusterToggleCallback(chip::app::Command * commandObj); +/** + * @brief TV Channel Cluster ChangeChannel Command callback + * @param match + */ + +bool emberAfTvChannelClusterChangeChannelCallback(chip::app::Command * commandObj, uint8_t * match); + +/** + * @brief TV Channel Cluster ChangeChannelByNumber Command callback + * @param majorNumber + * @param minorNumber + */ + +bool emberAfTvChannelClusterChangeChannelByNumberCallback(chip::app::Command * commandObj, uint16_t majorNumber, + uint16_t minorNumber); + +/** + * @brief TV Channel Cluster SkipChannel Command callback + * @param count + */ + +bool emberAfTvChannelClusterSkipChannelCallback(chip::app::Command * commandObj, uint16_t Count); + +/** + * @brief Target Navigator Cluster NavigateTarget Command callback + * @param target + * @param data + */ + +bool emberAfTargetNavigatorClusterNavigateTargetCallback(chip::app::Command * commandObj, uint8_t target, uint8_t * data); + // // Non-Cluster Related Callbacks //